Skip to content

Commit c4a1f28

Browse files
committed
synth: Factor out read procs from preamble
Signed-off-by: Martin Povišer <[email protected]>
1 parent 433b755 commit c4a1f28

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

flow/scripts/synth.tcl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
set ::env(RTLIL_FILE) $::env(RESULTS_DIR)/1_synth.rtlil
2-
31
source $::env(SCRIPTS_DIR)/synth_preamble.tcl
2+
read_checkpoint $::env(RESULTS_DIR)/1_synth.rtlil
43

54
hierarchy -check -top $::env(DESIGN_NAME)
65

flow/scripts/synth_canonicalize.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
source $::env(SCRIPTS_DIR)/synth_preamble.tcl
2+
read_design_sources
23

34
dict for {key value} $::env(VERILOG_TOP_PARAMS) {
45
# Apply toplevel parameters

flow/scripts/synth_preamble.tcl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ if {[env_var_exists_and_non_empty SYNTH_NETLIST_FILES]} {
2121
exit
2222
}
2323

24-
# Read design
25-
if {[env_var_exists_and_non_empty RTLIL_FILE]} {
24+
proc read_checkpoint {file} {
2625
# We are reading a Yosys checkpoint
27-
set file $env(RTLIL_FILE)
2826
if {[file extension $file] == ".json"} {
2927
read_json $file
3028
} else {
3129
read_rtlil $file
32-
}
33-
} else {
30+
}
31+
}
32+
33+
proc read_design_sources {} {
3434
# We are reading Verilog sources
3535
source $::env(SCRIPTS_DIR)/synth_stdcells.tcl
3636

0 commit comments

Comments
 (0)