diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-07-09 15:45:01 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-07-09 15:45:01 +0200 |
commit | 6198a68968c6e8c66ad8209bf31b77b9511102d8 (patch) | |
tree | 71231da3652951c72e543d31f3800eaa1cc7d774 /ice40 | |
parent | a4129036518678ee35d5d8adde3dfe0b699491ea (diff) | |
download | nextpnr-6198a68968c6e8c66ad8209bf31b77b9511102d8.tar.gz nextpnr-6198a68968c6e8c66ad8209bf31b77b9511102d8.tar.bz2 nextpnr-6198a68968c6e8c66ad8209bf31b77b9511102d8.zip |
Add horizontal ice40 span4 wire gfx
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/gfx.cc | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/ice40/gfx.cc b/ice40/gfx.cc index 46824b06..5a30c79d 100644 --- a/ice40/gfx.cc +++ b/ice40/gfx.cc @@ -23,6 +23,55 @@ NEXTPNR_NAMESPACE_BEGIN void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id) { + if (id >= TILE_WIRE_SP4_H_L_36 && id <= TILE_WIRE_SP4_H_L_47) { + int idx = (id - TILE_WIRE_SP4_H_L_36) + 48; + GraphicElement el; + el.type = GraphicElement::G_LINE; + + float y1 = y + 0.03 + 0.0025 * (60 - idx); + + el.x1 = x + 0.0; + el.x2 = x + 0.9; + el.y1 = y1; + el.y2 = y1; + g.push_back(el); + } + + if (id >= TILE_WIRE_SP4_H_R_0 && id <= TILE_WIRE_SP4_H_R_47) { + int idx = id - TILE_WIRE_SP4_H_R_0; + GraphicElement el; + el.type = GraphicElement::G_LINE; + + float y1 = y + 0.03 + 0.0025 * (60 - idx); + float y2 = y + 0.03 + 0.0025 * (60 - (idx ^ 1)); + float y3 = y + 0.03 + 0.0025 * (60 - (idx ^ 1) - 12); + + if (idx >= 12) { + el.x1 = x; + el.x2 = x + 0.01; + el.y1 = y1; + el.y2 = y1; + g.push_back(el); + + el.x1 = x + 0.01; + el.x2 = x + 0.02; + el.y1 = y1; + el.y2 = y2; + g.push_back(el); + } + + el.x1 = x + 0.02; + el.x2 = x + 0.9; + el.y1 = y2; + el.y2 = y2; + g.push_back(el); + + el.x1 = x + 0.9; + el.x2 = x + 1.0; + el.y1 = y2; + el.y2 = y3; + g.push_back(el); + } } NEXTPNR_NAMESPACE_END |