ASIC/FPGA Design and Verification Out Source Services
regression script for AIS DUT using system CMain features of the regression script are:
- Automatic seed generation based on perl command time with better granularity than one second.
- Keeps track on failing tests. When a test fails an entry is written to the log with the seed and error kind.
- Regression stops after a fixed number of tests has been done or the existence of the file stop.txt in the current running directory.
- Each regression run generates always the following data in the regression log:start simulation of 10000 runs at Sat Apr 11 10:34:02 EDT 2009stop simulation after 117 runs
- Coverage Handling: The script handles coverage collecting and accumulating.When a test finishes the system C test-bench writes data for coverage to a file named cov.txt.The following command collects the coverage information and accumulates it. The accumulation is written to a file named cov_acc.txt.When the regression ends it generates a nice HTML report, using the following command:perl Report/cov_report.pl cov.txt report
- To see an example of the coverage report press report
#!/bin/perl
open(FPWRLOG, ">>reg.log") || die("can not open reg.log\n");
$pl_seed=time ^ $$ or time ^ ($$ + ($$ << 15));
srand($pl_seed);
if($ARGV[0] eq "") {$lim=10000;}
else {$lim=$ARGV[0];}
if($ARGV[1] ne "") {$lim=1; $sc_seed=$ARGV[1];}
$date=`date`; chomp($date);
print FPWRLOG ("start simulation of $lim runs at $date\n");
for($i=0; $i<$lim; $i++) {
if( (-e "stop.txt") ) {#if file exist stop regression
print("stop due to user\n");
system("rm -f stop.txt");
print FPWRLOG ("stop simulation after $i runs\n");
system("perl Report/cov_report.pl cov.txt report");
exit(0);
}
if($ARGV[1] eq "") {
$sc_seed=int(rand(1000000));
}
$cmd="./run.x " . $sc_seed;
$res=`$cmd`;
if($res =~ /(.*ERROR.*)/) {
$t=$1; chomp($t);
print FPWRLOG ("fail seed = $sc_seed\n");
print FPWRLOG ("$t\n\n");
}
#coverae
@cov_A=split(/\n/, $res);
open(FPW, ">cov.txt") || die("can not open cov.txt\n");
foreach $j ( @cov_A ) {
chomp($j);
if($j =~ /^cov/) {
print FPW ("$j\n");
}
}
close(FPW);
system("perl Report/cov_report.pl cov.txt");
}#for
Contact me now at: |