Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
37: Add support for custom vexriscv instructions r=Disasm a=xobs This adds a new namespace under "registers" to support the custom interrupt controller on vexriscv. Co-authored-by: Sean Cross <sean@xobs.io>
- Loading branch information
Showing
14 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
New-Item -Force -Name bin -Type Directory | ||
|
||
# remove existing blobs because otherwise this will append object files to the old blobs | ||
Remove-Item -Force bin/*.a | ||
|
||
$crate = "riscv" | ||
|
||
riscv64-unknown-elf-gcc -c -mabi=ilp32 -march=rv32i asm.S -o bin/$crate.o | ||
riscv64-unknown-elf-ar crs bin/riscv32i-unknown-none-elf.a bin/$crate.o | ||
|
||
riscv64-unknown-elf-gcc -c -mabi=ilp32 -march=rv32imc asm.S -o bin/$crate.o | ||
riscv64-unknown-elf-ar crs bin/riscv32imac-unknown-none-elf.a bin/$crate.o | ||
riscv64-unknown-elf-ar crs bin/riscv32imc-unknown-none-elf.a bin/$crate.o | ||
|
||
riscv64-unknown-elf-gcc -c -mabi=lp64 -march=rv64imac asm.S -o bin/$crate.o | ||
riscv64-unknown-elf-ar crs bin/riscv64imac-unknown-none-elf.a bin/$crate.o | ||
riscv64-unknown-elf-ar crs bin/riscv64gc-unknown-none-elf.a bin/$crate.o | ||
|
||
Remove-Item bin/$crate.o |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,3 +108,7 @@ pub use self::mhpmeventx::*; | |
|
||
|
||
// TODO: Debug Mode Registers | ||
|
||
|
||
// Vexriscv custom CSRs | ||
pub mod vexriscv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//! vexriscv dci register -- dcache info | ||
//! | ||
//! This register is only available if the core was built with | ||
//! `DBusCachedPlugin` enabled and `csrInfo` set to `true`. | ||
//! | ||
//! See | ||
//! [DBusCachedPlugin.scala](https://github.com/SpinalHDL/VexRiscv/blob/95237b23ea2d658cb3e0aa77680ca2851ef5d882/src/main/scala/vexriscv/plugin/DBusCachedPlugin.scala#L358) | ||
//! for more information. | ||
|
||
read_csr_as_usize!(0xCC0, __read_vdci); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//! vexriscv mim register -- machine irq mask | ||
|
||
read_csr_as_usize!(0xBC0, __read_vmim); | ||
write_csr_as_usize!(0xBC0, __write_vmim); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//! vexriscv mip register -- machine irq pending | ||
|
||
read_csr_as_usize!(0xFC0, __read_vmip); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//! VexRiscv CSRs | ||
//! | ||
//! [VexRiscv](https://github.com/SpinalHDL/VexRiscv) is a RISC-V softcore | ||
//! written in Scala. It is highly configurable, and can be built with features | ||
//! such as a dcache and an external interrupt controller. | ||
//! | ||
//! These features use vendor-specific CSRs, which are available using this | ||
//! module. | ||
pub mod dci; | ||
pub mod mim; | ||
pub mod mip; | ||
pub mod sim; | ||
pub mod sip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//! vexriscv sim register -- supervisor irq mask | ||
|
||
read_csr_as_usize!(0x9C0, __read_vsim); | ||
write_csr_as_usize!(0x9C0, __write_vsim); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//! vexriscv sip register -- supervisor irq pending | ||
|
||
read_csr_as_usize!(0xDC0, __read_vsip); |