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

Subversion Repositories mac_layer_switch

[/] [mac_layer_switch/] [trunk/] [sim/] [rtl_sim/] [ncsim_sim/] [run/] [run_eth_sim_regr.scr] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ranm11
#!/bin/csh -f
2
 
3
set arg_num = $#argv; # number of arguments
4
 
5
# current iterration
6
set iter = 1;
7
# number of tests with DEFINES + test with user defined constants!
8
set all_iterations = 3;
9
# ATS (Automatic Test System) parameter, which causes displaying 'OK'
10
# if all testcases finish OK.
11
set ok = 1;
12
 
13
# Process argument
14
set i = 1;
15
set arg_waves = 0;
16
set arg_regression = 0;
17
 
18
 
19
if ($arg_num == 0) then
20
            echo "    Verification without any parameter !"
21
else
22
  while ($i <= $arg_num);
23
    if (("$argv[$i]" == "waves") | ("$argv[$i]" == "-w")) then
24
            @ arg_waves = 1;
25
            echo "    Verification with parameter : waves !"
26
    else
27
      if (("$argv[$i]" == "regression") | ("$argv[$i]" == "-r")) then
28
            @ arg_regression = 1;
29
            echo "    Verification with parameter : regression !"
30
      else
31
            echo "    Not correct parameter ( $i )"
32
            echo "    Correct parameters are:"
33
            echo "      'waves' or '-w'"
34
            echo "      'regression' or '-r'"
35
            exit
36
      endif
37
    endif
38
    @ i = $i + 1;
39
  end
40
endif
41
 
42
 
43
#   if ($arg_num == 1) then
44
#     if (("$1" == "waves") | ("$1" == "-w")) then
45
#             @ arg_waves = 1;
46
#             echo "    Verification with parameter : waves !"
47
#     else
48
#       if (("$1" == "regression") | ("$1" == "-r")) then
49
#             @ arg_regression = 1;
50
#             echo "    Verification with parameter : regression !"
51
#       else
52
#             echo "    Not correct parameter ( $1 )"
53
#             echo "    Correct parameters are:"
54
#             echo "      'waves' or '-w'"
55
#             echo "      'regression' or '-r'"
56
#             exit
57
#       endif
58
#     endif
59
#   else
60
#     if ($arg_num == 2) then
61
#       if (("$1" == "waves") | ("$1" == "-w")) then
62
#             @ arg_waves = 1;
63
#         if (("$2" == "regression") | ("$2" == "-r")) then
64
#             @ arg_regression = 1;
65
#             echo "    Verification with parameter : waves, regression !"
66
#         else
67
#             echo "    Not correct parameter ( $2 )"
68
#             echo "    Correct 2. parameter is:"
69
#             echo "      'regression' or '-r'"
70
#             exit
71
#         endif
72
#       else
73
#         if (("$1" == "regression") | ("$1" == "-r")) then
74
#             @ arg_regression = 1;
75
#           if (("$2" == "waves") | ("$2" == "-w")) then
76
#             @ arg_waves = 1;
77
#             echo "    Verification with parameter : waves, regression !"
78
#           else
79
#             echo "    Not correct parameter ( $2 )"
80
#             echo "    Correct 2. parameter is:"
81
#             echo "      'waves' or '-w'"
82
#             exit
83
#           endif
84
#         else
85
#             echo "    Not correct parameter ( $1 )"
86
#             echo "    Correct parameters are:"
87
#             echo "      'waves' or '-w'"
88
#             echo "      'regression' or '-r'"
89
#             exit
90
#         endif
91
#       endif
92
#     else
93
#             echo "    Too many parameters ( $arg_num )"
94
#             echo "    Maximum number of parameters is 2:"
95
#             echo "      'waves' or '-w'"
96
#             echo "      'regression' or '-r'"
97
#             exit
98
#     endif
99
#   endif
100
# endif
101
 
102
echo ""
103
echo "<<<"
104
echo "<<< Ethernet MAC VERIFICATION "
105
echo "<<<"
106
 
107
# ITERATION LOOP
108
iteration:
109
 
110
echo ""
111
echo "<<<"
112
echo "<<< Iteration ${iter}"
113
echo "<<<"
114
 
115
if ($arg_regression == 1) then
116
  if ($iter <= $all_iterations) then
117
    if ($iter == 1) then
118
        echo "<<< Defines:"
119
        echo "\tEthernet with GENERIC RAM"
120
        echo "-DEFINE REGR" > ./defines.args
121
    endif
122
    if ($iter == 2) then
123
        echo "<<< Defines:"
124
        echo "\tEthernet with XILINX DISTRIBUTED RAM"
125
        echo "-DEFINE REGR -DEFINE ETH_FIFO_XILINX" > ./defines.args
126
    endif
127
    if ($iter == 3) then
128
        echo "<<< Defines:"
129
        echo "\tEthernet with XILINX BLOCK RAM"
130
        echo "-DEFINE REGR -DEFINE XILINX_RAMB4" > ./defines.args
