diff options
author | David Shah <dave@ds0.me> | 2021-02-03 09:48:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-03 09:48:07 +0000 |
commit | 9a79163eab89e6351cd06c37d5916174acdfc754 (patch) | |
tree | 60bccc139d7ea739257322b4bd2d01a0913c503a /gowin | |
parent | 9c5d13a630581c08c7f828a8db192721314e32c3 (diff) | |
parent | 15bf9e4f74cdd52e8e03abcac4c7fa1fc26b3367 (diff) | |
download | nextpnr-9a79163eab89e6351cd06c37d5916174acdfc754.tar.gz nextpnr-9a79163eab89e6351cd06c37d5916174acdfc754.tar.bz2 nextpnr-9a79163eab89e6351cd06c37d5916174acdfc754.zip |
Merge pull request #561 from YosysHQ/dave/idstringlist
Use IdStringList for bel/wire/pip/group names
Diffstat (limited to 'gowin')
-rw-r--r-- | gowin/arch.cc | 28 | ||||
-rw-r--r-- | gowin/arch.h | 20 |
2 files changed, 26 insertions, 22 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc index 5a1a56e3..201641cd 100644 --- a/gowin/arch.cc +++ b/gowin/arch.cc @@ -759,14 +759,14 @@ void IdString::initialize_arch(const BaseCtx *ctx) // --------------------------------------------------------------- -BelId Arch::getBelByName(IdString name) const +BelId Arch::getBelByName(IdStringList name) const { - if (bels.count(name)) - return name; + if (bels.count(name[0])) + return name[0]; return BelId(); } -IdString Arch::getBelName(BelId bel) const { return bel; } +IdStringList Arch::getBelName(BelId bel) const { return IdStringList(bel); } Loc Arch::getBelLocation(BelId bel) const { @@ -836,14 +836,14 @@ std::vector<IdString> Arch::getBelPins(BelId bel) const // --------------------------------------------------------------- -WireId Arch::getWireByName(IdString name) const +WireId Arch::getWireByName(IdStringList name) const { - if (wires.count(name)) - return name; + if (wires.count(name[0])) + return name[0]; return WireId(); } -IdString Arch::getWireName(WireId wire) const { return wire; } +IdStringList Arch::getWireName(WireId wire) const { return IdStringList(wire); } IdString Arch::getWireType(WireId wire) const { return wires.at(wire).type; } @@ -890,14 +890,14 @@ const std::vector<WireId> &Arch::getWires() const { return wire_ids; } // --------------------------------------------------------------- -PipId Arch::getPipByName(IdString name) const +PipId Arch::getPipByName(IdStringList name) const { - if (pips.count(name)) - return name; + if (pips.count(name[0])) + return name[0]; return PipId(); } -IdString Arch::getPipName(PipId pip) const { return pip; } +IdStringList Arch::getPipName(PipId pip) const { return IdStringList(pip); } IdString Arch::getPipType(PipId pip) const { return pips.at(pip).type; } @@ -950,9 +950,9 @@ const std::vector<PipId> &Arch::getPipsUphill(WireId wire) const { return wires. // --------------------------------------------------------------- -GroupId Arch::getGroupByName(IdString name) const { return name; } +GroupId Arch::getGroupByName(IdStringList name) const { return name[0]; } -IdString Arch::getGroupName(GroupId group) const { return group; } +IdStringList Arch::getGroupName(GroupId group) const { return IdStringList(group); } std::vector<GroupId> Arch::getGroups() const { diff --git a/gowin/arch.h b/gowin/arch.h index f12c604e..4754772b 100644 --- a/gowin/arch.h +++ b/gowin/arch.h @@ -323,9 +323,13 @@ struct Arch : BaseCtx int getGridDimY() const { return gridDimY; } int getTileBelDimZ(int x, int y) const { return tileBelDimZ[x][y]; } int getTilePipDimZ(int x, int y) const { return tilePipDimZ[x][y]; } + char getNameDelimiter() const + { + return ' '; /* use a non-existent delimiter as we aren't using IdStringLists yet */ + } - BelId getBelByName(IdString name) const; - IdString getBelName(BelId bel) const; + BelId getBelByName(IdStringList name) const; + IdStringList getBelName(BelId bel) const; Loc getBelLocation(BelId bel) const; BelId getBelByLocation(Loc loc) const; const std::vector<BelId> &getBelsByTile(int x, int y) const; @@ -343,8 +347,8 @@ struct Arch : BaseCtx PortType getBelPinType(BelId bel, IdString pin) const; std::vector<IdString> getBelPins(BelId bel) const; - WireId getWireByName(IdString name) const; - IdString getWireName(WireId wire) const; + WireId getWireByName(IdStringList name) const; + IdStringList getWireName(WireId wire) const; IdString getWireType(WireId wire) const; const std::map<IdString, std::string> &getWireAttrs(WireId wire) const; uint32_t getWireChecksum(WireId wire) const; @@ -358,8 +362,8 @@ struct Arch : BaseCtx const std::vector<WireId> &getWires() const; const std::vector<BelPin> &getWireBelPins(WireId wire) const; - PipId getPipByName(IdString name) const; - IdString getPipName(PipId pip) const; + PipId getPipByName(IdStringList name) const; + IdStringList getPipName(PipId pip) const; IdString getPipType(PipId pip) const; const std::map<IdString, std::string> &getPipAttrs(PipId pip) const; uint32_t getPipChecksum(PipId pip) const; @@ -377,8 +381,8 @@ struct Arch : BaseCtx const std::vector<PipId> &getPipsDownhill(WireId wire) const; const std::vector<PipId> &getPipsUphill(WireId wire) const; - GroupId getGroupByName(IdString name) const; - IdString getGroupName(GroupId group) const; + GroupId getGroupByName(IdStringList name) const; + IdStringList getGroupName(GroupId group) const; std::vector<GroupId> getGroups() const; const std::vector<BelId> &getGroupBels(GroupId group) const; const std::vector<WireId> &getGroupWires(GroupId group) const; |