Skip to main content

Budget

Struct Budget 

Source
pub struct Budget {
    pub lut_percent: f64,
    pub dsp_percent: f64,
    pub bram_percent: f64,
    pub uram_percent: f64,
}
Expand description

The global resource controls.

Fields§

§lut_percent: f64

LUTs as a percentage of BASE_LUT (0..200).

§dsp_percent: f64

DSPs as a percentage of BASE_DSP (0..200).

§bram_percent: f64

BRAM36 as a percentage of the dynamic region’s BUDGET_BRAM36 (0..100).

§uram_percent: f64

URAM as a percentage of the device’s U280_URAM (0..100).

Implementations§

Source§

impl Budget

Absolute resource counts from the percentages.

Source

pub fn luts(&self) -> u32

LUT budget, never above the device.

Source

pub fn dsps(&self) -> u32

DSP budget, never above the device.

Source

pub fn brams(&self) -> u32

BRAM36 budget.

Source

pub fn urams(&self) -> u32

URAM budget.

Source

pub fn chip(&self) -> Share

The chip limit: every resource of the budget. Fixed allowances (the SHA-512 line) come out of it like any module’s build.

Source

pub fn rest(&self, slots: &[Slot]) -> Share

What the modules with powers divide: the budget minus the fixed allowances of slots (the SHA-512 line’s LUT split).

Source

pub fn rest_with(&self, allow: &[Option<Share>]) -> Share

rest with the fixed allowances given per slot.

Source§

impl Budget

Source

pub fn whole_device() -> Budget

The whole device: every LUT and DSP of the U280 (the budget’s percentages above 100 %), the dynamic region’s BRAM and all URAM. The uBFT modes start here, because the replica’s footprint (UbftReplica) already counts the shell.

Trait Implementations§

Source§

impl Clone for Budget

Source§

fn clone(&self) -> Budget

Returns a duplicate 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 Budget

Source§

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

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

impl Default for Budget

100 % of everything: 485k LUTs, 4,520 DSPs, the dynamic region’s BRAM and all URAM.

Source§

fn default() -> Self

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

impl PartialEq for Budget

Source§

fn eq(&self, other: &Budget) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Budget

Source§

impl StructuralPartialEq for Budget

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

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>,

Source§

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>,

Source§

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.