Repository navigation
Expand file tree
/
Copy pathtest_script.sh
More file actions
executable file
·114 lines (88 loc) · 2.48 KB
/
Copy pathtest_script.sh
File metadata and controls
executable file
·114 lines (88 loc) · 2.48 KB
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
#!/bin/bash
MODULE=system
ASMDIR=asmFiles
TARGETS=$ASMDIR/*
FILES=$1
if [[ $# -le 1 ]]
then
make clean
# Source (No latency)
echo "Source (No Latency)"
sed -i.bak 's/LAT = [0-9]*/LAT = 0/' source/ram.sv
grep "LAT =" source/ram.sv | cut -d ',' -f 2
testasm -c $FILES
# Source (Latency)
echo "Source (Latency)"
sed -i.bak 's/LAT = [0-9]*/LAT = 7/' source/ram.sv
grep "LAT =" source/ram.sv | cut -d ',' -f 2
testasm -c $FILES
# Mapped (No Latency)
echo "Mapped (No Latency)"
sed -i.bak 's/LAT = [0-9]*/LAT = 0/' source/ram.sv
grep "LAT =" source/ram.sv | cut -d ',' -f 2
testasm -s -c $FILES
# Mapped (Latency)
echo "Mapped (Latency)"
sed -i.bak 's/LAT = [0-9]*/LAT = 7/' source/ram.sv
grep "LAT =" source/ram.sv | cut -d ',' -f 2
testasm -s -c $FILES
# Revert ram.sv back to zero latency
sed -i.bak 's/LAT = [0-9]*/LAT = 0/' source/ram.sv
# FPGA
echo "FPGA(No Latency)"
grep "LAT =" source/ram.sv | cut -d ',' -f 2
files1="asmFiles/$FILES*"
count=$(echo $files1 | wc -w)
index=1
for i in asmFiles/$FILES*
do
textOutput="processing file $i ($index of $count)"
echo -n $textOutput
size=$(resize | grep COLUMN - | cut -f2 -d"'")
outputSize=$(echo $textOutput | wc -c)
((padding=size-outputSize-7))
((index=index+1))
asm $i > /dev/null
sim -c > /dev/null
synthesize -m -d system_fpga > /dev/null
printf "%-$(echo $padding)s"
diff memsim.hex memfpga.hex > /dev/null
if [[ $? -ne 0 ]]
then
echo -e "[\e[31m\e[1mFAILED\e[21m\e[0m]"
else
echo -e "[\e[92m\e[1mPASSED\e[21m\e[0m]"
fi
done
make clean
# ram.sv back to higher latency
sed -i.bak 's/LAT = [0-9]*/LAT = 7/' source/ram.sv
grep "LAT =" source/ram.sv | cut -d ',' -f 2
echo "FPGA(Latency)"
files1="asmFiles/$FILES*"
count=$(echo $files1 | wc -w)
index=1
for i in asmFiles/$FILES*
do
textOutput="processing file $i ($index of $count)"
echo -n $textOutput
size=$(resize | grep COLUMN - | cut -f2 -d"'")
outputSize=$(echo $textOutput | wc -c)
((padding=size-outputSize-7))
((index=index+1))
asm $i > /dev/null
sim -c > /dev/null
synthesize -m -d system_fpga > /dev/null
printf "%-$(echo $padding)s"
diff memsim.hex memfpga.hex > /dev/null
if [[ $? -ne 0 ]]
then
echo -e "[\e[31m\e[1mFAILED\e[21m\e[0m]"
else
echo -e "[\e[92m\e[1mPASSED\e[21m\e[0m]"
fi
done
sed -i.bak 's/LAT = [0-9]*/LAT = 0/' source/ram.sv
rm source/ram.sv.bak
exit
fi