Run multiple testcases using makefile

filename = makefile.ius

UVM_VERBOSITY = UVM_LOW

Note that “-access rw” have an adverse impact on performance

and should not be used unless necessary.

They are used here because they are required by some examples

(backdoor register accesses).

TEST = /usr/bin/test
N_ERRS = 0
N_FATALS = 0

IUS = irun -access rw -disable_sem2009 -uvmhome (UVM_HOME) +UVM_VERBOSITY=(UVM_VERBOSITY) -quiet -gui -coverage all

CHECK =
@(TEST) \( `grep -c 'UVM_ERROR : (N_ERRS)’ irun.log-eq 1 \) -a \ \(grep -c ‘UVM_FATAL : $(N_FATALS)’ irun.log` -eq 1 )

clean:
rm -rf ~ core csrc simv vc_hdrs.h ucli.key *.log INCA_libs

file name = makefile

TIMESCALE = “-timescale 1ns/1ns”

include ./Makefile.ius

test1:
(IUS) (TIMESCALE) -f filelist.f +UVM_TESTNAME=spi_test_1 +svseed=(SEED) (CHECK)

test2:
(IUS) (TIMESCALE) -f filelist.f +UVM_TESTNAME=spi_test_2 +svseed=(SEED) (CHECK)

cleantest:
rm -rf INCA_libs *.log *.key *.history waves.shm *.err *.diag

regress: test1 test2

The above makefile i am using to run multiple testcases but only the test1 is running not test2, can anyone help me where is the problem as i am new to write makefile.

In reply to Amarjit pradhan:

How did you execute this Makefile? Did you call ‘make regress’ instruction?
Note: This is Makefile execution problem, it doesn’t related to UVM.

In reply to cuonghl:

In reply to Amarjit pradhan:
How did you execute this Makefile? Did you call ‘make regress’ instruction?
Note: This is Makefile execution problem, it doesn’t related to UVM.

yes i call make regress

In reply to Amarjit pradhan:

I believe if you perform command ‘make regress’ both test1 and test2 will run. But keep in mind, if the commands ($IUS, $CHECK) in test1 target are not successully executed (exit status != 0) then Makefile won’t execute the next target (test2). Please check the exit code of $IUS and $CHECK command at test1 target.

In reply to cuonghl:

You can manually check the exit code of a command by using “echo $?”. If it returns 0, then the command is successfully executed otherwise it isn’t. I think the problem comes from $CHECK command, if you can’t grep “UVM_ERROR : 0” or “UVM_FATAL : 0” (your UVM Test failed), the exit code of $CHECK command will be 1, and the Makefile will be terminated. That’s why you won’t see test2 target is executed.

Thanks,
Chris.

In reply to cuonghl:

In reply to cuonghl:
You can manually check the exit code of a command by using “echo $?”. If it returns 0, then the command is successfully executed otherwise it isn’t. I think the problem comes from $CHECK command, if you can’t grep “UVM_ERROR : 0” or “UVM_FATAL : 0” (your UVM Test failed), the exit code of $CHECK command will be 1, and the Makefile will be terminated. That’s why you won’t see test2 target is executed.
Thanks,
Chris.

yes i checked using “echo $?” and it returns 0.
just look at the below makefile i am using now without $check ,its behaves same.

UVM_HOME = /chicago/tools/cadence/INCISIV15.20/tools.lnx86/methodology/UVM/CDNS-1.2-ML/sv

TIMESCALE = “-timescale 1ns/1ns”

UVM_VERBOSITY = UVM_LOW

test1:
irun -access rw -uvmhome (UVM_HOME) +UVM_VERBOSITY=(UVM_VERBOSITY) -quiet -coverage all (TIMESCALE) -f filelist.f +UVM_TESTNAME=spi_test_1 +svseed=(SEED)

test2:
irun -access rw -uvmhome (UVM_HOME) +UVM_VERBOSITY=(UVM_VERBOSITY) -quiet -coverage all (TIMESCALE) -f filelist.f +UVM_TESTNAME=spi_test_2 +svseed=(SEED)

cleantest:
rm -rf INCA_libs *.log *.key *.history waves.shm *.err *.diag cov_work

regress: cleantest test1 test2

sorry, i am asking questions on makefile .
thanks in advance.

In reply to Amarjit pradhan:

Can you manually run the following command in terminal and check the exit code status by run "echo ?": irun -access rw -uvmhome (UVM_HOME) +UVM_VERBOSITY=(UVM_VERBOSITY) -quiet -coverage all (TIMESCALE) -f filelist.f +UVM_TESTNAME=spi_test_1 +svseed=$(SEED)

I think the command above does not return exit code 0.

In reply to cuonghl:

In reply to Amarjit pradhan:
Can you manually run the following command in terminal and check the exit code status by run "echo ?": irun -access rw -uvmhome (UVM_HOME) +UVM_VERBOSITY=(UVM_VERBOSITY) -quiet -coverage all (TIMESCALE) -f filelist.f +UVM_TESTNAME=spi_test_1 +svseed=$(SEED)
I think the command above does not return exit code 0.

yes you are correct, it returns 1. could you please tell me what is the correct way to do it.

In reply to Amarjit pradhan:

There are several ways to do it. Please refer the following suggestion:

In reply to cuonghl:

In reply to Amarjit pradhan:
There are several ways to do it. Please refer the following suggestion:
Errors (GNU make)

Thank you now its working, but is it possible to observe two testcase waveforms in a single waveform window because for this case two waveforms are generated separately for two testcases.