aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/gfx.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-08-18 16:20:33 +0200
committerClifford Wolf <clifford@clifford.at>2018-08-18 16:20:33 +0200
commit456a83430ac85c23045f95d3fe0c6d380413fe92 (patch)
treef509c5d4e021252cde6969d1d12c5197ef246d0e /ice40/gfx.cc
parent5500cf3aff5daa4d094c7c4ab46551105f0cb7cc (diff)
downloadnextpnr-456a83430ac85c23045f95d3fe0c6d380413fe92.tar.gz
nextpnr-456a83430ac85c23045f95d3fe0c6d380413fe92.tar.bz2
nextpnr-456a83430ac85c23045f95d3fe0c6d380413fe92.zip
Improve iCE40 gfx for IO tiles and RAM tiles
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ice40/gfx.cc')
-rw-r--r--ice40/gfx.cc49
1 files changed, 49 insertions, 0 deletions
diff --git a/ice40/gfx.cc b/ice40/gfx.cc
index 1ab2fb3c..11bf29eb 100644
--- a/ice40/gfx.cc
+++ b/ice40/gfx.cc
@@ -457,6 +457,42 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id,
}
}
+ // LC Control for IO and BRAM
+
+ if (id >= TILE_WIRE_FUNC_GLOBAL_CEN && id <= TILE_WIRE_FUNC_GLOBAL_S_R) {
+ int idx = id - TILE_WIRE_FUNC_GLOBAL_CEN;
+
+ 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 + 2);
+ g.push_back(el);
+
+ el.y1 = el.y2;
+ el.x2 = x + logic_cell_x2 - 0.005 * (2 - idx + 5);
+ g.push_back(el);
+
+ el.y2 = y + logic_cell_y1;
+ el.x1 = el.x2;
+ g.push_back(el);
+ }
+
+ if (id == TILE_WIRE_FABOUT) {
+ el.y1 = y + main_swbox_y1;
+ el.y2 = el.y1 - 0.005 * 4;
+ el.x1 = x + main_swbox_x2 - 0.005 * 9;
+ el.x2 = el.x1;
+ g.push_back(el);
+ }
+
+ if (id == TILE_WIRE_FUNC_GLOBAL_G0) {
+ el.y1 = y + logic_cell_y1;
+ el.y2 = el.y1 - 0.005 * 4;
+ el.x1 = x + logic_cell_x2 - 0.005 * 3;
+ el.x2 = el.x1;
+ g.push_back(el);
+ }
+
// LC Cascade
if (id >= TILE_WIRE_LUTFF_0_LOUT && id <= TILE_WIRE_LUTFF_6_LOUT) {
@@ -626,6 +662,19 @@ static bool getWireXY_main(GfxTileWireId id, float &x, float &y)
return true;
}
+ if (id >= TILE_WIRE_FUNC_GLOBAL_CEN && id <= TILE_WIRE_FUNC_GLOBAL_S_R) {
+ int idx = id - TILE_WIRE_FUNC_GLOBAL_CEN;
+ x = main_swbox_x2 - 0.005 * (idx + 5);
+ y = main_swbox_y1;
+ return true;
+ }
+
+ if (id == TILE_WIRE_FABOUT) {
+ x = main_swbox_x2 - 0.005 * 9;
+ y = main_swbox_y1;
+ return true;
+ }
+
return false;
}