blob: 2bc9d58cb98c66eff37fc11e58b3d5713e338b77 (
plain)
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
|
#!@BASH@
if [[ ! $# -eq 4 ]]; then
echo "Usage: $0 uhd_fpga_dir test_device makefile_dir test_target"
echo ""
echo "Arguments:"
echo "- uhd_fpga_dir: Path to fpga repository (without usrp3/top)"
echo "- test_device: Device used for testing (e.g. x300, n3xx, e320)"
echo "- makefile_dir: Path to the directory with the testbench Makefile"
echo "- test_target: Test target (xsim, vsim)"
exit 0
fi
uhd_fpga_dir=$1
uhd_fpga_dir_top=$uhd_fpga_dir/usrp3/top
test_device=$2
test_target=$4
makefile_dir=$3
# Clear $# and pos args so setupenv.sh doesn't freak out
shift
shift
shift
shift
# Need to convert device types to directory names
device_dir=$test_device
if [ $device_dir == "x310" ]; then
device_dir=x300
fi
if [ $device_dir == "n300" ]; then
device_dir=n3xx
fi
if [ $device_dir == "n310" ]; then
device_dir=n3xx
fi
if [ $device_dir == "n320" ]; then
device_dir=n3xx
fi
if [ $device_dir == "e310" ]; then
device_dir=e31x
fi
if [ $device_dir == "x410" ]; then
device_dir=x400
fi
# Now check the paths are valid
if [ ! -r $uhd_fpga_dir_top/Makefile.common ]; then
echo "ERROR! '${uhd_fpga_dir_top}' is not a valid top-level FPGA directory."
exit 1
fi
device_dir=$uhd_fpga_dir_top/$device_dir
if [ ! -r $device_dir/setupenv.sh ]; then
echo "ERROR! '${test_device}' is not a valid USRP device."
exit 1
fi
echo "Using device directory: $device_dir"
if [ ! -r $makefile_dir/Makefile ]; then
echo "ERROR! '${makefile_dir}' does not point to an RFNoC block."
exit 1
fi
# Check the Makefile actually contains a testbench target
if ! grep -q viv_simulator.mak $makefile_dir/Makefile; then
echo "ERROR! '${makefile_dir}/Makefile' does not contain a test target!."
exit 1
fi
# Load environment
echo "Loading environment from: '$device_dir/setupenv.sh'"
source $device_dir/setupenv.sh
# And, go
make -C $makefile_dir $test_target UHD_FPGA_DIR=$uhd_fpga_dir || exit 1
|