ASE simulation fixes + docs update

This commit is contained in:
Blaise Tine 2024-08-17 04:55:32 -07:00
parent 8fe02093e2
commit 1f43d4a2fc
4 changed files with 53 additions and 31 deletions

View file

@ -34,7 +34,7 @@ The hardware configuration file `/hw/rtl/VX_config.vh` defines all the hardware
- `NUM_THREADS`: Number of threads per warps
- `PERF_ENABLE`: enable the use of all profile counters
You configure the syntesis build from the command line:
You can configure the synthesis build from the command line:
$ CONFIGS="-DPERF_ENABLE -DNUM_THREADS=8" make
@ -43,7 +43,7 @@ OPAE Build Progress
You could check the last 10 lines in the build log for possible errors until build completion.
$ tail -n 10 <build_dir>/build.log
$ tail -n 10 <build_dir>/synth/build.log
Check if the build is still running by looking for quartus_sh, quartus_syn, or quartus_fit programs.
@ -70,10 +70,23 @@ Sample FPGA Run Test
Ensure you have the correct opae runtime for the FPGA target
$ make -C runtime/opae clean
$ TARGET=FPGA make -C runtime/opae
Run the following from your Vortex build directory
$ TARGET=fpga ./ci/blackbox.sh --driver=opae --app=sgemm --args="-n128"
Testing OPAE Synthesis using Intel ASE Simulation
-------------------------------------------------
Building ASE synthesis
$ TARGET=asesim make -C runtime/opae
Building ASE runtime
$ TARGET=asesim make -C runtime/opae
Running ASE simulation
$ ASE_LOG=0 ASE_WORKDIR=<build_dir>/synth/work TARGET=asesim ./ci/blackbox.sh --driver=opae --app=sgemm --args="-n16"

View file

@ -10,10 +10,10 @@ cd build_fpga && qsub-synth
# check last 10 lines in build log for possible errors
tail -n 10 ./build_arria10_fpga_1c/build.log
# Check if the job is submitted to the queue and running. Status should be R
# Check if the job is submitted to the queue and running. Status should be R
qstat | grep <user>
# Constantly monitoring the job submitted to the queue. Stop this using Ctrl+C
# Constantly monitoring the job submitted to the queue. Stop this using Ctrl+C
watch qstat | grep <user>
#
@ -35,7 +35,7 @@ fpgaconf --bus 0xaf <build>/synth/vortex_afu.gbs
# get portid
fpgainfo port
# Running the Test case
# Running the Test case
cd /driver/tests/basic
make run-fpga
@ -54,13 +54,9 @@ TARGET=asesim make -C runtime/opae
PREFIX=build_base CONFIGS="-DEXT_F_DISABLE -DL1_DISABLE -DSM_DISABLE -DNUM_WARPS=2 -DNUM_THREADS=2" TARGET=asesim make
# ASE test runs
./run_ase.sh build_base_arria10_asesim_1c ../../../../tests/regression/basic/basic -n1 -t0
./run_ase.sh build_base_arria10_asesim_1c ../../../../tests/regression/basic/basic -n1 -t1
./run_ase.sh build_base_arria10_asesim_1c ../../../../tests/regression/basic/basic -n16
./run_ase.sh build_base_arria10_asesim_1c ../../../../tests/regression/demo/demo -n16
./run_ase.sh build_base_arria10_asesim_1c ../../../../tests/regression/dogfood/dogfood -n16
./run_ase.sh build_base_arria10_asesim_1c ../../../../tests/opencl/vecadd/vecadd
./run_ase.sh build_base_arria10_asesim_1c ../../../../tests/opencl/sgemm/sgemm -n4
start_ase.sh <build_dir>
ASE_LOG=0 ASE_WORKDIR=<build_dir>/synth/work TARGET=asesim ./ci/blackbox.sh --driver=opae --app=vecadd
stop_ase.sh <build_dir>
# modify "vsim_run.tcl" to dump VCD trace
vcd file trace.vcd

View file

@ -17,12 +17,6 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BUILD_DIR=$(realpath $1)
PROGRAM=$(basename "$2")
PROGRAM_DIR=`dirname $2`
POCL_PATH=$TOOLDIR/pocl
VORTEX_RT_PATH=$SCRIPT_DIR/../../../../runtime
# Export ASE_WORKDIR variable
export ASE_WORKDIR=$BUILD_DIR/synth/work
@ -35,7 +29,6 @@ rm -f $BUILD_DIR/synth/nohup.out
pushd $BUILD_DIR/synth
echo " [DBG] starting ASE simnulator (stdout saved to '$BUILD_DIR/synth/nohup.out')"
setsid make sim &> /dev/null &
SIM_PID=$!
popd
# Wait for simulator readiness
@ -44,14 +37,3 @@ while [ ! -f $ASE_WORKDIR/.ase_ready.pid ]
do
sleep 1
done
# run application
pushd $PROGRAM_DIR
shift 2
echo " [DBG] running ./$PROGRAM $*"
ASE_LOG=0 LD_LIBRARY_PATH=$POCL_PATH/lib:$VORTEX_RT_PATH/opae:$LD_LIBRARY_PATH ./$PROGRAM $*
popd
# stop the simulator (kill process group)
kill -- -$(ps -o pgid= $SIM_PID | grep -o '[0-9]*')
wait $SIM_PID 2> /dev/null

31
hw/syn/altera/opae/stop_ase.sh Executable file
View file

@ -0,0 +1,31 @@
#!/bin/bash
# Copyright © 2019-2023
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BUILD_DIR=$(realpath $1)
# Export ASE_WORKDIR variable
export ASE_WORKDIR=$BUILD_DIR/synth/work
# stop the simulator (kill process group)
if [ -f "$ASE_WORKDIR/.ase_ready.pid" ]; then
SIM_PID=$(grep '^pid' "$ASE_WORKDIR/.ase_ready.pid" | cut -d'=' -f2 | tr -d ' ')
echo " [DBG] stopping ASE simulator (pid=$SIM_PID)"
kill -- -$(ps -o pgid= $SIM_PID | grep -o '[0-9]*')
wait $SIM_PID 2> /dev/null
else
echo "ASE PID file does not exist."
fi