-
Notifications
You must be signed in to change notification settings - Fork 25
/
flow.sh
executable file
·142 lines (120 loc) · 3.08 KB
/
flow.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/usr/bin/env bash
# -e: exit if one command fails
# -u: treat unset variable as an error
# -f: disable filename expansion upon seeing *, ?, ...
# -o pipefail: causes a pipeline to fail if any command fails
set -eu -o pipefail
# Current script path; doesn't support symlink
CURDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
ret=0
# Bash color codes
Red='\033[0;31m'
Green='\033[0;32m'
Yellow='\033[0;33m'
Blue='\033[0;34m'
# Reset
NC='\033[0m'
function printerror {
echo -e "${Red}ERROR: ${1}${NC}"
}
function printwarning {
echo -e "${Yellow}WARNING: ${1}${NC}"
}
function printinfo {
echo -e "${Blue}INFO: ${1}${NC}"
}
function printsuccess {
echo -e "${Green}SUCCESS: ${1}${NC}"
}
help() {
echo -e "${Blue}"
echo ""
echo "NAME"
echo ""
echo " AXI4-Crossbar Flow"
echo ""
echo "SYNOPSIS"
echo ""
echo " ./flow.sh -h"
echo ""
echo " ./flow.sh help"
echo ""
echo " ./flow.sh syn"
echo ""
echo " ./flow.sh sim"
echo ""
echo "DESCRIPTION"
echo ""
echo " This flow handles the different operations available"
echo ""
echo " ./flow.sh help|-h"
echo ""
echo " Print the help menu"
echo ""
echo " ./flow.sh syn"
echo ""
echo " Launch the synthesis script relying on Yosys"
echo ""
echo " ./flow.sh sim"
echo ""
echo " Launch all available testsuites"
echo ""
echo -e "${NC}"
}
main() {
echo ""
printinfo "Start AXI4-Crossbar Flow"
# If no argument provided, preint help and exit
if [[ $# -eq 0 ]]; then
help
exit 1
fi
# Print help
if [[ $1 == "-h" || $1 == "help" ]]; then
help
exit 0
fi
if [[ $1 == "lint" ]]; then
set +e
printinfo "Start Verilator lint"
verilator --lint-only +1800-2017ext+sv \
-Wall -Wpedantic -cdc \
-Wno-VARHIDDEN \
-Wno-PINCONNECTEMPTY \
-Wno-TIMESCALEMOD \
-I./rtl\
./rtl/axicb_mst_if.sv\
./rtl/axicb_slv_if.sv\
./rtl/axicb_slv_switch.sv\
./rtl/axicb_pipeline.sv\
./rtl/axicb_mst_switch.sv\
./rtl/axicb_switch_top.sv\
./rtl/axicb_round_robin.sv\
./rtl/axicb_round_robin_core.sv\
./rtl/axicb_crossbar_top.sv\
./rtl/axicb_crossbar_lite_top.sv\
--top-module axicb_crossbar_lite_top
set -e
fi
if [[ $1 == "sim" ]]; then
source script/setup.sh
cd "$CURDIR/test/svut"
./run.sh --no-debug-log --no-vcd
ret=$?
echo "Execution status: $ret"
exit $ret
fi
if [[ $1 == "syn" ]]; then
printinfo "Start synthesis flow"
cd "$CURDIR/syn/yosys"
# AXI4 synthesis
./syn_asic.sh axicb_axi4.ys | tee axi4.log
ret=$?
# AXI4-lite synthesis
./syn_asic.sh axicb_axi4lite.ys | tee axi4lite.log
ret=$((ret+$?))
echo "Execution status: $ret"
exit $ret
fi
}
main "$@"