Struct rsim::processor::isa_mods::vector::types::VType [−][src]
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]
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