File size: 1,228 Bytes
34292e0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Runs one step's script, $STEP_TCL, for flow.sh. With WRITE_ON_FAILURE=1,
# an error anywhere in the step writes the design as it was at the failure
# to $RESULTS_DIR/$STEP_NAME-failed.odb and .sdc, e.g. 3_3_place_gp-failed.odb,
# so it can be inspected without running the step again; the step then
# fails with the original error.

proc write_failure_checkpoint { } {
  if { !$::env(WRITE_ON_FAILURE) } {
    return
  }
  set chip [[ord::get_db] getChip]
  if { $chip == "NULL" || [$chip getBlock] == "NULL" } {
    puts "No design loaded, no failure checkpoint written"
    return
  }
  set stem $::env(RESULTS_DIR)/$::env(STEP_NAME)-failed
  puts "Writing failure checkpoint $stem.odb"
  write_db $stem.odb
  write_sdc -no_timestamp $stem.sdc
}

# Any status but 0 fails the step: an error, and a break, continue or
# other code no loop caught. A top-level return in the script is status 0,
# as source makes it. The status, message and stack are raised again as
# they were.
if { [catch { uplevel #0 [list source $::env(STEP_TCL)] } msg opts] != 0 } {
  if { [catch { write_failure_checkpoint } checkpoint_error] } {
    puts "Warning: failure checkpoint not written: $checkpoint_error"
  }
  return -options $opts $msg
}