Skip to content

Commit

Permalink
Enable supported bitmanip extensions for Rust demos
Browse files Browse the repository at this point in the history
Ibex supports a few more bitmanip extensions but they're not supported
in upstream LLVM / Rust.
  • Loading branch information
jwnrt committed Aug 22, 2024
1 parent bce6eff commit fd6e636
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
3 changes: 3 additions & 0 deletions sw/rust/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
[build]
target = "riscv32imc-unknown-none-elf"

# Enable supported bitmanip extension features.
rustflags = ["-Ctarget-feature=+zba,+zbb,+zbc,+zbs"]

[target.riscv32imc-unknown-none-elf]
runner = "../../util/load_demo_system.sh run"

Expand Down
2 changes: 1 addition & 1 deletion sw/rust/demo/hello_world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ How to run this demo:
4. Run the gdb:

```console
$ riscv32-unknown-elf-gdb ../../target/riscv32imc-unknown-none-elf/debug/led
$ riscv32-unknown-elf-gdb ../../target/riscv32imcb-unknown-none-elf/debug/led

(gdb) # Connect to OpenOCD
(gdb) target remote :3333
Expand Down
23 changes: 23 additions & 0 deletions sw/rust/riscv32imcb-unknown-none-elf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"arch": "riscv32",
"atomic-cas": false,
"cpu": "generic-rv32",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:32:32-i64:64-n32-S128",
"eh-frame-header": false,
"emit-debug-gdb-scripts": false,
"features": "+m,+c,+zba,+zbb,+zbc,+zbs,+forced-atomics",
"is-builtin": false,
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-target": "riscv32",
"max-atomic-width": 32,
"metadata": {
"description": "Bare RISC-V (RV32IMCBZbc ISA)",
"host_tools": false,
"std": false
},
"panic-strategy": "abort",
"relocation-model": "static",
"target-pointer-width": "32"
}
2 changes: 1 addition & 1 deletion sw/rust/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
targets = ["riscv32imc-unknown-none-elf"]
channel = "nightly"
components = ["rust-src"]

0 comments on commit fd6e636

Please sign in to comment.