aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.h
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-09-13 19:01:26 +0100
committerGitHub <noreply@github.com>2019-09-13 19:01:26 +0100
commitbc6b47efe097b5086fd6aaf4fb8be51d97435719 (patch)
treed3d88bd0f0ce92817504754ac8670c107e2db417 /common/nextpnr.h
parent3975424ff544406915a9e995ef14a0b060b30661 (diff)
parent95540763b972bc389b76000397d4e210d59fa4bf (diff)
downloadnextpnr-bc6b47efe097b5086fd6aaf4fb8be51d97435719.tar.gz
nextpnr-bc6b47efe097b5086fd6aaf4fb8be51d97435719.tar.bz2
nextpnr-bc6b47efe097b5086fd6aaf4fb8be51d97435719.zip
Merge pull request #329 from YosysHQ/dave/net_aliases
json: Add support for net aliases
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r--common/nextpnr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index 177048bf..4f9f7f23 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -609,6 +609,9 @@ struct BaseCtx
std::unordered_map<IdString, std::unique_ptr<NetInfo>> nets;
std::unordered_map<IdString, std::unique_ptr<CellInfo>> cells;
+ // Aliases for nets, which may have more than one name due to assignments and hierarchy
+ std::unordered_map<IdString, IdString> net_aliases;
+
// Top-level ports
std::unordered_map<IdString, PortInfo> ports;
@@ -738,6 +741,8 @@ struct BaseCtx
TimingConstrObjectId timingCellObject(CellInfo *cell);
TimingConstrObjectId timingPortObject(CellInfo *cell, IdString port);
+ NetInfo *getNetByAlias(IdString alias) const { return nets.at(net_aliases.at(alias)).get(); }
+
void addConstraint(std::unique_ptr<TimingConstraint> constr);
void removeConstraint(IdString constrName);