how to run the multiple test cases for single dut and test bench using linux and questasim.
i have written the testbench using uvm
In reply to vinayks:
Are you just needing to run a few tests for yourself, one after the other? Or do you need a solution that can run many tests in parallel on a compute farm?
If you’re just serially running jobs on your own machine, some simple shell scripting will suffice. If you want to submit a regression to a compute farm, you’ll need cluster management software, along with a lot of scripting.
You either need to build your own scripts, or you need to find a vendor that can provide or build a solution for you.
In reply to warnerrs:
Hi warners,
other than building scripts is there any alternative methods to run all my test cases serially??
In reply to vinayks:
Scripting is how it’s done. The alternatives are just too painful, and not scalable. If your needs are simple, like say for a tiny academic project, then something like the following simple bash script can get you a long ways. You’ll need to replace vendor_specific_sim_command and vendor_specific_seed_switch with whatever is appropriate for your tools.
If you want this to be a complete solution, you’ll also need to add some log parsing to evaluate test results, and report a tally of passing/failing tests at the end.
#!/bin/bash
############################
# Define Helper Functions
############################
tool_cmd() {
local t="$1"; shift # test class name
local s="$1"; shift # seed to use
# ( set -x; command ) will cause the command to print before running the command
( set -x; vendor_specific_sim_command +UVM_TESTNAME=$t -vendor_specific_seed_switch=$s $@ )
}
# join input array together with -'s
join() { local IFS="-"; echo "$*"; }
# Make a directory to run the test, change to that directory and run the test; send the output to stdout and sim.log
run_test() {
local t="$1"; shift # test class name
local s="$1"; shift # seed to use
local tdir=$( join $t SEED $s $@ )
mkdir $tdir && pushd $tdir && tool_cmd $t $s $@ 2>&1 | tee sim.log
popd
}
rand_test() {
local nseeds="$1"; shift # Number of unique random seeds to run test with
local t="$1"; shift # test class name
# Generate nseeds unique random seeds between 1 and 10000, thanks interwebs: https://www.unix.com/unix-for-dummies-questions-and-answers/20150-random-numbers-without-repetition.html
local seeds=$(for i in {1..10000}; do echo $RANDOM $i; done|sort |cut -d" " -f2|head -$nseeds)
for s in $seeds; do
run_test $t $s $@
done
}
############################
# Run Tests
############################
# Run test1 with 5 unique random seeds, passing "+plus_arg" to the simulation command
rand_test 5 test1 +plus_args
# Run test2 once with a fixed seed=10
run_test test2 10
Also you can use Makefile for such purposes.
Main benefit of using Makefile, that you would not need to recompile previously compiled modules.