aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/gfx.cc
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-11-09 13:12:20 +0100
committerMiodrag Milanovic <mmicko@gmail.com>2019-11-09 13:12:20 +0100
commitf6d74cb7a91db81410d4990f94b133447081f902 (patch)
tree1e36c8ba2531cd78ecc11dcdfe39e37d3c438040 /ecp5/gfx.cc
parent49760a9ea81180024783a06ee9ac052035de98ea (diff)
downloadnextpnr-f6d74cb7a91db81410d4990f94b133447081f902.tar.gz
nextpnr-f6d74cb7a91db81410d4990f94b133447081f902.tar.bz2
nextpnr-f6d74cb7a91db81410d4990f94b133447081f902.zip
Draw some pips, fixed H6 and V6
Diffstat (limited to 'ecp5/gfx.cc')
-rw-r--r--ecp5/gfx.cc65
1 files changed, 35 insertions, 30 deletions
diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc
index 5828965f..f13a6ab7 100644
--- a/ecp5/gfx.cc
+++ b/ecp5/gfx.cc
@@ -168,70 +168,50 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdS
GraphicElement el;
el.type = GraphicElement::TYPE_LINE;
el.style = style;
+
el.y1 = y + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
el.y2 = el.y1;
el.x1 = x + switchbox_x1;
el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
g.push_back(el);
- int y1 = y + 1;
- if (y1> h - 1) y1 = h - 1;
-
- el.y2 = y1 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
- el.x1 = el.x2;
- g.push_back(el);
+ int y2 = y - 3;
+ if (y2<0) y2 = 0;
- el.y1 = el.y2;
- el.x1 = x + switchbox_x1;
+ el.y1 = y2 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
+ el.y2 = el.y1;
g.push_back(el);
- int y2 = y - 1;
- if (y2<0) y2 = 0;
-
el.y1 = y + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
el.y2 = y2 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
el.x1 = el.x2;
g.push_back(el);
-
- el.y1 = el.y2;
- el.x1 = x + switchbox_x1;
- g.push_back(el);
}
if (wire_type == id_WIRE_TYPE_H06) {
GraphicElement el;
el.type = GraphicElement::TYPE_LINE;
el.style = style;
+
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
el.x2 = el.x1;
el.y1 = y + switchbox_y1;
el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
g.push_back(el);
- int x1 = x + 3;
- if (x1> w - 1) x1 = w - 1;
-
- el.x2 = x1 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
- el.y1 = el.y2;
- g.push_back(el);
-
- el.x1 = el.x2;
- el.y1 = y + switchbox_y1;
- g.push_back(el);
-
int x2 = x - 3;
if (x2<0) x2 = 0;
+ el.x1 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
+ el.x2 = el.x1;
+ g.push_back(el);
+
el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
el.x2 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3));
el.y1 = el.y2;
g.push_back(el);
-
- el.x1 = el.x2;
- el.y1 = y + switchbox_y1;
- g.push_back(el);
}
if (wire_type == id_WIRE_TYPE_V06) {
@@ -414,4 +394,29 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdS
}
+void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style)
+{
+ GraphicElement el;
+ el.type = GraphicElement::TYPE_LINE;
+ el.style = style;
+
+ if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V06) {
+ el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 20 *(x%3));
+ el.y1 = y + switchbox_y1;
+
+ el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
+ el.x2 = x + switchbox_x1;
+ g.push_back(el);
+ }
+ if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) {
+ el.x1 = x + switchbox_x2;
+ el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001);
+
+ el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
+ el.x2 = x + switchbox_x1;
+ g.push_back(el);
+ }
+
+}
+
NEXTPNR_NAMESPACE_END