Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Testbench flow control with TCL

Reply
Thread Tools

Testbench flow control with TCL

 
 
glw75 glw75 is offline
Junior Member
Join Date: Dec 2011
Posts: 2
 
      12-20-2011
I am currently attempting to use the following TCL script to control the simulation flow of my DUT. It basically does the following:
Reads in a txt file to get individual test names, passes each individual test name to the testbench framework. The idea being that each test is performed under a separate vsim command as opposed to having them concatenated together in one simulation run. I extract the system time at the start and end of each simulation run to pass into a log file. The first system time is passed in as a generic, the final system time is passed in as a force command when I encounter a pre-set breakpoint towards the end of the sim.

When my testbench eventually completes a simulation, it finishes with the following statement:
assert not(V_FINISH) report "Test Complete " severity failure;

The problem that I am having is that when the above line is executed, control is not passed back to the TCL file (which makes sense I guess as I’ve killed the simulation run). Is there a way of cleanly passing control back to the TCL script to get it to continue around the loop?

while { [gets $infile line] >= 0 } {
set length [string length $line]
if {[lsearch $line --* ] == -1} {
if {$length != 0} {
#Set the simulation time string
set str [clock format [clock seconds]]
#Vsim command and dereferenced tcl variable passed in as generic for time & date & test name
vsim -onfinish exit -G/uart_tb/u_uart_tb_control/time_string=\"$str" -G/uart_tb/u_uart_tb_control/g_test_name=\"$line" work.uart_tb
#Set the breakpoints for time insertion
bp ../testbench/UART_TB_CONTROL.vhd 415
# Set the commands that get executed when we encounter the breakpoints
# Capture the system time
# force the string value set in the design with this value
# continue the simulation
onbreak {set str [clock format [clock seconds]]; force -freeze sim:/uart_tb/U_UART_TB_CONTROL/FINAL_TIME $str 0; run -continue }
do wave.do
run -all
}
}
}

Many thanks.
 
Reply With Quote
 
 
 
 
glw75 glw75 is offline
Junior Member
Join Date: Dec 2011
Posts: 2
 
      12-20-2011
Found the answer if anyone's interested:

in the 'onbreak' command, if I replace 'run -continue' with 'resume' then control is passed back to the TCL script.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to build a loadable tcl dll with visual studio (microsoft C compiler)?[crosspost in comp.lang.tcl and comp.lang.c++] Michael Reichenbach C++ 5 02-08-2010 02:38 PM
Query:difference between node flow and filter flow in java's I/O,system? Jack Dowson Java 0 05-07-2007 03:35 PM
Inline::Tcl vs. Inline::Tcl Mumia W. Perl Misc 0 08-23-2006 04:09 PM
Incompatible Flow-Control on router & switch? Christoph Gartmann Cisco 0 12-21-2005 11:32 AM
ModelSim & tcl testbench Niv VHDL 2 10-07-2003 08:26 PM



Advertisments
 



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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57