From 85303334396904edfa0d77852b77c64870468f79 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 30 Aug 2017 11:39:11 +0200 Subject: Add {get,set}_src_attribute() methods on RTLIL::AttrObject --- kernel/rtlil.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'kernel/rtlil.cc') diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 4427303cc..f3522e30b 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -234,6 +234,22 @@ pool RTLIL::AttrObject::get_strpool_attribute(RTLIL::IdString id) const return data; } +void RTLIL::AttrObject::set_src_attribute(const std::string &src) +{ + if (src.empty()) + attributes.erase("\\src"); + else + attributes["\\src"] = src; +} + +std::string RTLIL::AttrObject::get_src_attribute() const +{ + std::string src; + if (attributes.count("\\src")) + src = attributes.at("\\src").decode_string(); + return src; +} + bool RTLIL::Selection::selected_module(RTLIL::IdString mod_name) const { if (full_selection) -- cgit v1.2.3