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

Subversion Repositories ethmac

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

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

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

powered by: WebSVN 2.1.0

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