Draw some pips, fixed H6 and V6
This commit is contained in:
parent
49760a9ea8
commit
f6d74cb7a9
23
ecp5/arch.cc
23
ecp5/arch.cc
@ -632,6 +632,19 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
|
||||
|
||||
gfxTileWire(ret, x, y, chip_info->width, chip_info->height, wire_type, tilewire, style);
|
||||
}
|
||||
if (decal.type == DecalId::TYPE_PIP) {
|
||||
PipId pip;
|
||||
pip.index = decal.z;
|
||||
pip.location = decal.location;
|
||||
WireId src_wire = getPipSrcWire(pip);
|
||||
WireId dst_wire = getPipDstWire(pip);
|
||||
int x = decal.location.x;
|
||||
int y = chip_info->height - 1 - decal.location.y;
|
||||
GfxTileWireId src_id = GfxTileWireId(locInfo(src_wire)->wire_data[src_wire.index].tile_wire);
|
||||
GfxTileWireId dst_id = GfxTileWireId(locInfo(dst_wire)->wire_data[dst_wire.index].tile_wire);
|
||||
GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_HIDDEN;
|
||||
gfxTilePip(ret, x, y, chip_info->width, chip_info->height, src_wire, getWireType(src_wire), src_id, dst_wire, getWireType(dst_wire), dst_id, style);
|
||||
}
|
||||
if (decal.type == DecalId::TYPE_BEL) {
|
||||
BelId bel;
|
||||
bel.index = decal.z;
|
||||
@ -702,7 +715,15 @@ DecalXY Arch::getWireDecal(WireId wire) const
|
||||
return decalxy;
|
||||
}
|
||||
|
||||
DecalXY Arch::getPipDecal(PipId pip) const { return {}; };
|
||||
DecalXY Arch::getPipDecal(PipId pip) const
|
||||
{
|
||||
DecalXY decalxy;
|
||||
decalxy.decal.type = DecalId::TYPE_PIP;
|
||||
decalxy.decal.location = pip.location;
|
||||
decalxy.decal.z = pip.index;
|
||||
decalxy.decal.active = getBoundPipNet(pip) != nullptr;
|
||||
return decalxy;
|
||||
};
|
||||
|
||||
DecalXY Arch::getGroupDecal(GroupId group) const
|
||||
{
|
||||
|
67
ecp5/gfx.cc
67
ecp5/gfx.cc
@ -168,70 +168,50 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdS
|
||||
GraphicElement el;
|
||||
el.type = GraphicElement::TYPE_LINE;
|
||||
el.style = style;
|
||||
|
||||
el.y1 = y + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
|
||||
el.y2 = el.y1;
|
||||
el.x1 = x + switchbox_x1;
|
||||
el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
|
||||
g.push_back(el);
|
||||
|
||||
int y1 = y + 1;
|
||||
if (y1> h - 1) y1 = h - 1;
|
||||
|
||||
el.y2 = y1 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
|
||||
el.x1 = el.x2;
|
||||
g.push_back(el);
|
||||
|
||||
el.y1 = el.y2;
|
||||
el.x1 = x + switchbox_x1;
|
||||
g.push_back(el);
|
||||
|
||||
int y2 = y - 1;
|
||||
int y2 = y - 3;
|
||||
if (y2<0) y2 = 0;
|
||||
|
||||
el.y1 = y2 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
|
||||
el.y2 = el.y1;
|
||||
g.push_back(el);
|
||||
|
||||
el.y1 = y + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
|
||||
el.y2 = y2 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
|
||||
el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
|
||||
el.x1 = el.x2;
|
||||
g.push_back(el);
|
||||
|
||||
el.y1 = el.y2;
|
||||
el.x1 = x + switchbox_x1;
|
||||
g.push_back(el);
|
||||
}
|
||||
|
||||
if (wire_type == id_WIRE_TYPE_H06) {
|
||||
GraphicElement el;
|
||||
el.type = GraphicElement::TYPE_LINE;
|
||||
el.style = style;
|
||||
|
||||
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
||||
el.x2 = el.x1;
|
||||
el.y1 = y + switchbox_y1;
|
||||
el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
||||
g.push_back(el);
|
||||
|
||||
int x1 = x + 3;
|
||||
if (x1> w - 1) x1 = w - 1;
|
||||
|
||||
el.x2 = x1 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
||||
el.y1 = el.y2;
|
||||
g.push_back(el);
|
||||
|
||||
el.x1 = el.x2;
|
||||
el.y1 = y + switchbox_y1;
|
||||
g.push_back(el);
|
||||
|
||||
int x2 = x - 3;
|
||||
if (x2<0) x2 = 0;
|
||||
|
||||
el.x1 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
||||
el.x2 = el.x1;
|
||||
g.push_back(el);
|
||||
|
||||
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
||||
el.x2 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
||||
el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
||||
el.y1 = el.y2;
|
||||
g.push_back(el);
|
||||
|
||||
el.x1 = el.x2;
|
||||
el.y1 = y + switchbox_y1;
|
||||
g.push_back(el);
|
||||
}
|
||||
|
||||
if (wire_type == id_WIRE_TYPE_V06) {
|
||||
@ -414,4 +394,29 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdS
|
||||
|
||||
}
|
||||
|
||||
void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style)
|
||||
{
|
||||
GraphicElement el;
|
||||
el.type = GraphicElement::TYPE_LINE;
|
||||
el.style = style;
|
||||
|
||||
if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V06) {
|
||||
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 20 *(x%3));
|
||||
el.y1 = y + switchbox_y1;
|
||||
|
||||
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
||||
el.x2 = x + switchbox_x1;
|
||||
g.push_back(el);
|
||||
}
|
||||
if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) {
|
||||
el.x1 = x + switchbox_x2;
|
||||
el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001);
|
||||
|
||||
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
|
||||
el.x2 = x + switchbox_x1;
|
||||
g.push_back(el);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -436,6 +436,7 @@ enum GfxTileWireId
|
||||
};
|
||||
|
||||
void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style);
|
||||
void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style);
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user