This tutorial is Makefile based. You can run X86 and AIE simulations. If you want more detailed simulation you can do hardware emulation (hw_emu). You can also run this tutorial on hardware board.
Testbench creation is quite special as this tutorial is designed to evolve towards sparse matrix multiplication. Data is created so that we can ensure that a sparsity level is satisfied for all sub-matrices. Test vectors are created using a Python script that takes multiple parameters:
matrix sizes M, K, N
sub-matrix sizes m, k, n
number of bits of input data (8, 16, 32)
number of iterations in the testbench
required sparsity (1 means full matrix)
data directory: where to store the generated data files
PLIO width: 32, 64 or 128 bit. This allows the testbench generator to format correctly the files
After an AIE or X86 simulation you can compare the simulation output with the reference output. This is done either with make compareaie
or make comparex86
. For sw_emu and hw_emu, the verification is done within the host code.
make clean-all OPT=0 data x86 x86sim comparex86
This will compile simulate and verify the result for the default size matrices using x86 simulation.
make sizeK=128 clean-all OPT=0 data x86 x86sim comparex86
Will do the same thing but with A matrices of size (64,128) and B matrices of size (128,64).
AI Engine simulation can be conducted the same way:
make clean-all OPT=0 data aie aiesim compareaie
Finally for hardware emulation make OPT=0 build_hw_emu
will compile, link and create the package for hardware emulation, and make OPT=0 launch_hw_emu
will run the hardware emulation. make OPT=0 run_hw_emu
will chain the two previous commands.