Trait rsim::processor::isa_mods::csrs::CSRProvider [−][src]
pub trait CSRProvider<T> { fn has_csr(&self, csr: u32) -> bool; fn csr_atomic_read_write(
&mut self,
csr: u32,
need_read: bool,
write_val: T
) -> ProcessorResult<Option<T>>; fn csr_atomic_read_set(
&mut self,
csr: u32,
set_bits: Option<T>
) -> ProcessorResult<T>; fn csr_atomic_read_clear(
&mut self,
csr: u32,
clear_bits: Option<T>
) -> ProcessorResult<T>; }
Required methods
fn has_csr(&self, csr: u32) -> bool
[src]
Does the Provider provide access to a given CSR?
fn csr_atomic_read_write(
&mut self,
csr: u32,
need_read: bool,
write_val: T
) -> ProcessorResult<Option<T>>
[src]
&mut self,
csr: u32,
need_read: bool,
write_val: T
) -> ProcessorResult<Option<T>>
Atomic Read/Write a CSR
Will only be called on csr
if has_csr(csr) == true
Reads can have side-effects, and some variants of the instruction disable that. If `need_read == false’, it won’t perform a read or any side-effects, and will return an Ok(None). Otherwise will return an Ok(Some()) with the previous CSR value, and execute side-effects.
fn csr_atomic_read_set(
&mut self,
csr: u32,
set_bits: Option<T>
) -> ProcessorResult<T>
[src]
&mut self,
csr: u32,
set_bits: Option<T>
) -> ProcessorResult<T>
Atomically read and set specific bits in a CSR
Will only be called on csr
if has_csr(csr) == true
If `set_bits == None’, no write will be performed (thus no side-effects of the write will happen). The CSR will always be read, and those side-effects will always be applied.
fn csr_atomic_read_clear(
&mut self,
csr: u32,
clear_bits: Option<T>
) -> ProcessorResult<T>
[src]
&mut self,
csr: u32,
clear_bits: Option<T>
) -> ProcessorResult<T>
Atomically read and clear specific bits in a CSR
Will only be called on csr
if has_csr(csr) == true
If `clear_bits == None’, no write will be performed (thus no side-effects of the write will happen). The CSR will always be read, and those side-effects will always be applied.
Implementors
impl CSRProvider<u32> for ProcessorCSRs32
[src]
impl CSRProvider<u32> for ProcessorCSRs32
[src]fn has_csr(&self, _csr: u32) -> bool
[src]
fn csr_atomic_read_write(
&mut self,
_csr: u32,
_need_read: bool,
_write_val: u32
) -> Result<Option<u32>>
[src]
&mut self,
_csr: u32,
_need_read: bool,
_write_val: u32
) -> Result<Option<u32>>
fn csr_atomic_read_set(
&mut self,
_csr: u32,
_set_bits: Option<u32>
) -> Result<u32>
[src]
&mut self,
_csr: u32,
_set_bits: Option<u32>
) -> Result<u32>
fn csr_atomic_read_clear(
&mut self,
_csr: u32,
_clear_bits: Option<u32>
) -> Result<u32>
[src]
&mut self,
_csr: u32,
_clear_bits: Option<u32>
) -> Result<u32>
impl CSRProvider<u64> for Rv64imvProcessorCSRs
[src]
impl CSRProvider<u64> for Rv64imvProcessorCSRs
[src]fn has_csr(&self, _csr: u32) -> bool
[src]
fn csr_atomic_read_write(
&mut self,
_csr: u32,
_need_read: bool,
_write_val: u64
) -> Result<Option<u64>>
[src]
&mut self,
_csr: u32,
_need_read: bool,
_write_val: u64
) -> Result<Option<u64>>
fn csr_atomic_read_set(
&mut self,
_csr: u32,
_set_bits: Option<u64>
) -> Result<u64>
[src]
&mut self,
_csr: u32,
_set_bits: Option<u64>
) -> Result<u64>
fn csr_atomic_read_clear(
&mut self,
_csr: u32,
_clear_bits: Option<u64>
) -> Result<u64>
[src]
&mut self,
_csr: u32,
_clear_bits: Option<u64>
) -> Result<u64>
impl CSRProvider<u64> for Rv64imvXCheriProcessorCSRs
[src]
impl CSRProvider<u64> for Rv64imvXCheriProcessorCSRs
[src]fn has_csr(&self, _csr: u32) -> bool
[src]
fn csr_atomic_read_write(
&mut self,
_csr: u32,
_need_read: bool,
_write_val: u64
) -> Result<Option<u64>>
[src]
&mut self,
_csr: u32,
_need_read: bool,
_write_val: u64
) -> Result<Option<u64>>
fn csr_atomic_read_set(
&mut self,
_csr: u32,
_set_bits: Option<u64>
) -> Result<u64>
[src]
&mut self,
_csr: u32,
_set_bits: Option<u64>
) -> Result<u64>
fn csr_atomic_read_clear(
&mut self,
_csr: u32,
_clear_bits: Option<u64>
) -> Result<u64>
[src]
&mut self,
_csr: u32,
_clear_bits: Option<u64>
) -> Result<u64>
impl<uXLEN: PossibleXlen, TElem> CSRProvider<uXLEN> for Rvv<uXLEN, TElem>
[src]
impl<uXLEN: PossibleXlen, TElem> CSRProvider<uXLEN> for Rvv<uXLEN, TElem>
[src]fn has_csr(&self, csr: u32) -> bool
[src]
fn csr_atomic_read_write(
&mut self,
csr: u32,
_need_read: bool,
_write_val: uXLEN
) -> Result<Option<uXLEN>>
[src]
&mut self,
csr: u32,
_need_read: bool,
_write_val: uXLEN
) -> Result<Option<uXLEN>>
fn csr_atomic_read_set(
&mut self,
csr: u32,
set_bits: Option<uXLEN>
) -> Result<uXLEN>
[src]
&mut self,
csr: u32,
set_bits: Option<uXLEN>
) -> Result<uXLEN>
fn csr_atomic_read_clear(
&mut self,
_csr: u32,
_clear_bits: Option<uXLEN>
) -> Result<uXLEN>
[src]
&mut self,
_csr: u32,
_clear_bits: Option<uXLEN>
) -> Result<uXLEN>