This repository contains programs used to build and demonstrate vector assembly functions by running both Neural Network(NN) functions and vector functions on a testbench. The vector assembly functions are coded directly into a .S assembly file which is then included in the build process for the NN_algorithms which contain the testbench, NN functions and vector functions. Vector assembly uses the RISC-V v0.8 'V' extension and is compiled by using the rvv-0.8.x toolchain and can be simulated by using the RISC-V simulator Spike that is compatible with the v0.8 vector extension.
The three programs are:
- NN_algorithms - This contains pure C implementation if NN functions and vector functions
- NN_algorithms_vector_assembly - This contains the base implementation of the vector assembly functions
- NN_algorithms_vector_assembly-Optimized-cv32e40p - This contains the optimized vector assembly functions and NN functions
Each program contains the following:
- src - Contains NN functions, vector function and the testbench called NN_algorithms_testbench which contains the main() function
- riscV_build - This directory is used for build process for RISC-V and contains the makefile that does this build
- make_lib_riscv.sh - Script that extracts necessary library files for RISC-V compilation from core-v-verif
How to build programs: Navigate to the riscV_build directory and run following commands for makefile.
- make - Build project to produce hex file for verilator
- make lib - Obtains nessccary files for compilation and store them in local \lib directory
- make spike - Build elf file that is compatible for spike, then run this elf file on spike, can pass flags to spike by using:
make spike flags+="<flags for spike>"
- make verilator - Build hex file for verilator and then run hex file on verilator
- make analyze_assembly - Performs objdump on elf file for spike, produces two text files containing; assembly contents of elf file and intermix of source code and disassembly
- make all - Performs all above operations
- make clean - Cleans project
- make full_clean - Removes all build files, directories and log files generated by simulators