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

Subversion Repositories openhmc

[/] [openhmc/] [trunk/] [openHMC/] [sim/] [tb/] [run/] [run_files/] [run.sh] - Blame information for rev 15

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 juko
#
2
#                              .--------------. .----------------. .------------.
3
#                             | .------------. | .--------------. | .----------. |
4
#                             | | ____  ____ | | | ____    ____ | | |   ______ | |
5
#                             | ||_   ||   _|| | ||_   \  /   _|| | | .' ___  || |
6
#       ___  _ __   ___ _ __  | |  | |__| |  | | |  |   \/   |  | | |/ .'   \_|| |
7
#      / _ \| '_ \ / _ \ '_ \ | |  |  __  |  | | |  | |\  /| |  | | || |       | |
8
#       (_) | |_) |  __/ | | || | _| |  | |_ | | | _| |_\/_| |_ | | |\ `.___.'\| |
9
#      \___/| .__/ \___|_| |_|| ||____||____|| | ||_____||_____|| | | `._____.'| |
10
#           | |               | |            | | |              | | |          | |
11
#           |_|               | '------------' | '--------------' | '----------' |
12
#                              '--------------' '----------------' '------------'
13
#
14
#  openHMC - An Open Source Hybrid Memory Cube Controller
15
#  (C) Copyright 2014 Computer Architecture Group - University of Heidelberg
16
#  www.ziti.uni-heidelberg.de
17
#  B6, 26
18
#  68159 Mannheim
19
#  Germany
20
#
21
#  Contact: openhmc@ziti.uni-heidelberg.de
22
#  http://ra.ziti.uni-heidelberg.de/openhmc
23
#
24
#   This source file is free software: you can redistribute it and/or modify
25
#   it under the terms of the GNU Lesser General Public License as published by
26
#   the Free Software Foundation, either version 3 of the License, or
27
#   (at your option) any later version.
28
#
29
#   This source file is distributed in the hope that it will be useful,
30
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
31
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32
#   GNU Lesser General Public License for more details.
33
#
34
#   You should have received a copy of the GNU Lesser General Public License
35
#   along with this source file.  If not, see <http://www.gnu.org/licenses/>.
36
#
37
#
38
 
39
#!/bin/bash
40
 
41
function print_help {
42 15 juko
        printf "Usage: %s: [-c] [-d DUT] [-f FPW] [-g] [-l NUM_LANES] [-o] [-q] [-a] [-r] [-s SEED] [-t TEST_NAME] [-v UVM_VERBOSITY] -?\n" $(basename $0) >&2
43 12 juko
}
44
 
45
#-----------------------------------------------------------------
46
# set defaults
47
if [ ! $CAG_DUT ]
48
then
49
        CAG_DUT="default"
50
fi
51
 
52
#-- Controller params
53
num_lanes="default"
54
log_num_lanes="3"
55
fpw="default"
56
log_fpw="2"
57 15 juko
num_axi_bytes="64"
58
open_rsp="0"
59
async_fifos="0"
60 12 juko
 
61
do_clean_up=
62
tflag="0"
63
dflag="0"
64
test_name=
65
verbosity="UVM_LOW"
66
use_gui=
67
input_file="-input ${CAG_TB_DIR}/build/ncsim.tcl"
68
seed=""
69
enable_coverage=""
70
 
71
 
72
#-- parse options
73 15 juko
while getopts 'acgort:v:d:s:l:f:q?' OPTION
74 12 juko
do
75
        case $OPTION in
76 15 juko
                a)  async_fifos="1"
77
                        ;;
78 12 juko
                c)      do_clean_up=1
79
                        ;;
80
                d)      export CAG_DUT=${OPTARG}
81
                        dflag="1"
82
                        ;;
83
                f)  fpw="${OPTARG}"
84
                        ;;
85
                g)      use_gui="+gui"
86
                        ;;
87
                l)      num_lanes="${OPTARG}"
88
                        ;;
89 15 juko
                o)      enable_coverage="-coverage all -covoverwrite"
90
                        ;;
91
                q)      input_file=""
92
                        verbosity="UVM_NONE"
93
                        ;;
94
                r)      open_rsp="1"
