A tiny and simple RISC-V assembler.
The assembler includes a CMakeLists.txt that makes it a library for any RP2350 project!
If you want to use it just clone the repository inside your project:
$ git clone https://github.com/semitov/riscv-as.gitInclude the directory (CMakeLists.txt):
add_subdirectory(riscv-as)Then link it in your project (CMakeLists.txt):
target_link_libraries(your_cool_project PUBLIC stv-assembler ...)In the end you probably will need the files instruction.c and writer.c to use its functions, but fill free to hack it as you prefer!
NOTE : Don't forget to define the macro PICO_BUILD to build it correctly.
To build it (and use it) natively on any host PC simply use our meson build system:
$ meson setup build
$ cd build
$ meson compile$ ./semitov-riscv-as -c source_file.s -o output_binaryIf you want to test the generated binaries with spike and/or pk, you need a RISC-V toolchain.
- Recommended: prebuilt riscv-gnu-toolchain-builds.
- Alternative: build the riscv-gnu-toolchain yourself with multilib enabled.
Note:
pkshould be built for 32-bit targets.
Please format the code before submitting any contribution. Run ninja format inside the build/ folder.