aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rtlil.h
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.h
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.h')
-rw-r--r--kernel/rtlil.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 17f038e36..fe9e21c31 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -663,12 +663,19 @@ struct RTLIL::AttrObject
return get_bool_attribute(ID::blackbox) || (!ignore_wb && get_bool_attribute(ID::whitebox));
}
+ void set_string_attribute(RTLIL::IdString id, string value);
+ string get_string_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;
+ void set_src_attribute(const std::string &src) {
+ set_string_attribute(ID::src, src);
+ }
+ std::string get_src_attribute() const {
+ return get_string_attribute(ID::src);
+ }
};
struct RTLIL::SigChunk