131
    endif
132
  endif
133
endif
134
 
135
# Run NC-Verilog compiler
136
echo ""
137
echo "\t@@@"
138
echo "\t@@@ Compiling sources"
139
echo "\t@@@"
140
 
141
# creating .args file for ncvlog and adding main parameters
142
echo "-cdslib ../bin/cds.lib" > ./ncvlog.args
143
echo "-hdlvar ../bin/hdl.var" >> ./ncvlog.args
144
echo "-logfile ../log/ncvlog.log" >> ./ncvlog.args
145
echo "-update" >> ./ncvlog.args
146
echo "-messages" >> ./ncvlog.args
147
echo "-INCDIR ../../../../bench/verilog" >> ./ncvlog.args
148
echo "-INCDIR ../../../../rtl/verilog" >> ./ncvlog.args
149
echo "-DEFINE SIM" >> ./ncvlog.args
150
# adding defines to .args file
151
if ($arg_regression == 1) then
152
    cat ./defines.args >> ./ncvlog.args
153
endif
154
# adding RTL and Sim files to .args file
155
cat ../bin/rtl_file_list.lst >> ./ncvlog.args
156
cat ../bin/sim_file_list.lst >> ./ncvlog.args
157
# adding device dependent files to .args file
158
cat ../bin/xilinx_file_list.lst >> ./ncvlog.args
159
cat ../bin/artisan_file_list.lst >> ./ncvlog.args
160
 
161
ncvlog -file ./ncvlog.args# > /dev/null;
162
echo ""
163
 
164
 
165
# Run the NC-Verilog elaborator (build the design hierarchy)
166
echo ""
167
echo "\t@@@"
168
echo "\t@@@ Building design hierarchy (elaboration)"
169
echo "\t@@@"
170
ncelab -file ../bin/ncelab_xilinx.args# > /dev/null;
171
echo ""
172
 
173
 
174
# Run the NC-Verilog simulator (simulate the design)
175
echo ""
176
echo "\t###"
177
echo "\t### Running tests (this takes a long time!)"
178
echo "\t###"
179
 
180
# creating ncsim.args file for ncsim and adding main parameters
181
echo "-cdslib ../bin/cds.lib" > ./ncsim.args
182
echo "-hdlvar ../bin/hdl.var" >> ./ncsim.args
183
echo "-logfile ../log/ncsim.log" >> ./ncsim.args
184
echo "-messages" >> ./ncsim.args
185
if ($arg_waves == 1) then
186
  echo "-input ../bin/ncsim_waves.rc" >> ./ncsim.args
187
else
188
  echo "-input ../bin/ncsim.rc" >> ./ncsim.args
189
endif
190
echo "worklib.ethernet:fun" >> ./ncsim.args
191
 
192
ncsim -file ./ncsim.args > ../log/tb_eth_display.log #| tee ../log/tb_eth_display.log
193
if ($status != 0) then
194
  echo ""
195
  echo "TESTS couldn't start due to Errors!"
196
  echo ""
197
  exit
198
else
199
  if ($arg_regression == 1) then
200
    if ($arg_waves == 1) then
201
      mv ../out/waves.shm ../out/i${iter}_waves.shm
202
    endif
203
    # For ATS - counting all 'FAILED' words
204
    set FAIL_COUNT = `grep -c "FAILED" ../log/eth_tb.log`
205
    if ($FAIL_COUNT != 0) then
206
        # Test didn't pass!!!
207
        @ ok = 0;
208
    endif
209
    # Move 'log' files
210
    mv ../log/eth_tb.log ../log/i${iter}_eth_tb.log
211
    mv ../log/eth_tb_phy.log ../log/i${iter}_eth_tb_phy.log
212
    mv ../log/eth_tb_memory.log ../log/i${iter}_eth_tb_memory.log
213
    mv ../log/eth_tb_host.log ../log/i${iter}_eth_tb_host.log
214
    mv ../log/eth_tb_wb_s_mon.log ../log/i${iter}_eth_tb_wb_s_mon.log
215
    mv ../log/eth_tb_wb_m_mon.log ../log/i${iter}_eth_tb_wb_m_mon.log
216
  endif
217
endif
218
echo ""
219
 
220
@ iter += 1;
221
 
222
if (($arg_regression == 1) && ($iter <= $all_iterations)) then
223
    goto iteration
224
else
225
#   rm ./defines.args
226
    echo ""
227
    echo "<<<"
228
    echo "<<< End of VERIFICATION"
229
    echo "<<<"
230
    echo "<<<"
231
    echo "<<< -------------------------------------------------"
232
    echo "<<<"
233
    # For ATS - displaying 'OK' when tests pass successfuly
234
    echo " "
235
    echo "Simulation finished:"
236
    if ($ok == 1) then
237
        echo "OK"
238
    else
239
        echo "FAILED"
240
    endif
241
endif
242
 

powered by: WebSVN 2.1.0

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