OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [orp/] [orp_soc/] [sim/] [bin/] [run_rtl_regression] - Blame information for rev 1777

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 975 lampret
#!/bin/csh -f
2
 
3
set iter = 1;
4
set failed = 0;
5
set all_tests = 0;
6
# List all test cases
7
#set simpletests=(buserr-nocache immu-nocache dmmu-nocache basic-nocache mul-nocache-O2 syscall-nocache cbasic-nocache-O2 ints1-nocache ints2-nocache \
8
#               buserr-icdc immu-icdc dmmu-icdc basic-icdc mul-icdc-O2 syscall-icdc cbasic-icdc-O2 ints1-icdc ints2-icdc)
9 1271 lampret
 
10
#set simpletests=(basic-nocache mul-nocache-O2 cbasic-nocache-O2 ints1-nocache ints2-nocache \
11 975 lampret
#               basic-icdc mul-icdc-O2 cbasic-icdc-O2 ints1-icdc ints2-icdc)
12 1271 lampret
 
13
#set simpletests=(icm-icdc icm-nocache dhry-nocache-O2 dhry-icdc-O2 mmu-nocache mmu-icdc basic-icdc basic-nocache mul-nocache-O2 mul-icdc-O2 basic-ic basic-dc)
14
#set simpletests=(crc32-icdc-O0 minimad dhry-nocache-O2 dhry-icdc-O2 mmu-nocache mmu-icdc basic-icdc basic-nocache mul-nocache-O2 mul-icdc-O2 basic-ic basic-dc)
15 975 lampret
#set complextests=(buserr-ic immu-ic dmmu-ic basic-ic mul-ic-O2 syscall-ic cbasic-ic-O2 ints1-ic ints2-ic \
16
#               buserr-dc immu-dc dmmu-dc basic-dc mul-dc-O2 syscall-dc cbasic-dc-O2 ints1-dc ints2-dc \
17
#               mul-nocache-O0 cbasic-nocache-O0 \
18
#               mul-icdc-O0 cbasic-icdc-O0 \
19
#               mul-ic-O0 cbasic-ic-O0 \
20
#               mul-dc-O0 cbasic-dc-O0)
21 1271 lampret
 
22
#set complextests=(except-nocache except-icdc cbasic-nocache-O2 cbasic-icdc-O0 tick-nocache tick-icdc \
23
#               syscall-nocache syscall-icdc uart-nocache uart-icdc debug-nocache debug-dc )
24
 
25
set simpletests=`cat ../bin/tests`
26
set complextests=()
27
 
28
set simpletimes=(500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 )
29
set complextimes=(40 40 \
30
                 400 140 \
31
                  100 40 \
32
                  40 40 \
33
                  40 40 )
34 975 lampret
set iterations=( \
35 1271 lampret
                "DBG_IF_MODEL+SRAM_GENERIC_REGISTERED+OR1200_CLMODE_1TO2" \
36
                "DBG_IF_MODEL+OR1200_CLMODE_1TO2" \
37
                "DBG_IF_MODEL+FLASH_GENERIC" \
38
                "DBG_IF_MODEL" \
39
                "DBG_IF_MODEL+FLASH_GENERIC+FLASH_GENERIC_REGISTERED" \
40
                "DBG_IF_MODEL+FLASH_GENERIC+FLASH_GENERIC_REGISTERED+SRAM_GENERIC_REGISTERED" \
41
                "DBG_IF_MODEL+FLASH_GENERIC+FLASH_GENERIC_REGISTERED+OR1200_CLMODE_1TO2" \
42
                "DBG_IF_MODEL+FLASH_GENERIC+FLASH_GENERIC_REGISTERED+SRAM_GENERIC_REGISTERED+OR1200_CLMODE_1TO2" \
43
                "DBG_IF_MODEL+SRAM_GENERIC_REGISTERED" \
44 975 lampret
                "")
45
 
46
# Process arguments
47
if ($1 == "simple") then
48
        set tests=(${simpletests})
49
        set maxtimes=(${simpletimes})
50
else
51
        set tests=(${simpletests} ${complextests})
52
        set maxtimes=(${simpletimes} ${complextimes})
53
endif
54
if ($1 == "single") then
55
        set tests=(${simpletests} ${complextests})
56
        set maxtimes=(${simpletimes} ${complextimes})
57
        set tests=${tests[$2]}
58
        set maxtimes=${maxtimes[$2]}
