gen_randcase
1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/csh
./randdata 31 > init_regs
mv dmem test.regs
./randdata 31 4 > init_vregs
mv dmem test.vreg
./randdata 1024 > /dev/null
mv dmem test.dat
./randinst $1 > test.lst
mv insts test.out
#
# At this point we have:
#
# C-sim File Verilog File File Purpose
#
# test.lst test.lst Execution Listing File
#
# test.out test.out IMEM initial Value
#
# test.dat test.dat DMEM initial Value
#
# init_regs test.regs Register File initial Value
#
#
./rsp -tRz < go |& sed -e "s/^rsp > //" | egrep "^0x0" > trace.out
sed 's/://' trace.out | awk '{print $3}' | tee pcs | nper | tail -1 | awk '{ print $10}' >> test.cnt
# ( echo ibase=16 ; tr "[a-z]" "[A-Z]" < pcs | cut -c8-10 ) | bc > dpcs
#
# At this point we also have:
#
# C-sim File Verilog File File Purpose
#
# trace.out trace_out Execution Results
#
# test.cnt Simulation count
#
cp trace_out test.ctrace
echo -n "NC " >> test.ctrace
@ cnt = `tail -1 test.cnt`
( echo obase=16 ; echo $cnt ) | bc | tr "[A-Z]" "[a-z]" >> test.ctrace