diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-08-10 12:24:16 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2019-08-11 11:39:46 +0200 |
commit | 390bf459fbd766d4b1f9d16c6e10d665b43369d5 (patch) | |
tree | a5ed298e5fe5604d4ef70bc055b19009f1ceb634 /kernel/rtlil.h | |
parent | 8222c5735e3b31fc2a7507abe607bb5aa9f863de (diff) | |
download | yosys-390bf459fbd766d4b1f9d16c6e10d665b43369d5.tar.gz yosys-390bf459fbd766d4b1f9d16c6e10d665b43369d5.tar.bz2 yosys-390bf459fbd766d4b1f9d16c6e10d665b43369d5.zip |
Use ID() in kernel/*, add simple ID:: hack (to be improved upon later)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'kernel/rtlil.h')
-rw-r--r-- | kernel/rtlil.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h index e771655d7..c879d22e5 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -348,6 +348,14 @@ namespace RTLIL bool in(const pool<IdString> &rhs) const { return rhs.count(*this) != 0; } }; + namespace ID { + // defined in rtlil.cc, initialized in yosys.cc + extern IdString A, B, Y; + extern IdString keep; + extern IdString whitebox; + extern IdString blackbox; + }; + static inline std::string escape_id(std::string str) { if (str.size() > 0 && str[0] != '\\' && str[0] != '$') return "\\" + str; @@ -620,7 +628,7 @@ struct RTLIL::AttrObject bool get_bool_attribute(RTLIL::IdString id) const; bool get_blackbox_attribute(bool ignore_wb=false) const { - return get_bool_attribute("\\blackbox") || (!ignore_wb && get_bool_attribute("\\whitebox")); + return get_bool_attribute(ID::blackbox) || (!ignore_wb && get_bool_attribute(ID::whitebox)); } void set_strpool_attribute(RTLIL::IdString id, const pool<string> &data); @@ -1355,8 +1363,8 @@ public: void fixup_parameters(bool set_a_signed = false, bool set_b_signed = false); bool has_keep_attr() const { - return get_bool_attribute("\\keep") || (module && module->design && module->design->module(type) && - module->design->module(type)->get_bool_attribute("\\keep")); + return get_bool_attribute(ID::keep) || (module && module->design && module->design->module(type) && + module->design->module(type)->get_bool_attribute(ID::keep)); } template<typename T> void rewrite_sigspecs(T &functor); |