aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.cc
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2018-11-13 11:39:51 -0800
committerGitHub <noreply@github.com>2018-11-13 11:39:51 -0800
commit3b2b15dc4a6cdf9cadab96b1db5483d4f7082dff (patch)
tree2772e8865a04c5da351643c90828c908a6f9f260 /common/nextpnr.cc
parentd0ae4c77be109cae3d6cf3321691c70377c4d6d3 (diff)
parentcaca485cfff7f999a19e86e2f00187550b0c92f4 (diff)
downloadnextpnr-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.cc')
-rw-r--r--common/nextpnr.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc
index 4e6407b2..903ab9e4 100644
--- a/common/nextpnr.cc
+++ b/common/nextpnr.cc
@@ -18,6 +18,7 @@
*/
#include "nextpnr.h"
+#include "log.h"
NEXTPNR_NAMESPACE_BEGIN
@@ -25,6 +26,7 @@ assertion_failure::assertion_failure(std::string msg, std::string expr_str, std:
: runtime_error("Assertion failure: " + msg + " (" + filename + ":" + std::to_string(line) + ")"), msg(msg),
expr_str(expr_str), filename(filename), line(line)
{
+ log_flush();
}
void IdString::set(const BaseCtx *ctx, const std::string &s)
@@ -51,6 +53,30 @@ void IdString::initialize_add(const BaseCtx *ctx, const char *s, int idx)
ctx->idstring_idx_to_str->push_back(&insert_rc.first->first);
}
+const char *BaseCtx::nameOfBel(BelId bel) const
+{
+ const Context *ctx = getCtx();
+ return ctx->getBelName(bel).c_str(ctx);
+}
+
+const char *BaseCtx::nameOfWire(WireId wire) const
+{
+ const Context *ctx = getCtx();
+ return ctx->getWireName(wire).c_str(ctx);
+}
+
+const char *BaseCtx::nameOfPip(PipId pip) const
+{
+ const Context *ctx = getCtx();
+ return ctx->getPipName(pip).c_str(ctx);
+}
+
+const char *BaseCtx::nameOfGroup(GroupId group) const
+{
+ const Context *ctx = getCtx();
+ return ctx->getGroupName(group).c_str(ctx);
+}
+
WireId Context::getNetinfoSourceWire(const NetInfo *net_info) const
{
if (net_info->driver.cell == nullptr)