aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-11-10 11:10:13 +0100
committerMiodrag Milanovic <mmicko@gmail.com>2019-11-10 11:10:13 +0100
commit43c7b4fa2113c2eaca0053fe9395dc4fd0635be3 (patch)
treec287b4d6cb38bd560930554c742a864f37a690be /ecp5
parent9a9265f4d2c5d1c4f1a5bb90aece2647990e8b56 (diff)
downloadnextpnr-43c7b4fa2113c2eaca0053fe9395dc4fd0635be3.tar.gz
nextpnr-43c7b4fa2113c2eaca0053fe9395dc4fd0635be3.tar.bz2
nextpnr-43c7b4fa2113c2eaca0053fe9395dc4fd0635be3.zip
Fixed V2, some more pips
Diffstat (limited to 'ecp5')
-rw-r--r--ecp5/gfx.cc55
1 files changed, 43 insertions, 12 deletions
diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc
index 77572437..373112a7 100644
--- a/ecp5/gfx.cc
+++ b/ecp5/gfx.cc
@@ -163,31 +163,41 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdS
el.y1 = y + switchbox_y1;
g.push_back(el);
}
-
+
if (wire_type == id_WIRE_TYPE_V02) {
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.y1 = y + switchbox_y1 + 0.0017f*(20 + (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 y2 = y - 3;
- if (y2<0) y2 = 0;
+ int y1 = y + 1;
+ if (y1> h - 1) y1 = h - 1;
- el.y1 = y2 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
- el.y2 = el.y1;
+ el.y2 = y1 + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
+ el.x1 = el.x2;
g.push_back(el);
- 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.y1 = el.y2;
+ el.x1 = x + switchbox_x1;
+ g.push_back(el);
+
+ int y2 = y - 1;
+ if (y2<0) y2 = 0;
+
+ el.y1 = y + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3));
+ el.y2 = y2 + switchbox_y1 + 0.0017f*(20 + (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;
@@ -434,7 +444,7 @@ void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, int w, int h, Wire
}
if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V06) {
el.x1 = x + switchbox_x1;
- el.y1 = y + switchbox_y1 + 0.0017f*(16 + (src_id - TILE_WIRE_V02N0701)+ 20 *(y%3));
+ el.y1 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3));
el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2;
el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3));
@@ -452,10 +462,31 @@ void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, int w, int h, Wire
el.y1 = y + switchbox_y1;
el.x2 = x + switchbox_x1;
- el.y2 = y + switchbox_y1 + 0.0017f*(16 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(y%3));
+ el.y2 = y + switchbox_y1 + 0.0017f*(20 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(dst.location.y%3));
g.push_back(el);
}
+ if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) {
+
+ el.x1 = x + switchbox_x1;
+ el.y1 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3));
+
+ el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 - 0.0017f*(src_id - TILE_WIRE_V02N0701);
+ el.y2 = el.y1;
+
+ g.push_back(el);
+
+ el.y2 = y + switchbox_y1 + 0.0017f*(20 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(dst.location.y%3));
+ el.x1 = el.x2;
+
+ g.push_back(el);
+
+ el.y1 = el.y2;
+ el.x1 = x + switchbox_x1;
+
+ g.push_back(el);
+
+ }
}