diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/arch.cc | 23 | ||||
-rw-r--r-- | generic/arch.h | 12 | ||||
-rw-r--r-- | generic/main.cc | 10 |
3 files changed, 23 insertions, 22 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 diff --git a/generic/arch.h b/generic/arch.h index 97ed1ac2..01a90ee1 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -31,7 +31,7 @@ struct WireInfo; struct PipInfo { - IdString name, bound_net; + IdString name, type, bound_net; WireId srcWire, dstWire; DelayInfo delay; DecalXY decalxy; @@ -39,7 +39,7 @@ struct PipInfo struct WireInfo { - IdString name, bound_net; + IdString name, type, bound_net; std::vector<PipId> downhill, uphill, aliases; BelPin uphill_bel_pin; std::vector<BelPin> downhill_bel_pins; @@ -96,9 +96,9 @@ struct Arch : BaseCtx float grid_distance_to_delay; - void addWire(IdString name, int x, int y); - void addPip(IdString name, IdString srcWire, IdString dstWire, DelayInfo delay); - void addAlias(IdString name, IdString srcWire, IdString dstWire, DelayInfo delay); + void addWire(IdString name, IdString type, int x, int y); + void addPip(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay); + void addAlias(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay); void addBel(IdString name, IdString type, Loc loc, bool gb); void addBelInput(IdString bel, IdString name, IdString wire); @@ -157,6 +157,7 @@ struct Arch : BaseCtx WireId getWireByName(IdString name) const; IdString getWireName(WireId wire) const; + IdString getWireType(WireId wire) const; uint32_t getWireChecksum(WireId wire) const; void bindWire(WireId wire, IdString net, PlaceStrength strength); void unbindWire(WireId wire); @@ -169,6 +170,7 @@ struct Arch : BaseCtx PipId getPipByName(IdString name) const; IdString getPipName(PipId pip) const; + IdString getPipType(PipId pip) const; uint32_t getPipChecksum(PipId pip) const; void bindPip(PipId pip, IdString net, PlaceStrength strength); void unbindPip(PipId pip); diff --git a/generic/main.cc b/generic/main.cc index 3b8b3fe6..d5a65102 100644 --- a/generic/main.cc +++ b/generic/main.cc @@ -75,18 +75,16 @@ int main(int argc, char *argv[]) } if (vm.count("help") || argc == 1) { - std::cout << boost::filesystem::basename(argv[0]) - << " -- Next Generation Place and Route (git " - "sha1 " GIT_COMMIT_HASH_STR ")\n"; + std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git " + "sha1 " GIT_COMMIT_HASH_STR ")\n"; std::cout << "\n"; std::cout << options << "\n"; return argc != 1; } if (vm.count("version")) { - std::cout << boost::filesystem::basename(argv[0]) - << " -- Next Generation Place and Route (git " - "sha1 " GIT_COMMIT_HASH_STR ")\n"; + std::cout << boost::filesystem::basename(argv[0]) << " -- Next Generation Place and Route (git " + "sha1 " GIT_COMMIT_HASH_STR ")\n"; return 1; } |