mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	regression cleanup; unable to run buildroot coverage because of different config file
This commit is contained in:
		
							parent
							
								
									69805b4a60
								
							
						
					
					
						commit
						60a8a26f2e
					
				@ -18,7 +18,8 @@ all: riscoftests memfiles coveragetests
 | 
			
		||||
coverage:
 | 
			
		||||
	#make -C ../tests/coverage --jobs
 | 
			
		||||
	#iter-elf.bash --cover --search ../tests/coverage
 | 
			
		||||
	vcover merge -out cov/cov.ucdb cov/rv64gc_arch64i.ucdb cov/rv64gc*.ucdb riscv.ucdb -logfile cov/log
 | 
			
		||||
	vcover merge -out cov/cov.ucdb cov/rv64gc_arch64i.ucdb cov/rv64gc*.ucdb cov/buildroot_buildroot.ucdb riscv.ucdb -logfile cov/log
 | 
			
		||||
#	vcover merge -out cov/cov.ucdb cov/rv64gc_arch64i.ucdb cov/rv64gc*.ucdb riscv.ucdb /home/rthompson/buildroot_buildroot-no-trace.ucdb -logfile cov/log
 | 
			
		||||
	vcover report -details cov/cov.ucdb > cov/rv64gc_coverage_details.rpt
 | 
			
		||||
	vcover report cov/cov.ucdb -details -instance=/core/ebu. > cov/rv64gc_coverage_ebu.rpt
 | 
			
		||||
	vcover report cov/cov.ucdb -details -instance=/core/priv. > cov/rv64gc_coverage_priv.rpt
 | 
			
		||||
 | 
			
		||||
@ -6,7 +6,7 @@
 | 
			
		||||
# Core settings
 | 
			
		||||
--override cpu/unaligned=F
 | 
			
		||||
--override cpu/ignore_non_leaf_DAU=1
 | 
			
		||||
--override cpu/wfi_is_nop=T
 | 
			
		||||
#--override cpu/wfi_is_nop=T
 | 
			
		||||
--override cpu/mimpid=0x100
 | 
			
		||||
--override cpu/misa_Extensions_mask=0x0
 | 
			
		||||
 | 
			
		||||
@ -49,7 +49,7 @@
 | 
			
		||||
 | 
			
		||||
# Add Imperas simulator application instruction tracing
 | 
			
		||||
--override cpu/show_c_prefix=T
 | 
			
		||||
--trace --tracechange --traceshowicount --tracemode -tracemem ASX --monitornetschange --traceafter 10500000
 | 
			
		||||
--trace --tracechange --traceshowicount --tracemode -tracemem ASX --monitornetschange --traceafter 800000
 | 
			
		||||
 | 
			
		||||
# Exceptions and pagetables debug
 | 
			
		||||
--override cpu/debugflags=6
 | 
			
		||||
 | 
			
		||||
@ -49,7 +49,6 @@ configs = [
 | 
			
		||||
]
 | 
			
		||||
def getBuildrootTC(boot):
 | 
			
		||||
    INSTR_LIMIT = 4000000 # multiple of 100000; 4M is interesting because it gets into the kernel and enabling VM
 | 
			
		||||
#    INSTR_LIMIT = 8000000 # multiple of 100000; 4M is interesting because it gets into the kernel and enabling VM
 | 
			
		||||
    MAX_EXPECTED = 246000000 # *** TODO: replace this with a search for the login prompt.
 | 
			
		||||
    if boot:
 | 
			
		||||
        name="buildrootboot"
 | 
			
		||||
@ -182,8 +181,6 @@ def main():
 | 
			
		||||
    try:
 | 
			
		||||
        os.chdir(regressionDir)
 | 
			
		||||
        os.mkdir("logs")
 | 
			
		||||
        #print(os.getcwd())
 | 
			
		||||
        #print(regressionDir)
 | 
			
		||||
    except:
 | 
			
		||||
        pass
 | 
			
		||||
    try:
 | 
			
		||||
@ -204,9 +201,11 @@ def main():
 | 
			
		||||
        TIMEOUT_DUR = 30*7200 # seconds
 | 
			
		||||
        configs=[getBuildrootTC(boot=True)]
 | 
			
		||||
    elif '-coverage' in sys.argv:
 | 
			
		||||
        TIMEOUT_DUR = 20*60 # seconds       
 | 
			
		||||
        configs.append(getBuildrootTC(boot=False))
 | 
			
		||||
        os.system('rm cov/*.ucdb')
 | 
			
		||||
        TIMEOUT_DUR = 20*60 # seconds    
 | 
			
		||||
    #   Presently don't run buildroot because it has a different config and can't be merged with the rv64gc coverage.
 | 
			
		||||
    #   Also it is slow to run.   
 | 
			
		||||
    #    configs.append(getBuildrootTC(boot=False))
 | 
			
		||||
        os.system('rm -f cov/*.ucdb')
 | 
			
		||||
    else:
 | 
			
		||||
        TIMEOUT_DUR = 10*60 # seconds
 | 
			
		||||
        configs.append(getBuildrootTC(boot=False))
 | 
			
		||||
