diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rtlil.cc | 16 | ||||
-rw-r--r-- | kernel/rtlil.h | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 335c48456..b876862c8 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -339,6 +339,22 @@ pool<string> RTLIL::AttrObject::get_strpool_attribute(RTLIL::IdString id) const return data; } +void RTLIL::AttrObject::set_hdlname_attribute(const vector<string> &hierarchy) +{ + string attrval; + for (const auto &ident : hierarchy) { + if (!attrval.empty()) + attrval += " "; + attrval += ident; + } + set_string_attribute(ID::hdlname, attrval); +} + +vector<string> RTLIL::AttrObject::get_hdlname_attribute() const +{ + return split_tokens(get_string_attribute(ID::hdlname), " "); +} + bool RTLIL::Selection::selected_module(RTLIL::IdString mod_name) const { if (full_selection) diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 86b4e25b6..f751bdce4 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -682,6 +682,9 @@ struct RTLIL::AttrObject std::string get_src_attribute() const { return get_string_attribute(ID::src); } + + void set_hdlname_attribute(const vector<string> &hierarchy); + vector<string> get_hdlname_attribute() const; }; struct RTLIL::SigChunk |