diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-08-03 14:59:13 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-08-03 14:59:13 +0200 |
commit | 75423169c59022b3680aa3bf7de0877bc43a8082 (patch) | |
tree | 57a992af04f45ca9d0beba1b00a1ab2bae0792b8 | |
parent | 014a41fcf3463fae881413b4b366c2c2a6fb20de (diff) | |
download | yosys-75423169c59022b3680aa3bf7de0877bc43a8082.tar.gz yosys-75423169c59022b3680aa3bf7de0877bc43a8082.tar.bz2 yosys-75423169c59022b3680aa3bf7de0877bc43a8082.zip |
Added ID() macro for static IdStrings
-rw-r--r-- | kernel/yosys.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/yosys.h b/kernel/yosys.h index 34777c9a4..f9bbc0e44 100644 --- a/kernel/yosys.h +++ b/kernel/yosys.h @@ -103,6 +103,9 @@ RTLIL::IdString new_id(std::string file, int line, std::string func); #define NEW_ID \ YOSYS_NAMESPACE_PREFIX new_id(__FILE__, __LINE__, __FUNCTION__) +#define ID(_str) \ + ([]() { static YOSYS_NAMESPACE_PREFIX RTLIL::IdString _id(_str); return _id; })() + RTLIL::Design *yosys_get_design(); std::string proc_self_dirname(); std::string proc_share_dirname(); |