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

pub struct VType {
    pub vill: bool,
    pub vma: bool,
    pub vta: bool,
    pub vsew: Sew,
    pub vlmul: Lmul,
}

Vector type information

Records the current vector state the program has requested, including element width. Convertible to/from u32, e.g. a register value.

 
let encoded_vtype = 0b00001010011;
let decoded_vtype = VType::decode(encoded_vtype).unwrap();
assert_eq!(decoded_vtype,
    VType {
        vill: false,
        vma: false,
        vta: true,
        vsew: Sew::e32,
        vlmul: Lmul::e8
    }
);
 
let reencoded_vtype = decoded_vtype.encode();
assert_eq!(encoded_vtype, reencoded_vtype);

Fields

vill: bool

Illegal value.

If set, then the program has requested an unsupported configuration.

vma: bool

Vector mask agnostic.

If set, the processor is alowed to overwrite masked-off elements with all 1s.

vta: bool

Vector tail agnostic.

If set, the processor is allowed to overwrite tail elements with all 1s.

vsew: Sew

Selected element width. See Sew

vlmul: Lmul

Length multiplier. See Lmul

Implementations

impl VType[src]

pub fn illegal() -> Self[src]

Generate a VType with the illegal bit vill set, and all other bits zeroed. This should be used when an unsupported vtype is requested by the program.

pub fn elems_per_group(self) -> u32[src]

Shorthand for VType::val_times_lmul_over_sew with x = VLEN

Used for calculating the number of vector elements a vector register can hold in a given configuration.

pub fn encode(&self) -> u32[src]

Encode the VType structure into a u32 This is necessary when a program queries the vector type CSR.

pub fn decode(vtype_bits: u32) -> Result<VType>[src]

Attempt to decode a u32 vtype value (e.g. one encoded in a register value) into an actual VType.

pub fn val_times_lmul_over_sew(self, x: u32) -> u32[src]

Function that evaluates (X * LMUL) / SEW from their enum values

Arguments

  • x - value to multiply/divide

Trait Implementations

impl Clone for VType[src]

impl Debug for VType[src]

impl PartialEq<VType> for VType[src]

impl Copy for VType[src]

impl Eq for VType[src]

impl StructuralEq for VType[src]

impl StructuralPartialEq for VType[src]

Auto Trait Implementations

impl RefUnwindSafe for VType

impl Send for VType

impl Sync for VType

impl Unpin for VType

impl UnwindSafe for VType

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.