pub trait VectorRegisters {
type Hart: VectorHartConfig;
// Required methods
fn read_vregs(&self) -> &VectorRegisterFile<Self::Hart>;
fn write_vregs(&mut self) -> &mut VectorRegisterFile<Self::Hart>;
fn vector_instructions_allowed(&self) -> bool;
fn mark_vs_dirty(&mut self);
}Expand description
Vector register state.
This trait contains only methods that implementations genuinely need to provide. Derived
accessors for simpler CSRs are in VectorRegistersExt.
Note that due to Rust type system limitations, you should use VectorRegistersExt in trait
bounds instead of this trait directly or else the solver will fail.
Required Associated Types§
Sourcetype Hart: VectorHartConfig
type Hart: VectorHartConfig
Hart configuration, which determines vector lengths
Required Methods§
Sourcefn read_vregs(&self) -> &VectorRegisterFile<Self::Hart>
fn read_vregs(&self) -> &VectorRegisterFile<Self::Hart>
Read the vector register file
Sourcefn write_vregs(&mut self) -> &mut VectorRegisterFile<Self::Hart>
fn write_vregs(&mut self) -> &mut VectorRegisterFile<Self::Hart>
Mutable access to the vector register file
Sourcefn vector_instructions_allowed(&self) -> bool
fn vector_instructions_allowed(&self) -> bool
Check whether vector instructions are currently permitted.
Returns false when mstatus.VS == Off (or equivalent like sstatus/vstatus). In
environments without these status registers, returns true always.
Sourcefn mark_vs_dirty(&mut self)
fn mark_vs_dirty(&mut self)
Mark the vector state as dirty.
Must set VS to Dirty in mstatus (and sstatus/vsstatus shadows) when those registers
exist. No-op otherwise.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".