Skip to content

Latest commit

 

History

History
97 lines (54 loc) · 2.01 KB

README.md

File metadata and controls

97 lines (54 loc) · 2.01 KB

Test Benches -Python

This folder contains the test benches for the following modules:

  1. 2D Convolution
  2. Matmul Compute Unit
  3. Matmul DPU Unit
  4. Matmul Sram
  5. Matmul Inmem

TestBench for Matmul DPU Unit

This is the simple script that generate matrixes of size 4 by 4, for testing Matmul.

Usage:

cd fxmath
pip install fxmath

cd .. & cd matmul_dpu
python mult.py

Details:

Script generates 4 * 4 matrix with random value of max length of 8 bit. The matmul_dpu_tb.txt is basically the file with all the input values of matrix. First 4 lines are of Matrix A, and second 4 lines are of Matrix B and so on.. output_dpu_tb.txt file has the result values after multiplication. Each line has only single 25 bit value.

Each line has 32 bit number, because we want 8 bit number and matrix is 4 * 4 so, 8 * 4 = 32.

TestBench for 2D Convolution

Usage:

cd fxmath
pip install fxmath

cd .. & cd conv2D
python conv.py

Details:

TestBench for Matmul Compute Unit

This script is used to test the matmul compute unit. It generates random matrixes of size 4 by 4 and then multiplies them. The result is then compared with the result generated by the matmul compute unit. The 'mat_A.txt' and 'mat_B.txt' contains the 4 * 4 input matrixes.

Usage:

cd fxmath
pip install fxmath
cd .. & cd matmul_computeUnit
python main.py -genInput=1 

Now run the vivado simulation and make sure the 'results.txt' file from vivado/matmul compute unit is in same folder and than run following command

python main.py -compRes=1

TestBench for Matmul SRAM & INMEM Unit

This script is used to test the matmul SRAM & INMEM unit. just need to give the input and output files it will compare both and find erros if there

Usage:

cd fxmath
pip install fxmath
cd .. & cd mm_inmem

Now run the vivado simulation and make sure the 'results.txt' file from vivado/matmul compute unit is in same folder and than run following command

python main.py -compRes=1