From 4ba7421085f76e6473077f99aa9a4ecb5ddf3eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Sun, 26 Jul 2026 21:14:13 +0200 Subject: [PATCH] synth: extend SYNTH_KEEP_MODULES selection pattern for slang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Harboe --- flow/scripts/synth.tcl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flow/scripts/synth.tcl b/flow/scripts/synth.tcl index 58dc0af1d2..644b1b0b1b 100644 --- a/flow/scripts/synth.tcl +++ b/flow/scripts/synth.tcl @@ -76,8 +76,8 @@ if { [env_var_exists_and_non_empty SYNTH_KEEP_MODULES] } { foreach module $::env(SYNTH_KEEP_MODULES) { # Two patterns so both frontends work: # - `$module` matches the bare name produced by verilog. - # - `$module\$*` matches the `$`-suffixed canonical names the - # slang frontend generates for parameterized instances + # - `$module\$*` and `$module*` match `$`-suffixed canonical names + # the slang frontend generates for parameterized instances # (e.g. `\foo$1`); yosys's match_ids retries the pattern with # the id's leading `\` stripped, so no `\`-prefix is needed # here -- see tools/yosys/passes/cmds/select.cc match_ids(). @@ -87,7 +87,7 @@ if { [env_var_exists_and_non_empty SYNTH_KEEP_MODULES] } { # other pattern still applies -- no regression for non-slang. # `-module ` would error if the module doesn't exist, which # is why we use bare patterns instead. - select "$module" "$module\\\$*" + select "$module" "$module\\\$*" "$module*" setattr -mod -set keep_hierarchy 1 select -clear }