diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-07-18 10:26:01 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-07-18 10:26:01 +0200 |
commit | a8cedb225709171b97e31c35dcac52d13c47b94f (patch) | |
tree | 9b816013ec1400e12e40ff2472ac2dbc57f7b6a4 /kernel | |
parent | ec3a798194342135d7aea21c334e6675701d66a6 (diff) | |
download | yosys-a8cedb225709171b97e31c35dcac52d13c47b94f.tar.gz yosys-a8cedb225709171b97e31c35dcac52d13c47b94f.tar.bz2 yosys-a8cedb225709171b97e31c35dcac52d13c47b94f.zip |
Added log_id() helper function
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/log.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/log.h b/kernel/log.h index 5fbd2fc68..3e280a6f6 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -52,6 +52,14 @@ void log_flush(); const char *log_signal(const RTLIL::SigSpec &sig, bool autoint = true); +static inline const char *log_id(std::string id) { + return RTLIL::id2cstr(id); +} + +template<typename T> static inline const char *log_id(T *obj) { + return RTLIL::id2cstr(obj->name); +} + #define log_abort() log_error("Abort in %s:%d.\n", __FILE__, __LINE__) #define log_assert(_assert_expr_) do { if (_assert_expr_) break; log_error("Assert `%s' failed in %s:%d.\n", #_assert_expr_, __FILE__, __LINE__); } while (0) |