aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-07-09 17:13:26 +0200
committerClifford Wolf <clifford@clifford.at>2018-07-09 17:13:26 +0200
commit46d28551fca591ce6b1cd2e1de5385661077b7e3 (patch)
tree4046f74fb989e88c8af72513d37c105a5327a723
parent132c5b5019fa485d7e99311bb27cfdb47fc05226 (diff)
downloadnextpnr-46d28551fca591ce6b1cd2e1de5385661077b7e3.tar.gz
nextpnr-46d28551fca591ce6b1cd2e1de5385661077b7e3.tar.bz2
nextpnr-46d28551fca591ce6b1cd2e1de5385661077b7e3.zip
Add ice40 LC output gfx
Signed-off-by: Clifford Wolf <clifford@clifford.at>
-rw-r--r--ice40/gfx.cc31
-rw-r--r--ice40/gfx.h2
2 files changed, 30 insertions, 3 deletions
diff --git a/ice40/gfx.cc b/ice40/gfx.cc
index d59c00aa..58e52d65 100644
--- a/ice40/gfx.cc
+++ b/ice40/gfx.cc
@@ -126,7 +126,7 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
el.x2 = x3;
g.push_back(el);
- float y1 = y + 0.03 + 0.0025 * (142 - idx);
+ float y1 = y + 0.03 + 0.0025 * (154 - idx);
el.y1 = y1;
el.y2 = y1;
@@ -194,7 +194,7 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
GraphicElement el;
el.type = GraphicElement::G_LINE;
- float y1 = y + 0.03 + 0.0025 * (142 - idx);
+ float y1 = y + 0.03 + 0.0025 * (154 - idx);
el.y1 = y1;
el.y2 = y1;
@@ -255,6 +255,8 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
g.push_back(el);
}
+ // LC Inputs
+
if (id >= TILE_WIRE_LUTFF_0_IN_0 && id <= TILE_WIRE_LUTFF_7_IN_3) {
int idx = id - TILE_WIRE_LUTFF_0_IN_0;
int z = idx / 4;
@@ -267,6 +269,31 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
el.y2 = el.y1;
g.push_back(el);
}
+
+ // LC Outputs
+
+ if (id >= TILE_WIRE_LUTFF_0_OUT && id <= TILE_WIRE_LUTFF_7_OUT) {
+ int idx = id - TILE_WIRE_LUTFF_0_OUT;
+
+ float y1 = y + 0.03 + 0.0025 * (102 - idx);
+
+ GraphicElement el;
+ el.type = GraphicElement::G_LINE;
+ el.y1 = y1;
+ el.y2 = y1;
+ el.x1 = x + 0.3;
+ el.x2 = x + 0.97 + 0.0025 * idx;
+ g.push_back(el);
+
+ el.y1 = y1;
+ el.y2 = y + (logic_cell_y1 + logic_cell_y2) / 2 + idx * logic_cell_pitch;
+ el.x1 = el.x2;
+ g.push_back(el);
+
+ el.y1 = el.y2;
+ el.x1 = x + logic_cell_x2;
+ g.push_back(el);
+ }
}
NEXTPNR_NAMESPACE_END
diff --git a/ice40/gfx.h b/ice40/gfx.h
index 784ba23f..0fdfc326 100644
--- a/ice40/gfx.h
+++ b/ice40/gfx.h
@@ -60,7 +60,7 @@ const float span4v_swbox_y1 = 0.300;
const float span4v_swbox_y2 = 0.400;
const float logic_cell_x1 = 0.82;
-const float logic_cell_x2 = 0.92;
+const float logic_cell_x2 = 0.95;
const float logic_cell_y1 = 0.45;
const float logic_cell_y2 = 0.50;
const float logic_cell_pitch = 0.0625;