aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-04-18 17:42:12 +0200
committerClifford Wolf <clifford@clifford.at>2019-04-18 17:45:47 +0200
commitf4abc21d8ad79621cc24852bd76abf40a9d9f702 (patch)
tree016692552e9880b3e37a715b53f45db707c83a91 /kernel
parentea8ac0aaad3a1f89ead8eb44b2fef5927f29a099 (diff)
downloadyosys-f4abc21d8ad79621cc24852bd76abf40a9d9f702.tar.gz
yosys-f4abc21d8ad79621cc24852bd76abf40a9d9f702.tar.bz2
yosys-f4abc21d8ad79621cc24852bd76abf40a9d9f702.zip
Add "whitebox" attribute, add "read_verilog -wb"
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.cc6
-rw-r--r--kernel/rtlil.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 9ae20a317..2f8715755 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -589,7 +589,7 @@ std::vector<RTLIL::Module*> RTLIL::Design::selected_modules() const
std::vector<RTLIL::Module*> result;
result.reserve(modules_.size());
for (auto &it : modules_)
- if (selected_module(it.first) && !it.second->get_bool_attribute("\\blackbox"))
+ if (selected_module(it.first) && !it.second->get_blackbox_attribute())
result.push_back(it.second);
return result;
}
@@ -599,7 +599,7 @@ std::vector<RTLIL::Module*> RTLIL::Design::selected_whole_modules() const
std::vector<RTLIL::Module*> result;
result.reserve(modules_.size());
for (auto &it : modules_)
- if (selected_whole_module(it.first) && !it.second->get_bool_attribute("\\blackbox"))
+ if (selected_whole_module(it.first) && !it.second->get_blackbox_attribute())
result.push_back(it.second);
return result;
}
@@ -609,7 +609,7 @@ std::vector<RTLIL::Module*> RTLIL::Design::selected_whole_modules_warn() const
std::vector<RTLIL::Module*> result;
result.reserve(modules_.size());
for (auto &it : modules_)
- if (it.second->get_bool_attribute("\\blackbox"))
+ if (it.second->get_blackbox_attribute())
continue;
else if (selected_whole_module(it.first))
result.push_back(it.second);
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index fb045bc72..176dc3fc2 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -569,6 +569,10 @@ struct RTLIL::AttrObject
void set_bool_attribute(RTLIL::IdString id);
bool get_bool_attribute(RTLIL::IdString id) const;
+ bool get_blackbox_attribute() const {
+ return get_bool_attribute("\\blackbox") || get_bool_attribute("\\whitebox");
+ }
+
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;