diff options
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r-- | ice40/arch.cc | 60 |
1 files changed, 56 insertions, 4 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc index 91dc5d66..3983a24e 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -226,9 +226,12 @@ PortType Arch::getBelPinType(BelId bel, IdString pin) const return PORT_INOUT; } -std::vector<std::pair<IdString, std::string>> Arch::getBelAttrs(BelId) const +std::vector<std::pair<IdString, std::string>> Arch::getBelAttrs(BelId bel) const { std::vector<std::pair<IdString, std::string>> ret; + + ret.push_back(std::make_pair(id("INDEX"), stringf("%d", bel.index))); + return ret; } @@ -342,7 +345,7 @@ std::vector<std::pair<IdString, std::string>> Arch::getWireAttrs(WireId wire) co std::vector<std::pair<IdString, std::string>> ret; auto &wi = chip_info->wire_data[wire.index]; - ret.push_back(std::make_pair(id("INDEX"), stringf("%d", wi.netidx))); + ret.push_back(std::make_pair(id("INDEX"), stringf("%d", wire.index))); ret.push_back(std::make_pair(id("GRID_X"), stringf("%d", wi.x))); ret.push_back(std::make_pair(id("GRID_Y"), stringf("%d", wi.y))); @@ -402,9 +405,12 @@ IdString Arch::getPipName(PipId pip) const IdString Arch::getPipType(PipId pip) const { return IdString(); } -std::vector<std::pair<IdString, std::string>> Arch::getPipAttrs(PipId) const +std::vector<std::pair<IdString, std::string>> Arch::getPipAttrs(PipId pip) const { std::vector<std::pair<IdString, std::string>> ret; + + ret.push_back(std::make_pair(id("INDEX"), stringf("%d", pip.index))); + return ret; } @@ -723,13 +729,29 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; for (int i = 0; i < n; i++) - gfxTileWire(ret, p[i].x, p[i].y, GfxTileWireId(p[i].index), style); + gfxTileWire(ret, p[i].x, p[i].y, chip_info->width, chip_info->height, GfxTileWireId(p[i].index), style); + +#if 0 + if (ret.empty()) { + WireId wire; + wire.index = decal.index; + log_warning("No gfx decal for wire %s (%d).\n", getWireName(wire).c_str(getCtx()), decal.index); + } +#endif } if (decal.type == DecalId::TYPE_PIP) { const PipInfoPOD &p = chip_info->pip_data[decal.index]; GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_HIDDEN; gfxTilePip(ret, p.x, p.y, GfxTileWireId(p.src_seg), GfxTileWireId(p.dst_seg), style); + +#if 0 + if (ret.empty()) { + PipId pip; + pip.index = decal.index; + log_warning("No gfx decal for pip %s (%d).\n", getPipName(pip).c_str(getCtx()), decal.index); + } +#endif } if (decal.type == DecalId::TYPE_BEL) { @@ -776,6 +798,36 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const ret.push_back(el); } } + + if (bel_type == id_SB_GB) { + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = chip_info->bel_data[bel.index].x + local_swbox_x1 + 0.05; + el.x2 = chip_info->bel_data[bel.index].x + logic_cell_x2 - 0.05; + el.y1 = chip_info->bel_data[bel.index].y + main_swbox_y2 - 0.05; + el.y2 = chip_info->bel_data[bel.index].y + main_swbox_y2 - 0.10; + ret.push_back(el); + } + + if (bel_type == id_ICESTORM_PLL || bel_type == id_SB_WARMBOOT) { + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = chip_info->bel_data[bel.index].x + local_swbox_x1 + 0.05; + el.x2 = chip_info->bel_data[bel.index].x + logic_cell_x2 - 0.05; + el.y1 = chip_info->bel_data[bel.index].y + main_swbox_y2; + el.y2 = chip_info->bel_data[bel.index].y + main_swbox_y2 + 0.05; + ret.push_back(el); + } + +#if 0 + if (ret.empty()) { + BelId bel; + bel.index = decal.index; + log_warning("No gfx decal for bel %s (%d).\n", getBelName(bel).c_str(getCtx()), decal.index); + } +#endif } return ret; |