diff options
author | Eddie Hung <eddieh@ece.ubc.ca> | 2018-11-13 11:39:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-13 11:39:51 -0800 |
commit | 3b2b15dc4a6cdf9cadab96b1db5483d4f7082dff (patch) | |
tree | 2772e8865a04c5da351643c90828c908a6f9f260 /common/nextpnr.h | |
parent | d0ae4c77be109cae3d6cf3321691c70377c4d6d3 (diff) | |
parent | caca485cfff7f999a19e86e2f00187550b0c92f4 (diff) | |
download | nextpnr-3b2b15dc4a6cdf9cadab96b1db5483d4f7082dff.tar.gz nextpnr-3b2b15dc4a6cdf9cadab96b1db5483d4f7082dff.tar.bz2 nextpnr-3b2b15dc4a6cdf9cadab96b1db5483d4f7082dff.zip |
Merge pull request #107 from YosysHQ/router_improve
Major rewrite of "router1"
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r-- | common/nextpnr.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h index 59ae0323..86e781ae 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -269,7 +269,7 @@ struct PipMap struct NetInfo : ArchNetInfo { IdString name; - int32_t udata; + int32_t udata = 0; PortRef driver; std::vector<PortRef> users; @@ -487,13 +487,23 @@ struct BaseCtx const Context *getCtx() const { return reinterpret_cast<const Context *>(this); } - template <typename T> const char *nameOf(const T *obj) + const char *nameOf(IdString name) const + { + return name.c_str(this); + } + + template <typename T> const char *nameOf(const T *obj) const { if (obj == nullptr) return ""; - return obj->name.c_str(getCtx()); + return obj->name.c_str(this); } + const char *nameOfBel(BelId bel) const; + const char *nameOfWire(WireId wire) const; + const char *nameOfPip(PipId pip) const; + const char *nameOfGroup(GroupId group) const; + // -------------------------------------------------------------- bool allUiReload = true; @@ -541,6 +551,7 @@ struct Context : Arch, DeterministicRNG delay_t getNetinfoRouteDelay(const NetInfo *net_info, const PortRef &sink) const; // provided by router1.cc + bool checkRoutedDesign() const; bool getActualRouteDelay(WireId src_wire, WireId dst_wire, delay_t *delay = nullptr, std::unordered_map<WireId, PipId> *route = nullptr, bool useEstimate = true); |