@ -228,12 +227,6 @@ def main():
 | 
			
		||||
    # Coverage report
 | 
			
		||||
    if coverage:
 | 
			
		||||
       os.system('make coverage')
 | 
			
		||||
       #print('Generating coverage report')
 | 
			
		||||
       #os.system('vcover merge -out cov/cov.ucdb cov/rv64gc_arch64i.ucdb cov/rv64gc*.ucdb -logfile cov/log')
 | 
			
		||||
       #os.system('vcover report -details cov/cov.ucdb > cov/rv64gc_coverage_details.rpt')
 | 
			
		||||
       #os.system('vcover report -below 100 cov/cov.ucdb > cov/rv64gc_coverage.rpt')
 | 
			
		||||
       #os.system('vcover report -recursive cov/cov.ucdb > cov/rv64gc_recursive.rpt')
 | 
			
		||||
       #os.system('vcover report -details -threshH 100 -html cov/cov.ucdb')
 | 
			
		||||
    # Count the number of failures
 | 
			
		||||
    if num_fail:
 | 
			
		||||
        print(f"{bcolors.FAIL}Regression failed with %s failed configurations{bcolors.ENDC}" % num_fail)
 | 
			
		||||
 | 
			
		||||
@ -46,7 +46,7 @@ mkdir -p cov
 | 
			
		||||
# Check if measuring coverage
 | 
			
		||||
 set coverage 0
 | 
			
		||||
if {$argc >= 3} {
 | 
			
		||||
    if {$3 eq "-coverage"} {
 | 
			
		||||
    if {$3 eq "-coverage" || ($argc >= 7 && $7 eq "-coverage")} {
 | 
			
		||||
        set coverage 1
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -61,8 +61,14 @@ if {$argc >= 3} {
 | 
			
		||||
if {$2 eq "buildroot" || $2 eq "buildroot-checkpoint"} {
 | 
			
		||||
    vlog -lint -work wkdir/work_${1}_${2} +incdir+../config/$1 +incdir+../config/shared ../testbench/testbench-linux.sv ../testbench/common/*.sv ../src/*/*.sv ../src/*/*/*.sv -suppress 2583
 | 
			
		||||
    # start and run simulation
 | 
			
		||||
    vopt wkdir/work_${1}_${2}.testbench -work wkdir/work_${1}_${2} -G RISCV_DIR=$3 -G INSTR_LIMIT=$4 -G INSTR_WAVEON=$5 -G CHECKPOINT=$6 -o testbenchopt 
 | 
			
		||||
    vsim -lib wkdir/work_${1}_${2} testbenchopt -suppress 8852,12070,3084,3691,13286  -fatal 7
 | 
			
		||||
    if { $coverage } {
 | 
			
		||||
        echo "wally-batch buildroot coverage"
 | 
			
		||||
        vopt wkdir/work_${1}_${2}.testbench -work wkdir/work_${1}_${2} -G RISCV_DIR=$3 -G INSTR_LIMIT=$4 -G INSTR_WAVEON=$5 -G CHECKPOINT=$6 -o testbenchopt +cover=sbecf
 | 
			
		||||
        vsim -lib wkdir/work_${1}_${2} testbenchopt -suppress 8852,12070,3084,3691,13286  -fatal 7 -cover
 | 
			
		||||
     } else {
 | 
			
		||||
        vopt wkdir/work_${1}_${2}.testbench -work wkdir/work_${1}_${2} -G RISCV_DIR=$3 -G INSTR_LIMIT=$4 -G INSTR_WAVEON=$5 -G CHECKPOINT=$6 -o testbenchopt 
 | 
			
		||||
        vsim -lib wkdir/work_${1}_${2} testbenchopt -suppress 8852,12070,3084,3691,13286  -fatal 7
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    run -all
 | 
			
		||||
    run -all
 | 
			
		||||
@ -139,6 +145,7 @@ if {$2 eq "buildroot" || $2 eq "buildroot-checkpoint"} {
 | 
			
		||||
} 
 | 
			
		||||
 | 
			
		||||
if {$coverage} {
 | 
			
		||||
    echo "Saving coverage to ${1}_${2}.ucdb"
 | 
			
		||||
    do coverage-exclusions-rv64gc.do  # beware: this assumes testing the rv64gc configuration
 | 
			
		||||
    coverage save -instance /testbench/dut/core cov/${1}_${2}.ucdb
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -28,6 +28,11 @@
 | 
			
		||||
 | 
			
		||||
main:
 | 
			
		||||
 | 
			
		||||
    # Division test (having trouble with buildroot)
 | 
			
		||||
    li x11, 0x384000
 | 
			
		||||
    li x12, 0x1c2000
 | 
			
		||||
    divuw x9, x11, x12
 | 
			
		||||
 | 
			
		||||
    # Test clz with all bits being 0
 | 
			
		||||
    li t0, 0
 | 
			
		||||
    clz t1, t0
 | 
			
		||||
@ -61,5 +66,6 @@ main:
 | 
			
		||||
    .word 0x6080101B  // Illegal BMU similar to count word
 | 
			
		||||
    .word 0x6030101B  // Illegal BMU similar to count word
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    j done
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user