-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathint_param_check.sh
executable file
·48 lines (40 loc) · 1.9 KB
/
int_param_check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#! /usr/bin/env bash
run_iverilog() {
gcc -shared -fPIC int_param_check.c -Wall -Werror -o int_param_check.vpi
iverilog -g2012 -o int_param_check int_param_check.sv
vvp -M . -m int_param_check int_param_check
}
run_questa() {
gcc -shared -fPIC int_param_check.c -Wall -Werror -o int_param_check.so
vlib int_param_check_lib
vlog -work int_param_check_lib -sv int_param_check.sv
vsim -c +access -onfinish exit -pli int_param_check.so -lib int_param_check_lib t -do "run -all; quit"
}
run_riviera() {
gcc -shared -fPIC int_param_check.c -Wall -Werror -o int_param_check.so
vlib int_param_check_lib
vlog -work int_param_check_lib -pli int_param_check.so -sv int_param_check.sv
vsim -c +access -interceptcoutput -pli int_param_check.so -lib int_param_check_lib t -do "run -all; endsim; quit"
}
run_verilator() {
gcc -shared -fPIC int_param_check.c -Wall -Werror -o libvpi.so -DVERILATOR
verilator -cc --exe -Mdir verilator_build --top-module t --timing --vpi --public-flat-rw --prefix Vtop -o Vtop -LDFLAGS "-Wl,-rpath,$(pwd) -L$(pwd) -lvpi" int_param_check.sv verilator.cpp
make -C verilator_build -f Vtop.mk
verilator_build/Vtop
}
run_xcelium() {
mkdir -p build/xrun_snapshot
gcc -shared -fPIC int_param_check.c -Wall -Werror -o int_param_check.so
xrun -64bit -licqueue -clean -access +rwc -loadvpi "$(pwd)/int_param_check.so:vlog_startup_routines_bootstrap" -messages -status -gverbose -pliverbose -plidebug -plierr_verbose -work int_param_check_lib -top t int_param_check.sv
}
set -e
SIM=$1
case "$SIM" in
"iverilog") run_iverilog;;
"questa") run_questa;;
"riviera") run_riviera;;
"verilator") run_verilator;;
"xcelium") run_xcelium;;
"") echo "Supported simulators: iverilog questa riviera verilator xcelium"; exit 0;;
*) echo "Invalid simulator '$SIM'. Supported simulators: iverilog questa riviera verilator xcelium"; exit 1;;
esac