Merge remote-tracking branch 'origin/master' into graphics

This commit is contained in:
Blaise Tine 2021-04-04 23:48:31 -07:00
commit d38d512d42
4 changed files with 38 additions and 24 deletions

View file

@ -5,16 +5,19 @@ Description: Makes the build in the opae directory with the specified core
exists, a make clean command is ran before the build. Script waits
until the inteldev script or quartus program is finished running.
Usage: ./build.sh -c [1|2|4|8|16] [-p [y|n]]
Usage: ./build.sh -c [1|2|4|8|16] [-p perf] [-w wait]
Options:
-c
Core count (1, 2, 4, 8, or 16).
-p
Performance profiling enable (y or n). Changes the source file in the
Performance profiling enable. Changes the source file in the
opae directory to include/exclude "+define+PERF_ENABLE".
-w
Wait for the build to complete
_______________________________________________________________________________

View file

@ -1,10 +1,23 @@
#!/bin/bash
while getopts c:p: flag
BUILD_DIR=../../hw/syn/opae
perf=0
wait=0
while getopts c:pwh flag
do
case "${flag}" in
c) cores=${OPTARG};; #1, 2, 4, 8, 16
p) perf=${OPTARG};; #perf counters enable (y/n)
p) perf=1;; #perf counters enable
w) wait=1;; # wait for build to complete
h) echo "Usage: -c <cores> [-p perf] [-w wait] [-h help]"
exit 0
;;
\?)
echo "Invalid option: -$OPTARG" 1>&2
exit 1
;;
esac
done
@ -13,25 +26,22 @@ if [[ ! "$cores" =~ ^(1|2|4|8|16)$ ]]; then
exit 1
fi
cd ../../hw/syn/opae
cd ${BUILD_DIR}
sources_file="./sources_${cores}c.txt"
if [ ${perf:0:1} = "n" ]; then
if grep -v '^ *#' ${sources_file} | grep -Fxq '+define+SYNTHESIS'; then
sed -i 's/+define+PERF_ENABLE/#+define+PERF_ENABLE/' ${sources_file}
elif ! grep -Fxq '#+define+PERF_ENABLE' ${sources_file}; then
sed -i '1s/^/#+define+PERF_ENABLE\n/' ${sources_file}
fi
elif [ ${perf:0:1} = "y" ]; then
if [ ${perf} = 1 ]; then
if grep -Fxq '#+define+PERF_ENABLE' ${sources_file}; then
sed -i 's/+define+PERF_ENABLE/#+define+PERF_ENABLE/' ${sources_file}
elif ! grep -Fxq '+define+PERF_ENABLE' ${sources_file}; then
sed -i '1s/^/+define+PERF_ENABLE\n/' ${sources_file}
fi
else
echo 'Invalid parameter for argument -p (y/n expected)'
exit 1
if grep -v '^ *#' ${sources_file} | grep -Fxq '+define+SYNTHESIS'; then
sed -i 's/+define+PERF_ENABLE/#+define+PERF_ENABLE/' ${sources_file}
elif ! grep -Fxq '#+define+PERF_ENABLE' ${sources_file}; then
sed -i '1s/^/#+define+PERF_ENABLE\n/' ${sources_file}
fi
fi
if [ -d "./build_fpga_{$cores}c" ]; then
@ -39,12 +49,12 @@ if [ -d "./build_fpga_{$cores}c" ]; then
fi
make "fpga-${cores}c"
sleep 30
pids=($(pgrep -f "${OPAE_PLATFORM_ROOT}|quartus"))
for pid in ${pids[@]}; do
while kill -0 ${pid} 2> /dev/null; do
sleep 30
if [ ${wait} = 1 ]; then
sleep 30
pids=($(pgrep -f "${OPAE_PLATFORM_ROOT}|quartus"))
for pid in ${pids[@]}; do
while kill -0 ${pid} 2> /dev/null; do
sleep 30
done
done
done
fi

View file

@ -2,6 +2,6 @@
for ((i=1; i <= 16; i=i*2)); do
echo "Building ${i} core build..."
./build.sh -c ${i} -p y
./build.sh -c ${i} -p -w
echo "Done ${i} core build."
done

View file

@ -487,7 +487,8 @@ module VX_bank #(
end
VX_skid_buffer #(
.DATAW (CORE_TAG_WIDTH + (1 + `WORD_WIDTH + `REQS_BITS) * NUM_PORTS)
.DATAW (CORE_TAG_WIDTH + (1 + `WORD_WIDTH + `REQS_BITS) * NUM_PORTS),
.BUFFERED (NUM_BANKS == 1)
) core_rsp_req (
.clk (clk),
.reset (reset),