aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2020-06-08 19:02:48 +0000
committerwhitequark <whitequark@whitequark.org>2020-06-08 20:19:41 +0000
commite558905598617c901607a93e902d57f9a88f6da0 (patch)
tree64eb5538db7007df927899b6ece491fb7b7743fd /kernel
parent83f84afc0b617fe78fb7cfa31fb9d1cd202e22f2 (diff)
downloadyosys-e558905598617c901607a93e902d57f9a88f6da0.tar.gz
yosys-e558905598617c901607a93e902d57f9a88f6da0.tar.bz2
yosys-e558905598617c901607a93e902d57f9a88f6da0.zip
RTLIL: use {get,set}_string_attribute in {get,set}_strpool_attribute.
The only difference in behavior is that this removes the attribute when the pool becomes empty.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 109113370..335c48456 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -319,7 +319,7 @@ void RTLIL::AttrObject::set_strpool_attribute(RTLIL::IdString id, const pool<str
attrval += "|";
attrval += s;
}
- attributes[id] = RTLIL::Const(attrval);
+ set_string_attribute(id, attrval);
}
void RTLIL::AttrObject::add_strpool_attribute(RTLIL::IdString id, const pool<string> &data)
@@ -334,7 +334,7 @@ pool<string> RTLIL::AttrObject::get_strpool_attribute(RTLIL::IdString id) const
{
pool<string> data;
if (attributes.count(id) != 0)
- for (auto s : split_tokens(attributes.at(id).decode_string(), "|"))
+ for (auto s : split_tokens(get_string_attribute(id), "|"))
data.insert(s);
return data;
}