|
| 1 | +utl::set_metrics_stage "synth__{}" |
| 2 | +source $::env(SCRIPTS_DIR)/load.tcl |
| 3 | +erase_non_stage_variables synth |
| 4 | + |
| 5 | +source_env_var_if_exists PLATFORM_TCL |
| 6 | +source $::env(SCRIPTS_DIR)/read_liberty.tcl |
| 7 | + |
| 8 | +read_lef $::env(TECH_LEF) |
| 9 | +read_lef $::env(SC_LEF) |
| 10 | +if { [env_var_exists_and_non_empty ADDITIONAL_LEFS] } { |
| 11 | + foreach lef $::env(ADDITIONAL_LEFS) { |
| 12 | + read_lef $lef |
| 13 | + } |
| 14 | +} |
| 15 | +if { [env_var_exists_and_non_empty DONT_USE_CELLS] } { |
| 16 | + set_dont_use $::env(DONT_USE_CELLS) |
| 17 | +} |
| 18 | + |
| 19 | +# Setup verilog include directories |
| 20 | +set vIdirsArgs "" |
| 21 | +if { [env_var_exists_and_non_empty VERILOG_INCLUDE_DIRS] } { |
| 22 | + foreach dir $::env(VERILOG_INCLUDE_DIRS) { |
| 23 | + lappend vIdirsArgs "-I$dir" |
| 24 | + } |
| 25 | + set vIdirsArgs [join $vIdirsArgs] |
| 26 | +} |
| 27 | + |
| 28 | +set elaborate_args [list \ |
| 29 | + -D SYNTHESIS --compat=vcs --ignore-assertions --no-implicit-memories --top $::env(DESIGN_NAME) \ |
| 30 | + {*}$vIdirsArgs {*}[env_var_or_empty VERILOG_DEFINES]] |
| 31 | + |
| 32 | +lappend elaborate_args {*}$::env(VERILOG_FILES) |
| 33 | + |
| 34 | +# Apply top-level parameters |
| 35 | +dict for {key value} [env_var_or_empty VERILOG_TOP_PARAMS] { |
| 36 | + lappend elaborate_args -G "$key=$value" |
| 37 | +} |
| 38 | + |
| 39 | +# Apply module blackboxing based on module names as they appear |
| 40 | +# in the input, that is before any module name mangling done |
| 41 | +# by elaboration and synthesis |
| 42 | +if { [env_var_exists_and_non_empty SYNTH_BLACKBOXES] } { |
| 43 | + foreach m $::env(SYNTH_BLACKBOXES) { |
| 44 | + lappend elaborate_args --blackboxed-module "$m" |
| 45 | + } |
| 46 | +} |
| 47 | + |
| 48 | +lappend elaborate_args {*}$::env(SYNTH_SLANG_ARGS) |
| 49 | + |
| 50 | +# If the sources are solely .v files, enable Verilog compatibility |
| 51 | +set has_non_v_files false |
| 52 | +foreach fn $::env(VERILOG_FILES) { |
| 53 | + if { [file extension [string trim $fn]] != ".v" } { |
| 54 | + set has_non_v_files true |
| 55 | + } |
| 56 | +} |
| 57 | +if { !$has_non_v_files } { |
| 58 | + lappend elaborate_args --std=1364-2005 |
| 59 | +} |
| 60 | + |
| 61 | +sv_elaborate {*}$elaborate_args |
| 62 | +syn::stats |
| 63 | + |
| 64 | +synthesize |
| 65 | + |
| 66 | +read_sdc $::env(SDC_FILE) |
| 67 | +repair_design -pre_placement |
| 68 | + |
| 69 | +report_metrics 1 "synth" false false |
| 70 | + |
| 71 | +orfs_write_db $::env(RESULTS_DIR)/1_synth.odb |
| 72 | +# Canonicalize 1_synth.sdc. The original SDC_FILE provided by |
| 73 | +# the user could have dependencies, such as sourcing util.tcl, |
| 74 | +# which are read in here and a canonicalized version is written |
| 75 | +# out by OpenSTA that has no dependencies. |
| 76 | +orfs_write_sdc $::env(RESULTS_DIR)/1_synth.sdc |
0 commit comments