diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-07-15 20:29:32 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-07-15 20:29:32 +0200 |
commit | 164bd28348aaeaf77317a815d7641881b44d0a0d (patch) | |
tree | 80855e38c4bda126d79ec9700d1cd6e5d7338258 /ice40/arch.cc | |
parent | ecc4c3fa7bdf1726377cd5cf2199b3cabd233427 (diff) | |
download | nextpnr-164bd28348aaeaf77317a815d7641881b44d0a0d.tar.gz nextpnr-164bd28348aaeaf77317a815d7641881b44d0a0d.tar.bz2 nextpnr-164bd28348aaeaf77317a815d7641881b44d0a0d.zip |
Add iCE40 Pip gfx
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r-- | ice40/arch.cc | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc index adc37dbd..7addc0a1 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -333,17 +333,7 @@ PipId Arch::getPipByName(IdString name) const IdString Arch::getPipName(PipId pip) const { NPNR_ASSERT(pip != PipId()); - - int x = chip_info->pip_data[pip.index].x; - int y = chip_info->pip_data[pip.index].y; - - std::string src_name = chip_info->wire_data[chip_info->pip_data[pip.index].src].name.get(); - std::replace(src_name.begin(), src_name.end(), '/', '.'); - - std::string dst_name = chip_info->wire_data[chip_info->pip_data[pip.index].dst].name.get(); - std::replace(dst_name.begin(), dst_name.end(), '/', '.'); - - return id("X" + std::to_string(x) + "/Y" + std::to_string(y) + "/" + src_name + ".->." + dst_name); + return id(chip_info->pip_data[pip.index].name.get()); } // ----------------------------------------------------------------------- @@ -512,11 +502,8 @@ 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(); + int n = chip_info->wire_data[decal.index].num_segments; + const WireSegmentPOD *p = chip_info->wire_data[decal.index].segments.get(); GraphicElement::style_t style = decal.active ? GraphicElement::G_ACTIVE : GraphicElement::G_INACTIVE; @@ -524,6 +511,12 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const gfxTileWire(ret, p[i].x, p[i].y, GfxTileWireId(p[i].index), style); } + if (decal.type == DecalId::TYPE_PIP) { + const PipInfoPOD &p = chip_info->pip_data[decal.index]; + GraphicElement::style_t style = decal.active ? GraphicElement::G_ACTIVE : GraphicElement::G_HIDDEN; + gfxTilePip(ret, p.x, p.y, GfxTileWireId(p.src_seg), GfxTileWireId(p.dst_seg), style); + } + if (decal.type == DecalId::TYPE_BEL) { BelId bel; bel.index = decal.index; |