aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rtlil.cc
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2020-04-16 21:43:03 +0000
committerwhitequark <whitequark@whitequark.org>2020-04-16 21:45:29 +0000
commitff7a1a1568e0d4773b160b631da0446673149091 (patch)
tree1d11ad805d6b5f173ef312bf71ccd8009fc301ed /kernel/rtlil.cc
parentb4b2345a10babf055e01db0a3d91b51c3f79e3bf (diff)
downloadyosys-ff7a1a1568e0d4773b160b631da0446673149091.tar.gz
yosys-ff7a1a1568e0d4773b160b631da0446673149091.tar.bz2
yosys-ff7a1a1568e0d4773b160b631da0446673149091.zip
rtlil: add AttrObject::{get,set}_string_attribute.
And make {get,set}_src_attribute use those functions.
Diffstat (limited to 'kernel/rtlil.cc')
-rw-r--r--kernel/rtlil.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 6996a02c4..9ecad056f 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -289,6 +289,23 @@ bool RTLIL::AttrObject::get_bool_attribute(RTLIL::IdString id) const
return it->second.as_bool();
}
+void RTLIL::AttrObject::set_string_attribute(RTLIL::IdString id, string value)
+{
+ if (value.empty())
+ attributes.erase(id);
+ else
+ attributes[id] = value;
+}
+
+string RTLIL::AttrObject::get_string_attribute(RTLIL::IdString id) const
+{
+ std::string value;
+ const auto it = attributes.find(id);
+ if (it != attributes.end())
+ value = it->second.decode_string();
+ return value;
+}
+
void RTLIL::AttrObject::set_strpool_attribute(RTLIL::IdString id, const pool<string> &data)
{
string attrval;
@@ -317,23 +334,6 @@ 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(ID::src);
- else
- attributes[ID::src] = src;
-}
-
-std::string RTLIL::AttrObject::get_src_attribute() const
-{
- std::string src;
- const auto it = attributes.find(ID::src);
- if (it != attributes.end())
- src = it->second.decode_string();
- return src;
-}
-
bool RTLIL::Selection::selected_module(RTLIL::IdString mod_name) const
{
if (full_selection)