Skip to content

Commit 645a369

Browse files
committed
fix the util regexp
Signed-off-by: dsengupta0628 <dsengupta@precisioninno.com>
1 parent 4c88e06 commit 645a369

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎flow/scripts/util.tcl‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ proc recover_power_helper { } {
7474
}
7575

7676
proc extract_stage { input_file } {
77-
if { ![regexp {/([0-9])_(([0-9])_)?} $input_file match num1 _ num2] } {
77+
# Match the stage prefix on the basename, not the full path: an ancestor
78+
# dir like ".../4_slices/3_place.odb" would otherwise match "4_" -> stage 4.
79+
set stage_file [file tail $input_file]
80+
if { ![regexp {^([0-9])_(([0-9])_)?} $stage_file match num1 _ num2] } {
7881
puts "Error: Could not determine design stage from $input_file"
7982
exit 1
8083
}

0 commit comments

Comments
 (0)