- Compile the design using -debug_all switch.
>> vcs -debug_all <other options>
- Load the executable in UCLI/GUI
>> simv -ucli (or -gui)
- source the loop_detect.tcl
ucli> source (or do) ./loop_detect.tcl
- Run the simulations till the exact point where simulation hangs
ucli> run <time> #point where simulation hangs
- Execute the loop_detect procedure
ucli> loop_detect <no. of iterations>
其中,loop_detect.tcl的内容为
#!/usr/bin/tclsh
proc loop_detect(args) {
set help "-help"
if{[string equal $args $help] != 1} {
config followactivescope on
set i 0;
while {$i < $args} {
run_step
incr i
}
}
else {
puts "Usage: loop_detect <no. of iteration>"
}
}
proc run_step{} {
redirect -f loop.txt -a {set x [step]};
redirect -f loop.txt -a {set y [scope]};
puts $x;
puts $y;
}