Add global wires
This commit is contained in:
parent
d5174110fa
commit
b271e59472
@ -1325,4 +1325,7 @@ X(WIRE_TYPE_V01)
|
||||
X(WIRE_TYPE_V02)
|
||||
X(WIRE_TYPE_V06)
|
||||
|
||||
X(WIRE_TYPE_G_HPBX)
|
||||
X(WIRE_TYPE_G_HPBX)
|
||||
X(WIRE_TYPE_G_VPTX)
|
||||
X(WIRE_TYPE_L_HPBX)
|
||||
X(WIRE_TYPE_R_HPBX)
|
58
ecp5/gfx.cc
58
ecp5/gfx.cc
@ -716,6 +716,39 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdS
|
||||
g.push_back(el);
|
||||
}
|
||||
}
|
||||
if (wire_type == id_WIRE_TYPE_G_HPBX) {
|
||||
el.x1 = x;
|
||||
el.x2 = x + 1;
|
||||
el.y1 = y + 0.1f + 0.0017f * (tilewire - TILE_WIRE_G_HPBX0000 + 1);
|
||||
el.y2 = el.y1;
|
||||
g.push_back(el);
|
||||
|
||||
el.x1 = x + switchbox_x1 + 0.0017f * (200 + (tilewire - TILE_WIRE_G_HPBX0000));
|
||||
el.x2 = el.x1;
|
||||
el.y2 = y + switchbox_y1;
|
||||
g.push_back(el);
|
||||
}
|
||||
if (wire_type == id_WIRE_TYPE_G_VPTX) {
|
||||
el.x1 = x + 0.1f + 0.0017f * (tilewire - TILE_WIRE_G_VPTX0000 + 1);
|
||||
el.x2 = el.x1;
|
||||
el.y1 = y;
|
||||
el.y2 = y + 1;
|
||||
g.push_back(el);
|
||||
}
|
||||
if (wire_type == id_WIRE_TYPE_L_HPBX) {
|
||||
el.x1 = x - 3;
|
||||
el.x2 = x + 0.08f;
|
||||
el.y1 = y + 0.0017f + 0.0017f * (tilewire - TILE_WIRE_L_HPBX0000 + 1);
|
||||
el.y2 = el.y1;
|
||||
g.push_back(el);
|
||||
}
|
||||
if (wire_type == id_WIRE_TYPE_R_HPBX) {
|
||||
el.x1 = x + 0.2;
|
||||
el.x2 = x + 3;
|
||||
el.y1 = y + 0.0017f + 0.0017f * (tilewire - TILE_WIRE_R_HPBX0000 + 1);
|
||||
el.y2 = el.y1;
|
||||
g.push_back(el);
|
||||
}
|
||||
}
|
||||
|
||||
void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id)
|
||||
@ -770,6 +803,10 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr
|
||||
el.y1 = y + switchbox_y1 + 0.0017f * (96 + (src_id - TILE_WIRE_V06N0303) + 10 * (src.location.y % 9));
|
||||
}
|
||||
if (src_type == id_WIRE_TYPE_NONE) {
|
||||
if (src_id >= TILE_WIRE_CLK0 && src_id <= TILE_WIRE_LSR1) {
|
||||
el.x1 = x + switchbox_x2;
|
||||
el.y1 = y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_CLK0 - 5) + 3 * slice_pitch;
|
||||
}
|
||||
if (src_id >= TILE_WIRE_FCO && src_id <= TILE_WIRE_FCI) {
|
||||
int gap = (src_id - TILE_WIRE_FCO) / 24;
|
||||
el.x1 = src.location.x + switchbox_x2;
|
||||
@ -907,6 +944,10 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr
|
||||
el.x1 = src.location.x + slice_x1 + 0.0017f * (num + 1);
|
||||
el.y1 = src.location.y + slice_y2 - 1 * slice_pitch - 0.015f;
|
||||
}
|
||||
if (src_type == id_WIRE_TYPE_G_HPBX) {
|
||||
el.x1 = x + switchbox_x1 + 0.0017f * (200 + (src_id - TILE_WIRE_G_HPBX0000));
|
||||
el.y1 = y + switchbox_y1;
|
||||
}
|
||||
}
|
||||
|
||||
void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, IdString dst_type, GfxTileWireId dst_id)
|
||||
@ -962,6 +1003,10 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst,
|
||||
}
|
||||
|
||||
if (dst_type == id_WIRE_TYPE_NONE) {
|
||||
if (dst_id >= TILE_WIRE_CLK0 && dst_id <= TILE_WIRE_LSR1) {
|
||||
el.x2 = x + switchbox_x2;
|
||||
el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_CLK0 - 5) + 3 * slice_pitch;
|
||||
}
|
||||
if (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) {
|
||||
int gap = (dst_id - TILE_WIRE_FCO) / 24;
|
||||
el.x2 = x + switchbox_x2;
|
||||
@ -1100,6 +1145,10 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst,
|
||||
el.x2 = dst.location.x + slice_x1 + 0.0017f * (num + 1);
|
||||
el.y2 = dst.location.y + slice_y2 - 1 * slice_pitch - 0.015f;
|
||||
}
|
||||
if (dst_type == id_WIRE_TYPE_G_HPBX) {
|
||||
el.x2 = x + switchbox_x1 + 0.0017f * (200 + (dst_id - TILE_WIRE_G_HPBX0000));
|
||||
el.y2 = y + switchbox_y1;
|
||||
}
|
||||
}
|
||||
|
||||
void straightLine(std::vector<GraphicElement> &g, GraphicElement &el, int x, int y, int w, int h, WireId src,
|
||||
@ -1461,6 +1510,15 @@ void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, int w, int h, Wire
|
||||
(src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) {
|
||||
straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id);
|
||||
}
|
||||
|
||||
if (dst_type == id_WIRE_TYPE_NONE && src_type == id_WIRE_TYPE_G_HPBX &&
|
||||
((dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7) ||
|
||||
(dst_id >= TILE_WIRE_CLK0 && dst_id <= TILE_WIRE_FCI))) {
|
||||
straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id);
|
||||
}
|
||||
if ((dst_type == id_WIRE_TYPE_H01 || dst_type == id_WIRE_TYPE_V01) && src_type == id_WIRE_TYPE_G_HPBX) {
|
||||
straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id);
|
||||
}
|
||||
}
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
85
ecp5/gfx.h
85
ecp5/gfx.h
@ -408,23 +408,6 @@ enum GfxTileWireId
|
||||
TILE_WIRE_H06W0003,
|
||||
TILE_WIRE_H06E0003,
|
||||
|
||||
TILE_WIRE_G_HPBX0000,
|
||||
TILE_WIRE_G_HPBX0100,
|
||||
TILE_WIRE_G_HPBX0200,
|
||||
TILE_WIRE_G_HPBX0300,
|
||||
TILE_WIRE_G_HPBX0400,
|
||||
TILE_WIRE_G_HPBX0500,
|
||||
TILE_WIRE_G_HPBX0600,
|
||||
TILE_WIRE_G_HPBX0700,
|
||||
TILE_WIRE_G_HPBX0800,
|
||||
TILE_WIRE_G_HPBX0900,
|
||||
TILE_WIRE_G_HPBX1000,
|
||||
TILE_WIRE_G_HPBX1100,
|
||||
TILE_WIRE_G_HPBX1200,
|
||||
TILE_WIRE_G_HPBX1300,
|
||||
TILE_WIRE_G_HPBX1400,
|
||||
TILE_WIRE_G_HPBX1500,
|
||||
|
||||
TILE_WIRE_DDRDEL_DQS,
|
||||
TILE_WIRE_JRST_DQS,
|
||||
TILE_WIRE_ECLK_DQS,
|
||||
@ -2157,8 +2140,74 @@ enum GfxTileWireId
|
||||
TILE_WIRE_ECLKA,
|
||||
TILE_WIRE_ECLKB,
|
||||
TILE_WIRE_ECLKC,
|
||||
TILE_WIRE_ECLKD
|
||||
TILE_WIRE_ECLKD,
|
||||
|
||||
TILE_WIRE_G_VPTX0000,
|
||||
TILE_WIRE_G_VPTX0100,
|
||||
TILE_WIRE_G_VPTX0200,
|
||||
TILE_WIRE_G_VPTX0300,
|
||||
TILE_WIRE_G_VPTX0400,
|
||||
TILE_WIRE_G_VPTX0500,
|
||||
TILE_WIRE_G_VPTX0600,
|
||||
TILE_WIRE_G_VPTX0700,
|
||||
TILE_WIRE_G_VPTX0800,
|
||||
TILE_WIRE_G_VPTX0900,
|
||||
TILE_WIRE_G_VPTX1000,
|
||||
TILE_WIRE_G_VPTX1100,
|
||||
TILE_WIRE_G_VPTX1200,
|
||||
TILE_WIRE_G_VPTX1300,
|
||||
TILE_WIRE_G_VPTX1400,
|
||||
TILE_WIRE_G_VPTX1500,
|
||||
|
||||
TILE_WIRE_G_HPBX0000,
|
||||
TILE_WIRE_G_HPBX0100,
|
||||
TILE_WIRE_G_HPBX0200,
|
||||
TILE_WIRE_G_HPBX0300,
|
||||
TILE_WIRE_G_HPBX0400,
|
||||
TILE_WIRE_G_HPBX0500,
|
||||
TILE_WIRE_G_HPBX0600,
|
||||
TILE_WIRE_G_HPBX0700,
|
||||
TILE_WIRE_G_HPBX0800,
|
||||
TILE_WIRE_G_HPBX0900,
|
||||
TILE_WIRE_G_HPBX1000,
|
||||
TILE_WIRE_G_HPBX1100,
|
||||
TILE_WIRE_G_HPBX1200,
|
||||
TILE_WIRE_G_HPBX1300,
|
||||
TILE_WIRE_G_HPBX1400,
|
||||
TILE_WIRE_G_HPBX1500,
|
||||
|
||||
TILE_WIRE_L_HPBX0000,
|
||||
TILE_WIRE_L_HPBX0100,
|
||||
TILE_WIRE_L_HPBX0200,
|
||||
TILE_WIRE_L_HPBX0300,
|
||||
TILE_WIRE_L_HPBX0400,
|
||||
TILE_WIRE_L_HPBX0500,
|
||||
TILE_WIRE_L_HPBX0600,
|
||||
TILE_WIRE_L_HPBX0700,
|
||||
TILE_WIRE_L_HPBX0800,
|
||||
TILE_WIRE_L_HPBX0900,
|
||||
TILE_WIRE_L_HPBX1000,
|
||||
TILE_WIRE_L_HPBX1100,
|
||||
TILE_WIRE_L_HPBX1200,
|
||||
TILE_WIRE_L_HPBX1300,
|
||||
TILE_WIRE_L_HPBX1400,
|
||||
TILE_WIRE_L_HPBX1500,
|
||||
TILE_WIRE_R_HPBX0000,
|
||||
TILE_WIRE_R_HPBX0100,
|
||||
TILE_WIRE_R_HPBX0200,
|
||||
TILE_WIRE_R_HPBX0300,
|
||||
TILE_WIRE_R_HPBX0400,
|
||||
TILE_WIRE_R_HPBX0500,
|
||||
TILE_WIRE_R_HPBX0600,
|
||||
TILE_WIRE_R_HPBX0700,
|
||||
TILE_WIRE_R_HPBX0800,
|
||||
TILE_WIRE_R_HPBX0900,
|
||||
TILE_WIRE_R_HPBX1000,
|
||||
TILE_WIRE_R_HPBX1100,
|
||||
TILE_WIRE_R_HPBX1200,
|
||||
TILE_WIRE_R_HPBX1300,
|
||||
TILE_WIRE_R_HPBX1400,
|
||||
TILE_WIRE_R_HPBX1500
|
||||
};
|
||||
|
||||
void gfxTileBel(std::vector<GraphicElement> &g, int x, int y, int z, int w, int h, IdString bel_type,
|
||||
|
@ -140,6 +140,15 @@ def wire_type(name):
|
||||
if name[0].startswith("G_HPBX"):
|
||||
return "WIRE_TYPE_G_HPBX"
|
||||
|
||||
if name[0].startswith("G_VPTX"):
|
||||
return "WIRE_TYPE_G_VPTX"
|
||||
|
||||
if name[0].startswith("L_HPBX"):
|
||||
return "WIRE_TYPE_L_HPBX"
|
||||
|
||||
if name[0].startswith("R_HPBX"):
|
||||
return "WIRE_TYPE_R_HPBX"
|
||||
|
||||
return "WIRE_TYPE_NONE"
|
||||
|
||||
def is_global(loc):
|
||||
|
Loading…
Reference in New Issue
Block a user