aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.h
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-08-05 16:46:24 +0200
committerGitHub <noreply@github.com>2018-08-05 16:46:24 +0200
commit6c8319e29a68d8d54b747e95c3f4a8df8a14d3ba (patch)
tree8b289ec41872e8f907e001500ff2d237c9350342 /common/nextpnr.h
parentb3acd8095fdcffe0dc116218d824a6c03562b69e (diff)
parent736f2a07175b85a94ca77cb930be528a4c7671ea (diff)
downloadnextpnr-6c8319e29a68d8d54b747e95c3f4a8df8a14d3ba.tar.gz
nextpnr-6c8319e29a68d8d54b747e95c3f4a8df8a14d3ba.tar.bz2
nextpnr-6c8319e29a68d8d54b747e95c3f4a8df8a14d3ba.zip
Merge pull request #37 from YosysHQ/ngapi
API change: Use CellInfo* and NetInfo* as cell/net handles
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r--common/nextpnr.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index bb55d4ff..3d9a66ca 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -437,6 +437,13 @@ struct BaseCtx
const Context *getCtx() const { return reinterpret_cast<const Context *>(this); }
+ template<typename T> const char *nameOf(const T *obj)
+ {
+ if (obj == nullptr)
+ return "";
+ return obj->name.c_str(getCtx());
+ }
+
// --------------------------------------------------------------
bool allUiReload = true;