From ff7a1a1568e0d4773b160b631da0446673149091 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 16 Apr 2020 21:43:03 +0000 Subject: rtlil: add AttrObject::{get,set}_string_attribute. And make {get,set}_src_attribute use those functions. --- kernel/rtlil.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'kernel/rtlil.h') 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 &data); void add_strpool_attribute(RTLIL::IdString id, const pool &data); pool 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 -- cgit v1.2.3