blob: 07ad8c7ded981c57c85248f2c1ecb9f2da11be36 [file] [log] [blame] [view]
Cindy Liub4929142023-10-20 11:36:04 -07001# Springbok SW Repository
2
3This project hosts SW programs for RISC-V 32-bit baremetal machine with vector
4extension (Springbok). It provides the BSP to build the SW artifacts to run on
5Springbok.
6
7## Prerequisite
8
9If you get this project from a repo manifest, you are all set. If not,
10you need to have following projects as well to build the project successfully.
11
12* [PigWeed](https://opensecura.googlesource.com/3p/google/pigweed) repository.
13 It needs to be placed at `<dir>/sw/pigweed`.
14* RISC-V 32-bit crosscompile LLVM toolchain. It needs to be placed at
15 `<dir>/cache/toolchain_iree_rv32imf`
16
17This project needs to be at `<dir>/sw/vec`.
18
19## Code structure
20
21-*cmake*: CMake macros and cross compile toolchain setup
22-*scripts*: Helper scripts to generate and run the tests
23-*softrvv*: scalar mockup for the RVV instructions
24-*springbok*: BSP for the core, including the starting assembly, linker script,
25and gloss library support
26-*tests*: RVV instruction unit tests
27
28## Build the project
29
30If you get this project from repo manifest, you can build the artifacts with `m
31springbok`.
32If you download this project alone, you need to run the following from the
33top-level directory
34
35```bash
36 cmake -B <output dir> -G Ninja \
37 -DRISCV_TOOLCHAIN_ROOT=$(TOOLCHAINRV32_PATH) \
38 <dir>/sw/vec
39 cmake --build <output dir> --target all
40```
41
42## Run the executables
43
44You can run Renode emulation with the built executables. If you run from the repo,
45you can run `sim_springbok` for Renode simulation.
46Out-of-repo emulation is possible but requires more steps.
47
48## Test the executables
49
50This project uses CMake's ctest to test the executables
51
52```bash
53ctest --test-dir <output dir>
54```