aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/rtlil.cc16
-rw-r--r--kernel/rtlil.h4
2 files changed, 20 insertions, 0 deletions
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<string> 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)
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index be558932f..31f7f9d31 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -505,9 +505,13 @@ struct RTLIL::AttrObject
void set_bool_attribute(RTLIL::IdString id);
bool get_bool_attribute(RTLIL::IdString id) const;
+
void set_strpool_attribute(RTLIL::IdString id, const pool<string> &data);
void add_strpool_attribute(RTLIL::IdString id, const pool<string> &data);
pool<string> get_strpool_attribute(RTLIL::IdString id) const;
+
+ void set_src_attribute(const std::string &src);
+ std::string get_src_attribute() const;
};
struct RTLIL::SigChunk