Skip to content

Commit 7430ca4

Browse files
committed
synth: Adjust options and ordering to support yosys-slang
Specify the top to yosys-slang with `--top` to make it ignore other modules. Reorder read_liberty ahead of design read-in so that Liberty cell definitions are available when elaborating. Signed-off-by: Martin Povišer <[email protected]>
1 parent 3709bc7 commit 7430ca4

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

flow/scripts/synth_preamble.tcl

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,23 @@ if {[env_var_exists_and_non_empty VERILOG_INCLUDE_DIRS]} {
2121
set vIdirsArgs [join $vIdirsArgs]
2222
}
2323

24+
# Read standard cells and macros as blackbox inputs
25+
# These libs have their dont_use properties set accordingly
26+
read_liberty -overwrite -setattr liberty_cell -lib {*}$::env(DONT_USE_LIBS)
27+
read_liberty -overwrite -setattr liberty_cell \
28+
-unit_delay -wb -ignore_miss_func -ignore_buses {*}$::env(DONT_USE_LIBS)
2429

2530
# Read verilog files
2631
if {[env_var_exists_and_non_empty SYNTH_USE_SLANG] && !([file extension $::env(VERILOG_FILES)] == ".rtlil")} {
2732
# slang requires all files at once
2833
plugin -i slang
2934
yosys read_slang -D SYNTHESIS --keep-hierarchy --compat=vcs \
30-
--ignore-assertions \
35+
--ignore-assertions --top $::env(DESIGN_NAME) \
3136
{*}$vIdirsArgs {*}$::env(VERILOG_FILES)
3237
} else {
3338
foreach file $::env(VERILOG_FILES) {
3439
if {[file extension $file] == ".rtlil"} {
35-
read_rtlil $file
40+
read_rtlil -overwrite $file
3641
} elseif {[file extension $file] == ".json"} {
3742
read_json $file
3843
} else {
@@ -41,15 +46,6 @@ if {[env_var_exists_and_non_empty SYNTH_USE_SLANG] && !([file extension $::env(V
4146
}
4247
}
4348

44-
45-
46-
47-
# Read standard cells and macros as blackbox inputs
48-
# These libs have their dont_use properties set accordingly
49-
read_liberty -overwrite -setattr liberty_cell -lib {*}$::env(DONT_USE_LIBS)
50-
read_liberty -overwrite -setattr liberty_cell \
51-
-unit_delay -wb -ignore_miss_func -ignore_buses {*}$::env(DONT_USE_LIBS)
52-
5349
# Apply toplevel parameters (if exist)
5450
if {[env_var_exists_and_non_empty VERILOG_TOP_PARAMS]} {
5551
dict for {key value} $::env(VERILOG_TOP_PARAMS) {

0 commit comments

Comments
 (0)