Struct rsim::processor::isa_mods::vector::Rvv[][src]

pub struct Rvv<uXLEN: PossibleXlen, TElem> {
    vreg: Box<dyn VectorRegisterFile<TElem>>,
    vtype: VType,
    vl: u32,
    vstart: u32,
    _phantom_xlen: PhantomData<uXLEN>,
}

The Vector Unit for the processor. Stores all vector state, including registers. This requires a VecMemInterface<uXLEN, TElem> and VecRegInterface to access other resources.

Fields

vreg: Box<dyn VectorRegisterFile<TElem>>vtype: VTypevl: u32vstart: u32

This is used by the hardware to support resuming vector instructions after traps. e.g. if a vector load hits a page fault at element #N, set vstart to N before taking the trap, and the load will resume from vstart when you get back. Reset to zero after every vector load instruction.

This potentially impacts fast paths, e.g. if a fast-path load pulls full lines from memory into a vector register, vstart must be 0.

_phantom_xlen: PhantomData<uXLEN>

Implementations

impl<uXLEN: PossibleXlen, TElem> Rvv<uXLEN, TElem>[src]

pub fn new(vreg: Box<dyn VectorRegisterFile<TElem>>) -> Self[src]

Returns an initialized vector unit.

pub fn reset(&mut self)[src]

Reset the vector unit’s state

fn exec_config(
    &mut self,
    inst_kind: ConfigKind,
    inst: InstructionBits,
    sreg: &mut dyn VecRegInterface<uXLEN>
) -> Result<()>
[src]

(Internal) Execute a configuration instruction, e.g. vsetvli family Requires a VecRegInterface.

Arguments

  • inst_kind - Which kind of configuration instruction to execute
  • inst - Decoded instruction bits
  • conn - Connection to external resources

fn get_active_segment_range(&mut self, vm: bool, evl: u32) -> Option<Range<u32>>[src]

Find the last segment index that isn’t masked out. Used to find a tight range of the segments/elements that will actually be processed.

fn fast_check_load_store(
    &mut self,
    addr_provenance: (u64, Provenance),
    rs2: u8,
    vm: bool,
    op: DecodedMemOp,
    sreg: &mut dyn VecRegInterface<uXLEN>
) -> (Result<bool>, Range<u64>)
[src]

Try doing fast-path capability checks for accesses for a vector load/store. Fast-paths exist for all accesses, although in hardware some may not be as fast as others. Return values:

  • Ok(true) if the fast-path check raised no capability exceptions
    • Therefore the full access should not raise any capability exceptions
  • Ok(false) if the fast-path check failed in a tolerable manner
    • Therefore the full access may raise a capability exception
    • A tolerable fast-path failure = fault-only-first, which might absorb the exception.
  • Err() if the fast-path check failed in a not-tolerable manner panics if all elements are masked out

fn get_load_store_accesses(
    &mut self,
    rd: u8,
    addr_p: (u64, Provenance),
    rs2: u8,
    vm: bool,
    op: DecodedMemOp
) -> Result<Vec<(VectorElem, u64)>>
[src]

Converts a decoded memory operation to the list of accesses it performs.

fn exec_load_store(
    &mut self,
    expected_addr_range: Range<u64>,
    rd: u8,
    rs1: u8,
    rs2: u8,
    vm: bool,
    op: DecodedMemOp,
    sreg: &mut dyn VecRegInterface<uXLEN>,
    mem: &mut dyn VecMemInterface<uXLEN, TElem>
) -> Result<()>
[src]

Execute a decoded memory access, assuming all access checks have already been performed.

fn load_to_vreg(
    &mut self,
    mem: &mut dyn VecMemInterface<uXLEN, TElem>,
    eew: Sew,
    addr_provenance: (u64, Provenance),
    vd_base: u8,
    idx_from_base: u32
) -> Result<()>
[src]

Load a value of width eew from a given address addr into a specific element idx_from_base of a vector register group starting at vd_base

fn store_to_mem(
    &mut self,
    mem: &mut dyn VecMemInterface<uXLEN, TElem>,
    eew: Sew,
    addr_provenance: (u64, Provenance),
    vd_base: u8,
    idx_from_base: u32
) -> Result<()>
[src]

Stores a value of width eew from a specific element idx_from_base of a vector register group starting at vd_base into a given address addr

pub fn dump(&self)[src]

Dump vector unit state to standard output.

Trait Implementations

impl<uXLEN: PossibleXlen, TElem> CSRProvider<uXLEN> for Rvv<uXLEN, TElem>[src]

impl<uXLEN: PossibleXlen, TElem> IsaMod<(&'_ mut (dyn VecRegInterface<uXLEN> + '_), &'_ mut (dyn VecMemInterface<uXLEN, TElem> + '_))> for Rvv<uXLEN, TElem>[src]

type Pc = ()

fn execute(
    &mut self,
    opcode: Opcode,
    inst: InstructionBits,
    inst_bits: u32,
    conn: VecInterface<'_, uXLEN, TElem>
) -> ProcessorResult<Option<()>>
[src]

Execute a vector-specific instruction, e.g. vector arithmetic, loads, configuration Requires a VecRegInterface and a VecMemInterface.

Arguments

  • opcode - The major opcode of the instruction
  • inst - Decoded instruction bits
  • inst_bits - Raw instruction bits (TODO - we shouldn’t need this)
  • conn - Connection to external resources

Auto Trait Implementations

impl<uXLEN, TElem> !RefUnwindSafe for Rvv<uXLEN, TElem>

impl<uXLEN, TElem> !Send for Rvv<uXLEN, TElem>

impl<uXLEN, TElem> !Sync for Rvv<uXLEN, TElem>

impl<uXLEN, TElem> Unpin for Rvv<uXLEN, TElem> where
    uXLEN: Unpin

impl<uXLEN, TElem> !UnwindSafe for Rvv<uXLEN, TElem>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.