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 12

Go to most recent revision | 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
        printf "Usage: %s: [-c] [-d DUT] [-f FPW] [-g] [-l NUM_LANES] [o] [-q] [-p] [-s SEED] [-t TEST_NAME] [-v UVM_VERBOSITY] -?\n" $(basename $0) >&2
43
}
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
 
58
do_clean_up=
59
tflag="0"
60
dflag="0"
61
test_name=
62
verbosity="UVM_LOW"
63
use_gui=
64
input_file="-input ${CAG_TB_DIR}/build/ncsim.tcl"
65
seed=""
66
num_axi_bytes="64"
67
enable_coverage=""
68
 
69
 
70
#-- parse options
71
while getopts 'cgot:v:d:s:l:f:q?' OPTION
72
do
73
        case $OPTION in
74
                c)      do_clean_up=1
75
                        ;;
76
                d)      export CAG_DUT=${OPTARG}
77
                        dflag="1"
78
                        ;;
79
                f)  fpw="${OPTARG}"
80
                        ;;
81
                g)      use_gui="+gui"
82
                        ;;
83
                l)      num_lanes="${OPTARG}"
84
                        ;;
85
                s)  seed="+svseed+${OPTARG}"
86
                        ;;
87
                t)      tflag="1"
88
                        test_name="$OPTARG"
89
                        ;;
90
                v)      verbosity="$OPTARG"
91
                        ;;
92
                o)      enable_coverage="-coverage all -covoverwrite"
93
                        ;;
94
                q)      input_file=""
95
                        verbosity="UVM_NONE"
96
                        ;;
97
                ?)      print_help
98
                        exit 2
99
                        ;;
100
                esac
101
done
102
shift $(($OPTIND - 1))
103
 
104
printf "****************************************************\n"
105
printf "****************************************************\n"
106
 
107
#-- Set up controller
108
if [ $num_lanes == "default" ]
109
then
110
        printf "No link-width specified. Defaulting to 8 lanes \n"
111
else
112
        if [ $num_lanes != "8" -a $num_lanes != "16" ]
113
        then
114
                printf "Unsupported link-width specified. Defaulting to 8 lanes\n"
115
        else
116
                if [ $num_lanes == "16" ]
117
                then
118
                        log_num_lanes="4"
119
                        export X16
120
                fi
121
                printf "Link width set: $num_lanes lanes\n"
122
        fi
123
fi
124
 
125
if [ $fpw == "default" ]
126
then
127
        printf "No FPW specified. Defaulting to FPW=4 (512bit datapath)\n"
128
        fpw="4"
129
else
130
        if [ $fpw != "2" -a $fpw != "4" -a $fpw != "6" -a $fpw != "8" ]
131
        then
132
                printf "Unsupported FPW specified. Defaulting to FPW=4 (512bit datapath)\n"
133
                fpw="4"
134
        else
135
                printf "FPW set: $fpw\n"
136
                case $fpw in
137
                        2)
138
                        log_fpw="1"
139
                        num_axi_bytes="32"
140
                        ;;
141
                        4)
142
                        log_fpw="2"
143
                        ;;
144
                        6)
145
                        log_fpw="3"
146
                        num_axi_bytes="96"
147
                        ;;
148
                        8)
149
                        log_fpw="3"
150
                        num_axi_bytes="128"
151
                        ;;
152
                esac
153
        fi
154
fi
155
 
156
#-- check test
157
if [ "$tflag" == "0" ]
158
then
159
        printf "Test defaulted to simple_test.\n"
160
        test_name="simple_test"
161
fi
162
 
163
#-- select DUT
164
if [ "$dflag" == "0" ]
165
then
166
        printf "DUT is default: ${CAG_DUT}\n"
167
else
168
        echo "DUT used: ${CAG_DUT}"
169
fi
170
CAG_TB_COMPILE_IUS="${CAG_TB_DIR}/build/compile_ius_${CAG_DUT}.f"
171
 
172
printf "****************************************************\n"
173
printf "****************************************************\n"
174
 
175
#-- do some clean up
176
if [ "$do_clean_up" ]
177
then
178
        echo "Removing old build files..."
179
        ${CAG_TB_DIR}/../run/clean_up.sh
180
fi
181
 
182
#-- all other stuff
183
echo "Starting the verification environment..."
184
irun ${input_file} \
185
        -f ${CAG_TB_COMPILE_IUS} \
186
        ${enable_coverage} \
187
        -access +rwc \
188
        ${use_gui} "+UVM_TESTNAME=${test_name}" "+UVM_VERBOSITY=${verbosity}" ${seed} \
189
        "-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-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.