From d1feb2aa2d9865807083888c5d24cdbbd98a942a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 23 Oct 2019 18:17:08 +0200 Subject: display horizontal wires, add some globals to list --- ecp5/constids.inc | 2 ++ ecp5/gfx.cc | 51 ++++++++++++++++++++++++++++++++++++- ecp5/gfx.h | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ ecp5/trellis_import.py | 3 +++ 4 files changed, 123 insertions(+), 1 deletion(-) diff --git a/ecp5/constids.inc b/ecp5/constids.inc index 63ca4b26..76c9bc8c 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1305,3 +1305,5 @@ X(WIRE_TYPE_V00) X(WIRE_TYPE_V01) X(WIRE_TYPE_V02) X(WIRE_TYPE_V06) + +X(WIRE_TYPE_G_HPBX) \ No newline at end of file diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index c749bad7..950ccc3c 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -127,7 +127,56 @@ void gfxTileWire(std::vector &g, int x, int y, IdString wire_typ el.x2 = x + switchbox_x1; } g.push_back(el); - } + } + if (wire_type == id_WIRE_TYPE_H02) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.x2 = el.x1; + el.y1 = y + switchbox_y1; + el.y2 = y + switchbox_y1 - 0.0017f*(20 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + g.push_back(el); + + el.x2 = (x+2) + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.y1 = el.y2; + g.push_back(el); + + el.x2 = (x+1) + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.x1 = el.x2; + el.y1 = y + switchbox_y1; + g.push_back(el); + + el.x2 = (x+2) + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.x1 = el.x2; + el.y1 = y + switchbox_y1; + 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); + + el.x2 = (x+6) + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.y1 = el.y2; + g.push_back(el); + + el.x2 = (x+3) + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.x1 = el.x2; + el.y1 = y + switchbox_y1; + g.push_back(el); + + el.x2 = (x+6) + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.x1 = el.x2; + el.y1 = y + switchbox_y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_NONE) { if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE) { diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 6a6d7ad2..d880b06e 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -365,6 +365,74 @@ enum GfxTileWireId TILE_WIRE_WBOUNCE, TILE_WIRE_EBOUNCE, + TILE_WIRE_V02N0701, + TILE_WIRE_V02S0701, + TILE_WIRE_V02N0601, + TILE_WIRE_V02S0601, + TILE_WIRE_V02N0501, + TILE_WIRE_V02S0501, + TILE_WIRE_V02N0401, + TILE_WIRE_V02S0401, + TILE_WIRE_V02N0301, + TILE_WIRE_V02S0301, + TILE_WIRE_V02N0201, + TILE_WIRE_V02S0201, + TILE_WIRE_V02N0101, + TILE_WIRE_V02S0101, + TILE_WIRE_V02N0001, + TILE_WIRE_V02S0001, + + TILE_WIRE_V06N0303, + TILE_WIRE_V06S0303, + TILE_WIRE_V06N0203, + TILE_WIRE_V06S0203, + TILE_WIRE_V06N0103, + TILE_WIRE_V06S0103, + TILE_WIRE_V06N0003, + TILE_WIRE_V06S0003, + + TILE_WIRE_H02W0701, + TILE_WIRE_H02E0701, + TILE_WIRE_H02W0601, + TILE_WIRE_H02E0601, + TILE_WIRE_H02W0501, + TILE_WIRE_H02E0501, + TILE_WIRE_H02W0401, + TILE_WIRE_H02E0401, + TILE_WIRE_H02W0301, + TILE_WIRE_H02E0301, + TILE_WIRE_H02W0201, + TILE_WIRE_H02E0201, + TILE_WIRE_H02W0101, + TILE_WIRE_H02E0101, + TILE_WIRE_H02W0001, + TILE_WIRE_H02E0001, + + TILE_WIRE_H06W0303, + TILE_WIRE_H06E0303, + TILE_WIRE_H06W0203, + TILE_WIRE_H06E0203, + TILE_WIRE_H06W0103, + TILE_WIRE_H06E0103, + TILE_WIRE_H06W0003, + TILE_WIRE_H06E0003, + + TILE_WIRE_G_HPBX0000, + TILE_WIRE_G_HPBX0100, + TILE_WIRE_G_HPBX0200, + TILE_WIRE_G_HPBX0300, + TILE_WIRE_G_HPBX0400, + TILE_WIRE_G_HPBX0500, + TILE_WIRE_G_HPBX0600, + TILE_WIRE_G_HPBX0700, + TILE_WIRE_G_HPBX0800, + TILE_WIRE_G_HPBX0900, + TILE_WIRE_G_HPBX1000, + TILE_WIRE_G_HPBX1100, + TILE_WIRE_G_HPBX1200, + TILE_WIRE_G_HPBX1300, + TILE_WIRE_G_HPBX1400, + TILE_WIRE_G_HPBX1500, }; void gfxTileWire(std::vector &g, int x, int y, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style); diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index 821a8a10..68fbfe53 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -80,6 +80,9 @@ def wire_type(name): if name[0].startswith("V06"): return "WIRE_TYPE_V06" + if name[0].startswith("G_HPBX"): + return "WIRE_TYPE_G_HPBX" + return "WIRE_TYPE_NONE" def is_global(loc): -- cgit v1.2.3