59
endif
60
if ($1 == "clean") then
61
        rm -rf ../log/*
62
        rm -rf ../out/wave/*
63
        exit 0;
64
else if ($1 == "sim") then
65
        goto sim;
66
endif
67
 
68
# Print HW clock
69
/sbin/hwclock
70
 
71
# List all selected tests
72
set i = 0;
73
foreach test ($tests)
74
        @ i += 1;
75 1271 lampret
        /bin/echo -n -e " Test ${i}: ${test}, $maxtimes[$i] ms\t"
76 975 lampret
        if ((${i} % 2) == 0) then
77 1271 lampret
                /bin/echo -e ""
78 975 lampret
        endif
79
end
80
 
81 1271 lampret
/bin/echo -e ""
82 975 lampret
 
83
set i = 1;
84
while ($iterations[$i] != "")
85 1271 lampret
        /bin/echo -e " Iteration ${i}: ${iterations[$i]}\t"
86 975 lampret
        @ i += 1;
87
end
88
 
89
# Prepare all .args files
90
iteration:
91 1271 lampret
/bin/echo -e ""
92
/bin/echo -e "<<<"
93
/bin/echo -e "<<< Iteration ${iter}: ${iterations[$iter]}"
94
/bin/echo -e "<<<"
95 975 lampret
if (${iterations[$iter]} != "") then
96
        ncprep +define+${iterations[$iter]} -f ../bin/nc.scr > ncprep.out
97
else
98
        ncprep -f ../bin/nc.scr > ncprep.out
99
endif
100
if (`tail -1 ncprep.out | grep Failed` != "") then
101 1271 lampret
  /bin/echo -e ""
102 975 lampret
  cat ncprep.out
103
  exit
104
endif
105
 
106
# Run NC-Verilog compiler
107 1271 lampret
/bin/echo -e ""
108
/bin/echo -e "\t@@@"
109
/bin/echo -e "\t@@@ Compiling sources"
110
/bin/echo -e "\t@@@"
111 975 lampret
ncvlog -NOCOPYRIGHT -f ncvlog.args > ncvlog.out
112
if ($status != 0) then
113 1271 lampret
  /bin/echo -e "\t@@@ FAILED"
114
  /bin/echo -e ""
115 975 lampret
  cat ncvlog.out
116
  exit
117
else
118 1271 lampret
  /bin/echo -e "\t@@@ Passed"
119 975 lampret
endif
120
 
121
# Run the NC-Verilog elaborator (build the design hierarchy)
122 1271 lampret
/bin/echo -e ""
123
/bin/echo -e "\t@@@"
124
/bin/echo -e "\t@@@ Building design hierarchy (elaboration)"
125
/bin/echo -e "\t@@@"
126 975 lampret
ncelab -NOTIMINGCHECKS -NOCOPYRIGHT -f ncelab.args > ncelab.out
127
if ($status != 0) then
128 1271 lampret
  /bin/echo -e "\t@@@ FAILED"
129
  /bin/echo -e ""
130 975 lampret
  cat ncelab.out
131
  exit
132
else
133 1271 lampret
  /bin/echo -e "\t@@@ Passed"
134 975 lampret
endif
135
 
136
# Run the NC-Verilog simulator (simulate the design)
137
sim:
138
set i = 0;
139
foreach test ($tests)
140
        @ i += 1;
141 1271 lampret
        /bin/echo -e ""
142
        /bin/echo -e "\t###"
143
        /bin/echo -e "\t### Running test ${i}: ${test}, $maxtimes[$i] ms"
144
        /bin/echo -e "\t###"
145 975 lampret
 
146 1271 lampret
        /bin/echo -e "database -open waves -into ../out/wave/i${iter}-${test} -default" > sim.tcl
147
        /bin/echo -e "probe -create -shm xess_top -all -variables -depth all" >> sim.tcl
148
        /bin/echo -e "probe -create -shm or1200_monitor -all -variables -depth all" >> sim.tcl
149
        /bin/echo -e "stop -create -time $maxtimes[$i]ms -relative" >> sim.tcl
150
        /bin/echo -e "run" >> sim.tcl
151
        /bin/echo -e "quit" >> sim.tcl
152 975 lampret
 
153
        cp ../src/${test}.hex ../src/flash.in
154
        ncsim -NOCOPYRIGHT -f ncsim.args > ncsim.out
155
        if ($status != 0) then
156
          cat ncsim.out
157
          exit
158
        else
159
          set magic=`grep report general.log | tail -1 | cut -d'(' -f2 | cut -d')' -f1 | cut -d' ' -f1`
160
          set magictime=`tail -1 general.log | cut -d'n' -f1`
161
          if ($magic == "deaddead") then
162 1271 lampret
                /bin/echo -e "\t### Passed (@time $magictime)"
163 975 lampret
                @ all_tests += 1;
164
          else
165 1271 lampret
                /bin/echo -e "\t### FAILED (@time $magictime, magic# 0x$magic)"
166
                /bin/echo ../log/i${iter}-${test}-general.log:
167 975 lampret
                cat general.log
168
                @ failed += 1;
169
                @ all_tests += 1;
170
          endif
171
          mv flash.log ../log/i${iter}-${test}-flash.log
172
          mv executed.log ../log/i${iter}-${test}-executed.log
173
          mv sram.log ../log/i${iter}-${test}-sram.log
174
          mv sprs.log ../log/i${iter}-${test}-sprs.log
175
          mv general.log ../log/i${iter}-${test}-general.log
176
          mv lookup.log ../log/i${iter}-${test}-lookup.log
177
        endif
178
end
179
 
180
@ iter += 1;
181
if ($iterations[$iter] != "") then
182
        goto iteration
183
else
184 1271 lampret
        /bin/echo -e ""
185
        /bin/echo -e "<<<"
186
        /bin/echo -e "<<< End of Regression Iterations"
187
        /bin/echo -e "<<<"
188
        /bin/echo -e "<<< Failed $failed out of $all_tests"
189
        /bin/echo -e "<<<"
190 975 lampret
endif

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.