rtestgen 1.21 KB
#!/bin/csh

# set echo

echo Trying to Compile

# time rsp_random -norun

echo -n "Starting testgen at "
date

@ tmax = 10

if( $#argv > 1 ) then
@   tmax = $2
    echo New tmax = $tmax
endif

@ tnum = 0
@ errnum = 0

while( $tnum < $tmax )

    cd ..

@   len = 0
    while( $len < 80 )
	./gen_randcase test{$1}.desc
@	len = `tail -1 test.cnt`
	echo Sim len = $len
    end

    head -$len trace.out | awk '{print $4}' | sort | uniq -c > inst.cnts
    cat inst.cnts tot.insts.cnts | nawk '{cnt[$2] += $1}END{for(x in cnt) printf "%6d %s\n",cnt[x], x}' | sort +1 > tmp.inst.cnts
    mv tmp.inst.cnts tot.insts.cnts

    echo Running Simulation num $tnum for $len clocks

#    echo Hit return to continue
#    echo You hit $<

    cd rsptst/rtests
    make >& /dev/null
#    make

    cd ..

    time rsp_random +ctrace -nocompile +random_idma  +random_ddma +random_halt

    grep FAIL random.log

    if( $status == 0 ) then

	echo Failure $errnum test $tnum

	cp -r rtests err{$1}.$tnum
	cp random{.log,.stdout,_dma.log} ../trace.out ../pcs ../init_vregs ../init_regs err{$1}.$tnum

@	errnum++
	if( $errnum > 20 ) goto finish

    endif

@   tnum++

end

finish:

echo Found $errnum errors in $tnum tests

echo -n "Finishing testgen at "
date