From 4bc1e1d1f1d3f27b3e437591255a38ab647f0453 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 26 Aug 2022 17:12:56 +0200 Subject: [PATCH 1/2] Makes sure to set initial_top when change, fixes #3462 --- passes/hierarchy/hierarchy.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/passes/hierarchy/hierarchy.cc b/passes/hierarchy/hierarchy.cc index d27fddf1c..eea6abb04 100644 --- a/passes/hierarchy/hierarchy.cc +++ b/passes/hierarchy/hierarchy.cc @@ -1058,6 +1058,7 @@ struct HierarchyPass : public Pass { if (tmp_top_mod != NULL) { if (tmp_top_mod != top_mod){ top_mod = tmp_top_mod; + top_mod->attributes[ID::initial_top] = RTLIL::Const(1); did_something = true; } } From 5b5fe76966b44ebc35e0087072c1df2c2bba044b Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 29 Aug 2022 10:10:09 +0200 Subject: [PATCH 2/2] Add test for bug 3462 --- tests/various/bug3462.ys | 12 ++++++++++++ tests/various/sub.v | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 tests/various/bug3462.ys create mode 100644 tests/various/sub.v diff --git a/tests/various/bug3462.ys b/tests/various/bug3462.ys new file mode 100644 index 000000000..c85dc9470 --- /dev/null +++ b/tests/various/bug3462.ys @@ -0,0 +1,12 @@ +read_verilog <