Crates.io | litex-hal |
lib.rs | litex-hal |
version | 0.4.0 |
source | src |
created_at | 2022-07-12 08:53:04.52845 |
updated_at | 2023-11-27 06:41:32.553467 |
description | A embedded HAL crate for LiteX cores |
homepage | |
repository | https://github.com/pepijndevos/rust-litex-hal |
max_upload_size | |
id | 624268 |
size | 27,197 |
A Rust embedded HAL crate for LiteX cores. It contains basic HAL traits for GPIO, UART, SPI, and delay.
More info and instructions on my blog and example project in this repo
The repository also contains an example that you can run on Verilator using litex_sim
.
The following dependencies are required to generate Rust code for peripherals (also called Peripheral Access Crate or PAC) and build the example for it.
Our example use VexRiscv, so to be able to compile them you need to add riscv32i-unknown-none-elf
target for Rust.
rustup target add riscv32i-unknown-none-elf
For LiteX scripts.
sudo pacman -S python
sudo apt install python3
To build cores and optionally simulate it using verilator.
The following dependencies are required if you want to run the example on litex_sim
.
To compile VexRiscv soft core. RISCV 64 can also build RISCV 32.
sudo pacman -S riscv64-elf-gcc
sudo apt install gcc-riscv64-unknown-elf
Simulator to run simulation.
sudo pacman -S verilator
sudo apt install verilator
To run the simulation execute the following command:
cargo xtask simulate --example counter
You can also pass --release
to the simulation command.