aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergiusz Bazanski <q3k@q3k.org>2018-07-12 20:24:00 +0100
committerSergiusz Bazanski <q3k@q3k.org>2018-07-12 20:24:00 +0100
commit681d82413191e5379bd5d0147d05a0879e005c49 (patch)
tree8c695352188dfa696ec9878816f06866f060ede2
parent284b4750ee6a3a5a4e33590cbbccaaccfd2c5899 (diff)
parentf9ef4cd4bdeaccef6fd1522441be8fd0f80249c1 (diff)
downloadnextpnr-681d82413191e5379bd5d0147d05a0879e005c49.tar.gz
nextpnr-681d82413191e5379bd5d0147d05a0879e005c49.tar.bz2
nextpnr-681d82413191e5379bd5d0147d05a0879e005c49.zip
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr into q3k/fix-zoom
-rw-r--r--common/nextpnr.h10
-rw-r--r--ecp5/arch.cc2
-rw-r--r--ecp5/family.cmake11
-rw-r--r--gui/fpgaviewwidget.cc21
-rw-r--r--gui/fpgaviewwidget.h14
-rw-r--r--ice40/arch.cc24
-rw-r--r--ice40/arch.h8
-rw-r--r--ice40/chipdb.py35
-rw-r--r--ice40/family.cmake6
-rw-r--r--ice40/gfx.cc47
-rw-r--r--ice40/gfx.h2
11 files changed, 121 insertions, 59 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index a162b85c..00a939a9 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -136,7 +136,7 @@ NEXTPNR_NAMESPACE_BEGIN
struct GraphicElement
{
- enum
+ enum type_t
{
G_NONE,
G_LINE,
@@ -145,6 +145,14 @@ struct GraphicElement
G_LABEL
} type = G_NONE;
+ enum style_t
+ {
+ G_FRAME,
+ G_HIDDEN,
+ G_INACTIVE,
+ G_ACTIVE,
+ } style = G_FRAME;
+
float x1 = 0, y1 = 0, x2 = 0, y2 = 0, z = 0;
std::string text;
};
diff --git a/ecp5/arch.cc b/ecp5/arch.cc
index 286151d8..ace0703e 100644
--- a/ecp5/arch.cc
+++ b/ecp5/arch.cc
@@ -317,7 +317,7 @@ DecalXY Arch::getWireDecal(WireId wire) const { return {}; }
DecalXY Arch::getPipDecal(PipId pip) const { return {}; };
-DecalXY Arch::getGroupDecal(PipId pip) const { return {}; };
+DecalXY Arch::getGroupDecal(GroupId pip) const { return {}; };
// -----------------------------------------------------------------------
diff --git a/ecp5/family.cmake b/ecp5/family.cmake
index f58cdbb2..f4d0bf87 100644
--- a/ecp5/family.cmake
+++ b/ecp5/family.cmake
@@ -1,6 +1,17 @@
set(devices 45k)
+if (NOT DEFINED TRELLIS_ROOT)
+ message(FATAL_ERROR "you must define TRELLIS_ROOT using -DTRELLIS_ROOT=/path/to/prjtrellis for ECP5 support")
+endif()
+
+
+file( GLOB found_pytrellis ${TRELLIS_ROOT}/libtrellis/pytrellis.*)
+
+if ("${found_pytrellis}" STREQUAL "")
+ message(FATAL_ERROR "failed to find pytrellis library in ${TRELLIS_ROOT}/libtrellis/")
+endif()
+
set(DB_PY ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/trellis_import.py)
file(MAKE_DIRECTORY ecp5/chipdbs/)
diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc
index 4bb101fa..edb3aca8 100644
--- a/gui/fpgaviewwidget.cc
+++ b/gui/fpgaviewwidget.cc
@@ -243,6 +243,13 @@ void LineShader::draw(const LineShaderData &line, const QMatrix4x4 &projection)
FPGAViewWidget::FPGAViewWidget(QWidget *parent)
: QOpenGLWidget(parent), lineShader_(this), zoom_(500.f), ctx_(nullptr)
{
+ backgroundColor = QColor("#ffffff");
+ gridColor = QColor("#ddd");
+ belColor = QColor("#303030");
+ wireColor = QColor("#303030");
+ pipColor = QColor("#303030");
+ groupColor = QColor("#303030");
+ frameColor = QColor("#0066ba");
auto fmt = format();
fmt.setMajorVersion(3);
fmt.setMinorVersion(1);
@@ -277,7 +284,7 @@ void FPGAViewWidget::initializeGL()
log_error("Could not compile shader.\n");
}
initializeOpenGLFunctions();
- glClearColor(1.0, 1.0, 1.0, 0.0);
+ glClearColor(backgroundColor.red()/255, backgroundColor.green()/255, backgroundColor.blue()/255, 0.0);
}
void FPGAViewWidget::drawElement(LineShaderData &out, const GraphicElement &el)
@@ -325,7 +332,7 @@ void FPGAViewWidget::paintGL()
float thick11Px = mouseToWorldCoordinates(1.1, 0).x();
// Draw grid.
- auto grid = LineShaderData(thick1Px, QColor("#DDD"));
+ auto grid = LineShaderData(thick1Px, gridColor);
for (float i = -100.0f; i < 100.0f; i += 1.0f) {
PolyLine(-100.0f, i, 100.0f, i).build(grid);
PolyLine(i, -100.0f, i, 100.0f).build(grid);
@@ -333,7 +340,7 @@ void FPGAViewWidget::paintGL()
lineShader_.draw(grid, matrix);
// Draw Bels.
- auto bels = LineShaderData(thick11Px, QColor("#b000ba"));
+ auto bels = LineShaderData(thick11Px, belColor);
if (ctx_) {
for (auto bel : ctx_->getBels()) {
for (auto &el : ctx_->getBelGraphics(bel))
@@ -343,7 +350,7 @@ void FPGAViewWidget::paintGL()
}
// Draw Wires.
- auto wires = LineShaderData(thick11Px, QColor("#b000ba"));
+ auto wires = LineShaderData(thick11Px, wireColor);
if (ctx_) {
for (auto wire : ctx_->getWires()) {
for (auto &el : ctx_->getWireGraphics(wire))
@@ -353,7 +360,7 @@ void FPGAViewWidget::paintGL()
}
// Draw Pips.
- auto pips = LineShaderData(thick11Px, QColor("#b000ba"));
+ auto pips = LineShaderData(thick11Px, pipColor);
if (ctx_) {
for (auto wire : ctx_->getPips()) {
for (auto &el : ctx_->getPipGraphics(wire))
@@ -363,7 +370,7 @@ void FPGAViewWidget::paintGL()
}
// Draw Groups.
- auto groups = LineShaderData(thick11Px, QColor("#b000ba"));
+ auto groups = LineShaderData(thick11Px, groupColor);
if (ctx_) {
for (auto group : ctx_->getGroups()) {
for (auto &el : ctx_->getGroupGraphics(group))
@@ -373,7 +380,7 @@ void FPGAViewWidget::paintGL()
}
// Draw Frame Graphics.
- auto frames = LineShaderData(thick11Px, QColor("#0066ba"));
+ auto frames = LineShaderData(thick11Px, frameColor);
if (ctx_) {
for (auto &el : ctx_->getFrameGraphics()) {
drawElement(frames, el);
diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h
index b49029dd..526c6199 100644
--- a/gui/fpgaviewwidget.h
+++ b/gui/fpgaviewwidget.h
@@ -216,6 +216,13 @@ class LineShader
class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions
{
Q_OBJECT
+ Q_PROPERTY(QColor backgroundColor MEMBER backgroundColor DESIGNABLE true)
+ Q_PROPERTY(QColor belColor MEMBER belColor DESIGNABLE true)
+ Q_PROPERTY(QColor gridColor MEMBER gridColor DESIGNABLE true)
+ Q_PROPERTY(QColor wireColor MEMBER wireColor DESIGNABLE true)
+ Q_PROPERTY(QColor pipColor MEMBER pipColor DESIGNABLE true)
+ Q_PROPERTY(QColor groupColor MEMBER groupColor DESIGNABLE true)
+ Q_PROPERTY(QColor frameColor MEMBER frameColor DESIGNABLE true)
public:
FPGAViewWidget(QWidget *parent = 0);
@@ -258,6 +265,13 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions
const float zoomLvl2_ = 50.0f;
Context *ctx_;
+ QColor backgroundColor;
+ QColor gridColor;
+ QColor belColor;
+ QColor wireColor;
+ QColor pipColor;
+ QColor groupColor;
+ QColor frameColor;
};
NEXTPNR_NAMESPACE_END
diff --git a/ice40/arch.cc b/ice40/arch.cc
index 26c3b003..8650aeff 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -478,6 +478,8 @@ DecalXY Arch::getBelDecal(BelId bel) const
DecalXY Arch::getWireDecal(WireId wire) const
{
DecalXY decalxy;
+ decalxy.decal.type = DecalId::TYPE_WIRE;
+ decalxy.decal.index = wire.index;
return decalxy;
}
@@ -510,6 +512,21 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
}
}
+ if (decal.type == DecalId::TYPE_WIRE)
+ {
+ WireId wire;
+ wire.index = decal.index;
+
+ int n = chip_info->wire_data[wire.index].num_segments;
+ const WireSegmentPOD *p = chip_info->wire_data[wire.index].segments.get();
+
+ GraphicElement::style_t style = wire_to_net.at(wire.index) != IdString() ?
+ GraphicElement::G_ACTIVE : GraphicElement::G_INACTIVE;
+
+ for (int i = 0; i < n; i++)
+ gfxTileWire(ret, p[i].x, p[i].y, GfxTileWireId(p[i].index), style);
+ }
+
if (decal.type == DecalId::TYPE_BEL)
{
BelId bel;
@@ -520,6 +537,7 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
if (bel_type == TYPE_ICESTORM_LC) {
GraphicElement el;
el.type = GraphicElement::G_BOX;
+ el.style = bel_to_cell.at(bel.index) != IdString() ? GraphicElement::G_ACTIVE : GraphicElement::G_INACTIVE;
el.x1 = chip_info->bel_data[bel.index].x + logic_cell_x1;
el.x2 = chip_info->bel_data[bel.index].x + logic_cell_x2;
el.y1 = chip_info->bel_data[bel.index].y + logic_cell_y1 + (chip_info->bel_data[bel.index].z) * logic_cell_pitch;
@@ -534,6 +552,7 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
// Main switchbox
GraphicElement main_sw;
main_sw.type = GraphicElement::G_BOX;
+ main_sw.style = GraphicElement::G_FRAME;
main_sw.x1 = tx + main_swbox_x1;
main_sw.x2 = tx + main_swbox_x2;
main_sw.y1 = ty + main_swbox_y1;
@@ -543,16 +562,13 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
// Local tracks to LUT input switchbox
GraphicElement local_sw;
local_sw.type = GraphicElement::G_BOX;
+ local_sw.style = GraphicElement::G_FRAME;
local_sw.x1 = tx + local_swbox_x1;
local_sw.x2 = tx + local_swbox_x2;
local_sw.y1 = ty + local_swbox_y1;
local_sw.y2 = ty + local_swbox_y2;
local_sw.z = 0;
ret.push_back(local_sw);
-
- // All the wires
- for (int i = TILE_WIRE_GLB2LOCAL_0; i <= TILE_WIRE_SP12_H_L_23; i++)
- gfxTileWire(ret, tx, ty, GfxTileWireId(i));
}
}
diff --git a/ice40/arch.h b/ice40/arch.h
index 96d0d209..04de5178 100644
--- a/ice40/arch.h
+++ b/ice40/arch.h
@@ -70,6 +70,11 @@ NPNR_PACKED_STRUCT(struct PipInfoPOD {
int32_t switch_index;
});
+NPNR_PACKED_STRUCT(struct WireSegmentPOD {
+ int8_t x, y;
+ int16_t index;
+});
+
NPNR_PACKED_STRUCT(struct WireInfoPOD {
RelPtr<char> name;
int32_t num_uphill, num_downhill;
@@ -79,6 +84,9 @@ NPNR_PACKED_STRUCT(struct WireInfoPOD {
BelPortPOD bel_uphill;
RelPtr<BelPortPOD> bels_downhill;
+ int32_t num_segments;
+ RelPtr<WireSegmentPOD> segments;
+
int8_t x, y;
WireType type;
int8_t padding_0;
diff --git a/ice40/chipdb.py b/ice40/chipdb.py
index 2a918ed9..00194deb 100644
--- a/ice40/chipdb.py
+++ b/ice40/chipdb.py
@@ -11,6 +11,7 @@ group.add_argument("-b", "--binary", action="store_true")
group.add_argument("-c", "--c_file", action="store_true")
parser.add_argument("filename", type=str, help="chipdb input filename")
parser.add_argument("-p", "--portspins", type=str, help="path to portpins.inc")
+parser.add_argument("-g", "--gfxh", type=str, help="path to gfx.h")
args = parser.parse_args()
endianness = "le"
@@ -54,6 +55,9 @@ beltypes = dict()
tiletypes = dict()
wiretypes = dict()
+gfx_wire_ids = dict()
+wire_segments = dict()
+
with open(args.portspins) as f:
for line in f:
line = line.replace("(", " ")
@@ -66,6 +70,18 @@ with open(args.portspins) as f:
idx = len(portpins) + 1
portpins[line[1]] = idx
+with open(args.gfxh) as f:
+ state = 0
+ for line in f:
+ if state == 0 and line.startswith("enum GfxTileWireId "):
+ state = 1
+ elif state == 1 and line.startswith("};"):
+ state = 0
+ elif state == 1:
+ idx = len(gfx_wire_ids)
+ name = line.strip().rstrip(",")
+ gfx_wire_ids[name] = idx
+
beltypes["ICESTORM_LC"] = 1
beltypes["ICESTORM_RAM"] = 2
beltypes["SB_IO"] = 3
@@ -371,6 +387,10 @@ with open(args.filename, "r") as f:
if mode[1] not in wire_xy:
wire_xy[mode[1]] = list()
wire_xy[mode[1]].append((int(line[0]), int(line[1])))
+ if mode[1] not in wire_segments:
+ wire_segments[mode[1]] = set()
+ if ("TILE_WIRE_" + wname[2].upper()) in gfx_wire_ids:
+ wire_segments[mode[1]].add((wname[0], wname[1], gfx_wire_ids["TILE_WIRE_" + wname[2].upper()]))
continue
if mode[0] in ("buffer", "routing"):
@@ -1040,7 +1060,7 @@ for t in range(num_tile_types):
tileinfo.append(ti)
bba.l("wire_data_%s" % dev_name, "WireInfoPOD")
-for info in wireinfo:
+for wire, info in enumerate(wireinfo):
bba.s(info["name"], "name")
bba.u32(info["num_uphill"], "num_uphill")
bba.u32(info["num_downhill"], "num_downhill")
@@ -1050,11 +1070,24 @@ for info in wireinfo:
bba.u32(info["uphill_bel"], "bel_uphill.bel_index")
bba.u32(info["uphill_pin"], "bel_uphill.port")
bba.r(info["list_bels_downhill"], "bels_downhill")
+ bba.u32(len(wire_segments[wire]), "num_segments")
+ if len(wire_segments[wire]):
+ bba.r("wire_segments_%d" % wire, "segments")
+ else:
+ bba.u32(0, "segments")
bba.u8(info["x"], "x")
bba.u8(info["y"], "y")
bba.u8(wiretypes[wire_type(info["name"])], "type")
bba.u8(0, "padding")
+for wire in range(num_wires):
+ if len(wire_segments[wire]):
+ bba.l("wire_segments_%d" % wire, "WireSegmentPOD")
+ for seg in sorted(wire_segments[wire]):
+ bba.u8(seg[0], "x")
+ bba.u8(seg[1], "y")
+ bba.u16(seg[2], "index")
+
bba.l("pip_data_%s" % dev_name, "PipInfoPOD")
for info in pipinfo:
bba.u32(info["src"], "src")
diff --git a/ice40/family.cmake b/ice40/family.cmake
index e6cefecb..9af06f82 100644
--- a/ice40/family.cmake
+++ b/ice40/family.cmake
@@ -21,8 +21,9 @@ if (MSVC)
set(DEV_TXT_DB ${ICEBOX_ROOT}/chipdb-${dev}.txt)
set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdbs/chipdb-${dev}.bin)
set(DEV_PORTS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ice40/portpins.inc)
+ set(DEV_GFXH ${CMAKE_CURRENT_SOURCE_DIR}/ice40/gfx.h)
add_custom_command(OUTPUT ${DEV_CC_DB}
- COMMAND ${PYTHON_EXECUTABLE} ${DB_PY} -b -p ${DEV_PORTS_INC} ${DEV_TXT_DB} > ${DEV_CC_DB}
+ COMMAND ${PYTHON_EXECUTABLE} ${DB_PY} -b -p ${DEV_PORTS_INC} -g ${DEV_GFXH} ${DEV_TXT_DB} > ${DEV_CC_DB}
DEPENDS ${DEV_TXT_DB} ${DB_PY}
)
target_sources(ice40_chipdb PRIVATE ${DEV_CC_DB})
@@ -37,8 +38,9 @@ else()
set(DEV_TXT_DB ${ICEBOX_ROOT}/chipdb-${dev}.txt)
set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ice40/chipdbs/chipdb-${dev}.cc)
set(DEV_PORTS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ice40/portpins.inc)
+ set(DEV_GFXH ${CMAKE_CURRENT_SOURCE_DIR}/ice40/gfx.h)
add_custom_command(OUTPUT ${DEV_CC_DB}
- COMMAND ${PYTHON_EXECUTABLE} ${DB_PY} -c -p ${DEV_PORTS_INC} ${DEV_TXT_DB} > ${DEV_CC_DB}.new
+ COMMAND ${PYTHON_EXECUTABLE} ${DB_PY} -c -p ${DEV_PORTS_INC} -g ${DEV_GFXH} ${DEV_TXT_DB} > ${DEV_CC_DB}.new
COMMAND mv ${DEV_CC_DB}.new ${DEV_CC_DB}
DEPENDS ${DEV_TXT_DB} ${DB_PY}
)
diff --git a/ice40/gfx.cc b/ice40/gfx.cc
index 64bb66ec..d6935b7d 100644
--- a/ice40/gfx.cc
+++ b/ice40/gfx.cc
@@ -21,15 +21,16 @@
NEXTPNR_NAMESPACE_BEGIN
-void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
+void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id, GraphicElement::style_t style)
{
+ GraphicElement el;
+ el.type = GraphicElement::G_LINE;
+ el.style = style;
+
// Horizontal Span-4 Wires
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 + 1.0 - (0.03 + 0.0025 * (60 - idx));
el.x1 = x + 0.0;
@@ -47,8 +48,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
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 + 1.0 - (0.03 + 0.0025 * (60 - idx));
float y2 = y + 1.0 - (0.03 + 0.0025 * (60 - (idx ^ 1)));
@@ -91,8 +90,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_SP4_V_T_36 && id <= TILE_WIRE_SP4_V_T_47) {
int idx = (id - TILE_WIRE_SP4_V_T_36) + 48;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
float x1 = x + 0.03 + 0.0025 * (60 - idx);
@@ -111,8 +108,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_SP4_V_B_0 && id <= TILE_WIRE_SP4_V_B_47) {
int idx = id - TILE_WIRE_SP4_V_B_0;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
float x1 = x + 0.03 + 0.0025 * (60 - (idx ^ 1));
float x2 = x + 0.03 + 0.0025 * (60 - idx);
@@ -161,8 +156,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_SP12_H_L_22 && id <= TILE_WIRE_SP12_H_L_23) {
int idx = (id - TILE_WIRE_SP12_H_L_22) + 24;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
float y1 = y + 1.0 - (0.03 + 0.0025 * (90 - idx));
@@ -181,8 +174,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_SP12_H_R_0 && id <= TILE_WIRE_SP12_H_R_23) {
int idx = id - TILE_WIRE_SP12_H_R_0;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
float y1 = y + 1.0 - (0.03 + 0.0025 * (90 - (idx ^ 1)));
float y2 = y + 1.0 - (0.03 + 0.0025 * (90 - idx));
@@ -225,8 +216,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_SP4_R_V_B_0 && id <= TILE_WIRE_SP4_R_V_B_47) {
int idx = id - TILE_WIRE_SP4_R_V_B_0;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
float y1 = y + 1.0 - (0.03 + 0.0025 * (145 - idx));
@@ -241,8 +230,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_SP12_V_T_22 && id <= TILE_WIRE_SP12_V_T_23) {
int idx = (id - TILE_WIRE_SP12_V_T_22) + 24;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
float x1 = x + 0.03 + 0.0025 * (90 - idx);
@@ -261,8 +248,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_SP12_V_B_0 && id <= TILE_WIRE_SP12_V_B_23) {
int idx = id - TILE_WIRE_SP12_V_B_0;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
float x1 = x + 0.03 + 0.0025 * (90 - idx);
float x2 = x + 0.03 + 0.0025 * (90 - (idx ^ 1));
@@ -305,8 +290,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_GLB2LOCAL_0 && id <= TILE_WIRE_GLB2LOCAL_3) {
int idx = id - TILE_WIRE_GLB2LOCAL_0;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.x1 = x + main_swbox_x1 + 0.005 * (idx + 5);
el.x2 = el.x1;
el.y1 = y + main_swbox_y1;
@@ -318,8 +301,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_GLB_NETWK_0 && id <= TILE_WIRE_GLB_NETWK_7) {
int idx = id - TILE_WIRE_GLB_NETWK_0;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.x1 = x + main_swbox_x1 - 0.05;
el.x2 = x + main_swbox_x1;
el.y1 = y + main_swbox_y1 + 0.005 * (13 - idx);
@@ -331,8 +312,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_NEIGH_OP_BNL_0 && id <= TILE_WIRE_NEIGH_OP_TOP_7) {
int idx = id - TILE_WIRE_NEIGH_OP_BNL_0;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.y1 = y + main_swbox_y2 - (0.0025 * (idx + 10) + 0.01 * (idx / 8));
el.y2 = el.y1;
el.x1 = x + main_swbox_x1 - 0.05;
@@ -344,8 +323,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_LOCAL_G0_0 && id <= TILE_WIRE_LOCAL_G3_7) {
int idx = id - TILE_WIRE_LOCAL_G0_0;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.x1 = x + main_swbox_x2;
el.x2 = x + local_swbox_x1;
float yoff = y + (local_swbox_y1 + local_swbox_y2) / 2 - 0.005 * 16 - 0.075;
@@ -360,8 +337,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
int idx = id - TILE_WIRE_LUTFF_0_IN_0;
int z = idx / 4;
int input = idx % 4;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.x1 = x + local_swbox_x2;
el.x2 = x + logic_cell_x1;
el.y1 = y + (logic_cell_y1 + logic_cell_y2) / 2 - 0.0075 + (0.005 * input) + z * logic_cell_pitch;
@@ -376,8 +351,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
float y1 = y + 1.0 - (0.03 + 0.0025 * (152 + idx));
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.y1 = y1;
el.y2 = y1;
el.x1 = x + main_swbox_x2;
@@ -398,8 +371,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_LUTFF_GLOBAL_CEN && id <= TILE_WIRE_LUTFF_GLOBAL_S_R) {
int idx = id - TILE_WIRE_LUTFF_GLOBAL_CEN;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.x1 = x + main_swbox_x2 - 0.005 * (idx + 5);
el.x2 = el.x1;
@@ -426,8 +397,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_LUTFF_0_LOUT && id <= TILE_WIRE_LUTFF_6_LOUT) {
int idx = id - TILE_WIRE_LUTFF_0_LOUT;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.x1 = x + logic_cell_x1 + 0.005 * 5;
el.x2 = el.x1;
el.y1 = y + logic_cell_y2 + idx * logic_cell_pitch;
@@ -439,8 +408,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
if (id >= TILE_WIRE_LUTFF_0_COUT && id <= TILE_WIRE_LUTFF_7_COUT) {
int idx = id - TILE_WIRE_LUTFF_0_COUT;
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.x1 = x + logic_cell_x1 + 0.005 * 3;
el.x2 = el.x1;
el.y1 = y + logic_cell_y2 + idx * logic_cell_pitch;
@@ -449,8 +416,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
}
if (id == TILE_WIRE_CARRY_IN) {
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.x1 = x + logic_cell_x1 + 0.005 * 3;
el.x2 = el.x1;
el.y1 = y;
@@ -459,8 +424,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id)
}
if (id == TILE_WIRE_CARRY_IN_MUX) {
- GraphicElement el;
- el.type = GraphicElement::G_LINE;
el.x1 = x + logic_cell_x1 + 0.005 * 3;
el.x2 = el.x1;
el.y1 = y + 0.02;
diff --git a/ice40/gfx.h b/ice40/gfx.h
index b0009b59..aa07c2fa 100644
--- a/ice40/gfx.h
+++ b/ice40/gfx.h
@@ -466,7 +466,7 @@ enum GfxTileWireId {
TILE_WIRE_SP12_H_L_23
};
-void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id);
+void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id, GraphicElement::style_t style);
NEXTPNR_NAMESPACE_END