diff options
Diffstat (limited to 'generic/arch.cc')
-rw-r--r-- | generic/arch.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/generic/arch.cc b/generic/arch.cc index ac79ebea..5c9864ab 100644 --- a/generic/arch.cc +++ b/generic/arch.cc @@ -24,22 +24,24 @@ NEXTPNR_NAMESPACE_BEGIN -void Arch::addWire(IdString name, int x, int y) +void Arch::addWire(IdString name, IdString type, int x, int y) { NPNR_ASSERT(wires.count(name) == 0); WireInfo &wi = wires[name]; wi.name = name; + wi.type = type; wi.x = x; wi.y = y; wire_ids.push_back(name); } -void Arch::addPip(IdString name, IdString srcWire, IdString dstWire, DelayInfo delay) +void Arch::addPip(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay) { NPNR_ASSERT(pips.count(name) == 0); PipInfo &pi = pips[name]; pi.name = name; + pi.type = type; pi.srcWire = srcWire; pi.dstWire = dstWire; pi.delay = delay; @@ -49,11 +51,12 @@ void Arch::addPip(IdString name, IdString srcWire, IdString dstWire, DelayInfo d pip_ids.push_back(name); } -void Arch::addAlias(IdString name, IdString srcWire, IdString dstWire, DelayInfo delay) +void Arch::addAlias(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay) { NPNR_ASSERT(pips.count(name) == 0); PipInfo &pi = pips[name]; pi.name = name; + pi.type = type; pi.srcWire = srcWire; pi.dstWire = dstWire; pi.delay = delay; @@ -207,15 +210,9 @@ BelId Arch::getBelByLocation(Loc loc) const return BelId(); } -const std::vector<BelId> &Arch::getBelsByTile(int x, int y) const -{ - return bels_by_tile.at(x).at(y); -} +const std::vector<BelId> &Arch::getBelsByTile(int x, int y) const { return bels_by_tile.at(x).at(y); } -bool Arch::getBelGlobalBuf(BelId bel) const -{ - return bels.at(bel).gb; -} +bool Arch::getBelGlobalBuf(BelId bel) const { return bels.at(bel).gb; } uint32_t Arch::getBelChecksum(BelId bel) const { @@ -272,6 +269,8 @@ WireId Arch::getWireByName(IdString name) const IdString Arch::getWireName(WireId wire) const { return wire; } +IdString Arch::getWireType(WireId wire) const { return wires.at(wire).type; } + uint32_t Arch::getWireChecksum(WireId wire) const { // FIXME @@ -322,6 +321,8 @@ PipId Arch::getPipByName(IdString name) const IdString Arch::getPipName(PipId pip) const { return pip; } +IdString Arch::getPipType(PipId pip) const { return pips.at(pip).type; } + uint32_t Arch::getPipChecksum(PipId wire) const { // FIXME |