pub struct PeS {
    pub reg1: S<ACC_BITS>,
    pub reg2: S<ACC_BITS>,
    pub propagate: Propagate,
}
Expand description

PE state registers.

Each register stores values based on the dataflow and propagate signal:

  • WS dataflow, preload: weight value for the next operation.
  • WS dataflow, compute: weight value for the current operation.
  • OS dataflow, preload: bias value for the next operation.
  • OS dataflow, compute: partial sum value for the current operation.

NOTE: In OS dataflow, it outputs the matmul result when a change in the propagate value is detected.

Fields§

§reg1: S<ACC_BITS>

Register 1.

§reg2: S<ACC_BITS>

Register 2.

§propagate: Propagate

The propagate value comes from the previous input.

NOTE: In the PE logic, it is only used to check whether the current propagate value differs from the previous one.

Implementations§

source§

impl PeS

source

pub fn new(reg1: S<ACC_BITS>, reg2: S<ACC_BITS>, propagate: Propagate) -> Self

Creates a new PE state.

source

pub fn new_os( preload: S<OUTPUT_BITS>, partial_sum: S<OUTPUT_BITS>, propagate: Propagate ) -> Self

Creates a new PE state for OS dataflow.

Arguments
  • preload: Bias value for the next operation.
  • partial_sum: MAC result of the current operation.
  • propagate: Propagate value.
source

pub fn new_ws( preload: S<INPUT_BITS>, weight: S<INPUT_BITS>, propagate: Propagate ) -> Self

Creates a new PE state for WS dataflow.

Arguments
  • preload: Weight value for the next operation.
  • weight: Weight value for the current operation.
  • propagate: Propagate value.

Trait Implementations§

source§

impl Clone for PeS

source§

fn clone(&self) -> PeS

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PeS

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for PeS

source§

fn default() -> PeS

Returns the “default value” for a type. Read more
source§

impl Copy for PeS

Auto Trait Implementations§

§

impl RefUnwindSafe for PeS

§

impl Send for PeS

§

impl Sync for PeS

§

impl Unpin for PeS

§

impl UnwindSafe for PeS

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> RepeatExt for T
where T: Copy,

source§

fn repeat<const N: usize>(self) -> Array<T, N>

Returns an array with the given value repeated N times.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.