aboutsummaryrefslogtreecommitdiffstats
path: root/backends/cxxrtl/cxxrtl_backend.cc
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2021-07-16 11:12:19 +0000
committerGitHub <noreply@github.com>2021-07-16 11:12:19 +0000
commit2db41375141dd8098edac134e09b962a5b0821ab (patch)
tree4568df68fcf62ea91b85c1da66f98039c8dfeedd /backends/cxxrtl/cxxrtl_backend.cc
parentefc43270fa2435fac706e380b75a45a288844343 (diff)
parent5b003d6e5cf1790297f5d0f9fdfc95e0b64aa808 (diff)
downloadyosys-2db41375141dd8098edac134e09b962a5b0821ab.tar.gz
yosys-2db41375141dd8098edac134e09b962a5b0821ab.tar.bz2
yosys-2db41375141dd8098edac134e09b962a5b0821ab.zip
Merge pull request #2874 from whitequark/cxxrtl-fix-2589
cxxrtl: run hierarchy pass regardless of (*top*) attribute presence
Diffstat (limited to 'backends/cxxrtl/cxxrtl_backend.cc')
-rw-r--r--backends/cxxrtl/cxxrtl_backend.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/backends/cxxrtl/cxxrtl_backend.cc b/backends/cxxrtl/cxxrtl_backend.cc
index dfdb9df74..7ff344e66 100644
--- a/backends/cxxrtl/cxxrtl_backend.cc
+++ b/backends/cxxrtl/cxxrtl_backend.cc
@@ -2939,9 +2939,9 @@ struct CxxrtlWorker {
}
}
- void check_design(RTLIL::Design *design, bool &has_top, bool &has_sync_init)
+ void check_design(RTLIL::Design *design, bool &has_sync_init)
{
- has_sync_init = has_top = false;
+ has_sync_init = false;
for (auto module : design->modules()) {
if (module->get_blackbox_attribute() && !module->has_attribute(ID(cxxrtl_blackbox)))
@@ -2953,9 +2953,6 @@ struct CxxrtlWorker {
if (!design->selected_module(module))
continue;
- if (module->get_bool_attribute(ID::top))
- has_top = true;
-
for (auto proc : module->processes)
for (auto sync : proc.second->syncs)
if (sync->type == RTLIL::STi)
@@ -2966,10 +2963,10 @@ struct CxxrtlWorker {
void prepare_design(RTLIL::Design *design)
{
bool did_anything = false;
- bool has_top, has_sync_init;
+ bool has_sync_init;
log_push();
- check_design(design, has_top, has_sync_init);
- if (run_hierarchy && !has_top) {
+ check_design(design, has_sync_init);
+ if (run_hierarchy) {
Pass::call(design, "hierarchy -auto-top");
did_anything = true;
}
@@ -2990,7 +2987,7 @@ struct CxxrtlWorker {
}
// Recheck the design if it was modified.
if (did_anything)
- check_design(design, has_top, has_sync_init);
+ check_design(design, has_sync_init);
log_assert(!has_sync_init);
log_pop();
if (did_anything)