- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a batch file that calls vsim -c -do test.tcl, after it's done I want to execute some more code. The problem is that in the command line it stays in the vsim command and doesn't return to execute the next instructions in the batch file.
Like so: vsim -c -do test.tcl <---- stuck here if exist test1 del test1 <--- cant execute thisLink Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know very little about windows batch files, but using a sh shell under Linux I have to make sure that
- The tcl script passed to vsim will terminate
- The standard input to the vsim process is re-directed from /dev/null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's a snippet from my Makefile.vsim that runs through a list of testbench files ...
.PHONY: check
check: $(CONTROL_TEST_LIB_DONE)
@cd $(CONTROL_TEST_DIR);
rm -f exitstatus;
for check in $(control_test_CHECKS); do
echo -n "TEST: $$check";
$(VSIM) $(VSIM_ARGS) -c control_test.$$check -gmakecheck=1
-do "run -a; q" &> $$check.log;
if ; then
if ; then
echo -e "\rFAIL: $$check (see $$check.log)";
rm exitstatus;
exit 1;
else
echo -e "\rPASS: $$check";
rm exitstatus;
fi;
else
echo -e "\rFAIL: $$check. `pwd`/exitstatus file not found. Check the testbench.";
exit 1;
fi;
done
The important bit for a testbench named testbench_tb would be ...
vsim -c control_test.testbench_tb -gmakecheck=1 -do "run -a; q" &> testbench_tb.log;
This loads the testbench that was compiled into the library control_test, sets the generic makecheck to 1 (which I use inside the testbench), runs the testbench to completion, and then "quits". As commented above, the bit you are missing is the quit command. Cheers, Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually I've experienced that when I have asserts in the code (even failure ones) vsim will not exit unless I redirect standard input from /dev/null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Actually I've experienced that when I have asserts in the code (even failure ones) vsim will not exit unless I redirect standard input from /dev/null --- Quote End --- I haven't seen that issue. The main problem I found with VHDL code was that since the only way to 'exit' the testbench prior to the introduction of stop() to the VHDL standard, you always had to exit with assert false, and so the exitstatus from the process was always failure. My solution was to create an exitfile at the start of the testbench and write a failure code to it. The Makefile checks to see if that file exists to determine whether it was a true assertion failure, rather than the final assertion failure used to exit the testbench. Cheers, Dave

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page