pub struct LocalAddr {
    pub is_acc_addr: bool,
    pub accumulate: bool,
    pub read_full_acc_row: bool,
    pub norm_cmd: U<3>,
    pub garbage: U<{ _ }>,
    pub is_garbage: bool,
    pub data: U<MAX_ADDR_BITS>,
}
Expand description

Local address. The total number of bits for all fields is 32.

Fields§

§is_acc_addr: bool

Is Accumulator Address?

§accumulate: bool

Accumulate

§read_full_acc_row: bool

Read Full Accumulator Row

§norm_cmd: U<3>

NormCmd

§garbage: U<{ _ }>

Garbage area.

§is_garbage: bool

Is garbage address.

§data: U<MAX_ADDR_BITS>

Address Data

Implementations§

source§

impl LocalAddr

source

pub fn cast_to_local_addr(value: U<64>) -> Self

source

pub fn cast_to_sp_addr(value: U<64>) -> Self

source

pub fn garbage() -> Self

Returns the garbage address

source

pub fn sp_bank(self) -> U<SP_BANK_BITS>

source

pub fn sp_row(self) -> U<SP_BANK_ROW_BITS>

source

pub fn acc_bank(self) -> U<ACC_BANK_BITS>

source

pub fn acc_row(self) -> U<ACC_BANK_ROW_BITS>

source

pub fn full_sp_addr(self) -> U<SP_ADDR_BITS>

Returns scratchpad address.

source

pub fn full_acc_addr(self) -> U<ACC_ADDR_BITS>

Returns accumulator address.

source

pub fn is_garbage(self) -> bool

source

pub fn is_same_addr(self, other: Self) -> bool

source

pub fn make_this_garbage(self) -> Self

Make garbage LocalAddr. All bits are set to 1.

source

pub fn lt(self, other: LocalAddr) -> bool

Returns whether self is less than other.

source

pub fn le(self, other: LocalAddr) -> bool

Return whether self is less or equal than other.

source

pub fn add_with_overflow(self, other: U<MAX_ADDR_BITS>) -> (LocalAddr, bool)

Adds self and other and also returns overflow has occurred or not.

source

pub fn floor_sub( self, other: U<MAX_ADDR_BITS>, floor: U<MAX_ADDR_BITS> ) -> (LocalAddr, bool)

Subs self and other and returns both new address and underflow.

Trait Implementations§

source§

impl Add<Array<bool, MAX_ADDR_BITS>> for LocalAddr

§

type Output = LocalAddr

The resulting type after applying the + operator.
source§

fn add(self, rhs: U<MAX_ADDR_BITS>) -> Self::Output

Performs the + operation. Read more
source§

impl Clone for LocalAddr

source§

fn clone(&self) -> LocalAddr

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 LocalAddr

source§

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

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

impl From<Array<bool, 64>> for LocalAddr

source§

fn from(value: U<64>) -> Self

Reterive 32 bits address.
  • let addr: U<32> = value[31:0]
  • value[63:32] means the number of rows and columns.
Address scheme.
  • is_acc_addr: addr[31]
  • accumulate: addr[30]
  • read_full_acc_row: addr[29]
  • norm_cmd: addr[28:26]
  • garbage: addr[25:15]
  • is_garbage: addr[14]
  • data: addr[13:0]
source§

impl From<HOption<Array<bool, 64>>> for LocalAddr

source§

fn from(value: HOption<U<64>>) -> Self

Converts to this type from the input type.
source§

impl From<LocalAddr> for U<32>

source§

fn from(value: LocalAddr) -> Self

Converts to this type from the input type.
source§

impl Copy for LocalAddr

Auto Trait Implementations§

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.