Skip to content

Commit

Permalink
Fix skip_basic_prep, step mechanics (The-OpenROAD-Project#1143)
Browse files Browse the repository at this point in the history
~ Fix issue where `skip_basic_prep` would not be ran in some scenarios where a previous run is being resumed
~ Fix how `-from` and `CURRENT_STEP` interact
  • Loading branch information
donn authored Jun 18, 2022
1 parent 074a92b commit 732c856
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
15 changes: 9 additions & 6 deletions flow.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,18 @@ proc run_non_interactive_mode {args} {
"cvc" "run_lef_cvc"
]

set_if_unset arg_values(-to) "cvc";

if { [info exists ::env(CURRENT_STEP) ] } {
puts_info "Resuming flow where $::env(RUN_TAG) stopped (stage: $::env(CURRENT_STEP))..."
if { [info exists arg_values(-from) ]} {
puts_info "Starting flow at $arg_values(-from)..."
set ::env(CURRENT_STEP) $arg_values(-from)
} elseif { [info exists ::env(CURRENT_STEP) ] } {
puts_info "Resuming flow from $::env(CURRENT_STEP)..."
} else {
set ::env(CURRENT_STEP) "synthesis";
set ::env(CURRENT_STEP) "synthesis"
}

set_if_unset arg_values(-from) $::env(CURRENT_STEP);
set_if_unset arg_values(-from) $::env(CURRENT_STEP)
set_if_unset arg_values(-to) "cvc"

set exe 0;
dict for {step_name step_exe} $steps {
if { [ string equal $arg_values(-from) $step_name ] } {
Expand Down
21 changes: 13 additions & 8 deletions scripts/tcl_commands/all.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,9 @@ proc prep {args} {
puts_info "Use 'set_def file_name.def' if you'd like to change it."
}
after 1000
set skip_basic_prep 1
if { [info exists ::env(BASIC_PREP_COMPLETE)] && "$::env(BASIC_PREP_COMPLETE)" == "1"} {
set skip_basic_prep 1
}
}
}

Expand Down Expand Up @@ -606,6 +608,16 @@ proc prep {args} {
puts_warn "GPIO_PADS_VERILOG is not set; cannot read as a blackbox"
}
}


# Convert Tracks
if { $::env(TRACKS_INFO_FILE) != "" } {
set tracks_processed $::env(routing_tmpfiles)/config.tracks
try_catch $::env(OPENROAD_BIN) -python $::env(SCRIPTS_DIR)/new_tracks.py -i $::env(TRACKS_INFO_FILE) -o $tracks_processed
set ::env(TRACKS_INFO_FILE_PROCESSED) $tracks_processed
}

set ::env(BASIC_PREP_COMPLETE) {1}
}

# Fill config file with special cases
Expand Down Expand Up @@ -660,13 +672,6 @@ proc prep {args} {
try_catch echo "openlane $::env(OPENLANE_VERSION)" > $::env(RUN_DIR)/OPENLANE_VERSION
}

# Convert Tracks
if { $::env(TRACKS_INFO_FILE) != "" } {
set tracks_processed $::env(routing_tmpfiles)/config.tracks
try_catch $::env(OPENROAD_BIN) -python $::env(SCRIPTS_DIR)/new_tracks.py -i $::env(TRACKS_INFO_FILE) -o $tracks_processed
set ::env(TRACKS_INFO_FILE_PROCESSED) $tracks_processed
}

if { [info exists ::env(EXTRA_GDS_FILES)] } {
puts_verbose "Verifying existence of files defined in ::env(EXTRA_GDS_FILES)..."
assert_files_exist "$::env(EXTRA_GDS_FILES)"
Expand Down

0 comments on commit 732c856

Please sign in to comment.