Forum Discussion
Altera_Forum
Honored Contributor
11 years agoHere'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