Cindy Liu | b492914 | 2023-10-20 11:36:04 -0700 | [diff] [blame] | 1 | # Springbok SW Repository |
| 2 | |
| 3 | This project hosts SW programs for RISC-V 32-bit baremetal machine with vector |
| 4 | extension (Springbok). It provides the BSP to build the SW artifacts to run on |
| 5 | Springbok. |
| 6 | |
| 7 | ## Prerequisite |
| 8 | |
| 9 | If you get this project from a repo manifest, you are all set. If not, |
| 10 | you 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 | |
| 17 | This 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, |
| 25 | and gloss library support |
| 26 | -*tests*: RVV instruction unit tests |
| 27 | |
| 28 | ## Build the project |
| 29 | |
| 30 | If you get this project from repo manifest, you can build the artifacts with `m |
| 31 | springbok`. |
| 32 | If you download this project alone, you need to run the following from the |
| 33 | top-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 | |
| 44 | You can run Renode emulation with the built executables. If you run from the repo, |
| 45 | you can run `sim_springbok` for Renode simulation. |
| 46 | Out-of-repo emulation is possible but requires more steps. |
| 47 | |
| 48 | ## Test the executables |
| 49 | |
| 50 | This project uses CMake's ctest to test the executables |
| 51 | |
| 52 | ```bash |
| 53 | ctest --test-dir <output dir> |
| 54 | ``` |