aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-07-11 19:02:30 +0200
committerClifford Wolf <clifford@clifford.at>2018-07-11 19:02:30 +0200
commit33e592e55e30e097db08218d4dc0888c6058f5f2 (patch)
tree0d8dac6601c1574302eb9984b8706d32059b4c9e /ice40
parent6ffae27aa14ee48ebd5713e540bfc53568e56fd6 (diff)
downloadnextpnr-33e592e55e30e097db08218d4dc0888c6058f5f2.tar.gz
nextpnr-33e592e55e30e097db08218d4dc0888c6058f5f2.tar.bz2
nextpnr-33e592e55e30e097db08218d4dc0888c6058f5f2.zip
Add missing wires to ice40 gfx
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/gfx.cc56
1 files changed, 54 insertions, 2 deletions
diff --git a/ice40/gfx.cc b/ice40/gfx.cc
index 2d6b048b..64bb66ec 100644
--- a/ice40/gfx.cc
+++ b/ice40/gfx.cc
@@ -364,7 +364,7 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
el.type = GraphicElement::G_LINE;
el.x1 = x + local_swbox_x2;
el.x2 = x + logic_cell_x1;
- el.y1 = y + (logic_cell_y1 + logic_cell_y2) / 2 - 0.0125 + (0.005 * input) + z * logic_cell_pitch;
+ el.y1 = y + (logic_cell_y1 + logic_cell_y2) / 2 - 0.0075 + (0.005 * input) + z * logic_cell_pitch;
el.y2 = el.y1;
g.push_back(el);
}
@@ -404,7 +404,7 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
el.x1 = x + main_swbox_x2 - 0.005 * (idx + 5);
el.x2 = el.x1;
el.y1 = y + main_swbox_y1;
- el.y2 = el.y1 - 0.005 * (idx + 3);
+ el.y2 = el.y1 - 0.005 * (idx + 2);
g.push_back(el);
el.y1 = el.y2;
@@ -414,6 +414,58 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
el.y2 = y + logic_cell_y1;
el.x1 = el.x2;
g.push_back(el);
+
+ for (int i = 0; i < 7; i ++) {
+ el.y1 = y + logic_cell_y2 + i * logic_cell_pitch;
+ el.y2 = y + logic_cell_y1 + (i + 1) * logic_cell_pitch;
+ g.push_back(el);
+ }
+ }
+
+ // LC Cascade
+
+ if (id >= TILE_WIRE_LUTFF_0_LOUT && id <= TILE_WIRE_LUTFF_6_LOUT) {
+ int idx = id - TILE_WIRE_LUTFF_0_LOUT;
+ GraphicElement el;
+ el.type = GraphicElement::G_LINE;
+ el.x1 = x + logic_cell_x1 + 0.005 * 5;
+ el.x2 = el.x1;
+ el.y1 = y + logic_cell_y2 + idx * logic_cell_pitch;
+ el.y2 = y + logic_cell_y1 + (idx + 1) * logic_cell_pitch;
+ g.push_back(el);
+ }
+
+ // Carry Chain
+
+ if (id >= TILE_WIRE_LUTFF_0_COUT && id <= TILE_WIRE_LUTFF_7_COUT) {
+ int idx = id - TILE_WIRE_LUTFF_0_COUT;
+ GraphicElement el;
+ el.type = GraphicElement::G_LINE;
+ el.x1 = x + logic_cell_x1 + 0.005 * 3;
+ el.x2 = el.x1;
+ el.y1 = y + logic_cell_y2 + idx * logic_cell_pitch;
+ el.y2 = y + (idx < 7 ? logic_cell_y1 + (idx + 1) * logic_cell_pitch : 1.0);
+ g.push_back(el);
+ }
+
+ if (id == TILE_WIRE_CARRY_IN) {
+ GraphicElement el;
+ el.type = GraphicElement::G_LINE;
+ el.x1 = x + logic_cell_x1 + 0.005 * 3;
+ el.x2 = el.x1;
+ el.y1 = y;
+ el.y2 = y + 0.01;
+ g.push_back(el);
+ }
+
+ if (id == TILE_WIRE_CARRY_IN_MUX) {
+ GraphicElement el;
+ el.type = GraphicElement::G_LINE;
+ el.x1 = x + logic_cell_x1 + 0.005 * 3;
+ el.x2 = el.x1;
+ el.y1 = y + 0.02;
+ el.y2 = y + logic_cell_y1;
+ g.push_back(el);
}
}