Skip to content

five-embeddev/riscv-csr-access

Repository files navigation

RISC-V CSR Access Routines

RISC-V System Register Access Routines in various languages.

For more information see https://five-embeddev.com/quickref/csrs-access.html

The register acccess funtions and classes are generated from templates based on a yaml definition file.

Files:

  • include/riscv-csr.h: C using macros.
  • include/riscv-csr.hpp: C++ using an a class interface.
  • rs/riscv_csr_macros/src/riscv_csr_macros.rs: Rust using macros.

Generators:

Examples:

  • examples/test_csr.c : Example of using riscv-csr.h
  • examples/test_csr.cpp : Example of using riscv-csr.hpp
  • rs/riscv_csr_macros/examples/test_csr.rs : Example of using riscv_csr_macros.rs