95
                        ;;
96 12 juko
                s)  seed="+svseed+${OPTARG}"
97
                        ;;
98
                t)      tflag="1"
99
                        test_name="$OPTARG"
100
                        ;;
101
                v)      verbosity="$OPTARG"
102
                        ;;
103
                ?)      print_help
104
                        exit 2
105
                        ;;
106
                esac
107
done
108
shift $(($OPTIND - 1))
109
 
110
printf "****************************************************\n"
111
printf "****************************************************\n"
112
 
113
#-- Set up controller
114
if [ $num_lanes == "default" ]
115
then
116
        printf "No link-width specified. Defaulting to 8 lanes \n"
117
else
118
        if [ $num_lanes != "8" -a $num_lanes != "16" ]
119
        then
120
                printf "Unsupported link-width specified. Defaulting to 8 lanes\n"
121
        else
122
                if [ $num_lanes == "16" ]
123
                then
124
                        log_num_lanes="4"
125
                        export X16
126
                fi
127
                printf "Link width set: $num_lanes lanes\n"
128
        fi
129
fi
130
 
131
if [ $fpw == "default" ]
132
then
133
        printf "No FPW specified. Defaulting to FPW=4 (512bit datapath)\n"
134
        fpw="4"
135
else
136
        if [ $fpw != "2" -a $fpw != "4" -a $fpw != "6" -a $fpw != "8" ]
137
        then
138
                printf "Unsupported FPW specified. Defaulting to FPW=4 (512bit datapath)\n"
139
                fpw="4"
140
        else
141
                printf "FPW set: $fpw\n"
142
                case $fpw in
143
                        2)
144
                        log_fpw="1"
145
                        num_axi_bytes="32"
146
                        ;;
147
                        4)
148
                        log_fpw="2"
149
                        ;;
150
                        6)
151
                        log_fpw="3"
152
                        num_axi_bytes="96"
153
                        ;;
154
                        8)
155
                        log_fpw="3"
156
                        num_axi_bytes="128"
157
                        ;;
158
                esac
159
        fi
160
fi
161
 
162
#-- check test
163
if [ "$tflag" == "0" ]
164
then
165
        printf "Test defaulted to simple_test.\n"
166
        test_name="simple_test"
167
fi
168
 
169 15 juko
#-- Open Response
170
if [ "$open_rsp" == "1" ]
171
then
172
        printf "*** OPEN RESPONSE LOOP MODE ***\n"
173
fi
174
 
175
#-- Async FIFOs
176
if [ "$open_rsp" == "1" ]
177
then
178
        printf "*** Using Asynchronous FIFOs ***\n"
179
fi
180
 
181 12 juko
#-- select DUT
182
if [ "$dflag" == "0" ]
183
then
184
        printf "DUT is default: ${CAG_DUT}\n"
185
else
186
        echo "DUT used: ${CAG_DUT}"
187
fi
188
CAG_TB_COMPILE_IUS="${CAG_TB_DIR}/build/compile_ius_${CAG_DUT}.f"
189
 
190
printf "****************************************************\n"
191
printf "****************************************************\n"
192
 
193
#-- do some clean up
194
if [ "$do_clean_up" ]
195
then
196
        echo "Removing old build files..."
197
        ${CAG_TB_DIR}/../run/clean_up.sh
198
fi
199
 
200
#-- all other stuff
201
echo "Starting the verification environment..."
202
irun ${input_file} \
203
        -f ${CAG_TB_COMPILE_IUS} \
204
        ${enable_coverage} \
205
        -access +rwc \
206 15 juko
        "-define OPEN_RSP_MODE=$open_rsp" \
207
        "-define OPENHMC_ASYNC_FIFOS=$async_fifos" \
208
        -timescale 1ns/1ps \
209 12 juko
        ${use_gui} "+UVM_TESTNAME=${test_name}" "+UVM_VERBOSITY=${verbosity}" ${seed} \
210
        "-define LOG_NUM_LANES=$log_num_lanes -define FPW=$fpw -define LOG_FPW=$log_fpw -define AXI4BYTES=$num_axi_bytes" $*

powered by: WebSVN 2.1.0

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