pub struct InferenceAnalysis {
pub latency_data: HashMap<Id, GoDone>,
pub static_component_latencies: HashMap<Id, u64>,
/* private fields */
}
Expand description
Default implemnetation is almost certainly not helpful.
You should probably use from_ctx
instead.
Fields§
§latency_data: HashMap<Id, GoDone>
component name -> vec<(go signal, done signal, latency)>
static_component_latencies: HashMap<Id, u64>
Maps static component names to their latencies, but there can only be one go port on the component. (This is a subset of the information given by latency_data), and is helpful for inferring invokes. Perhaps someday we should get rid of it and only make it one field.
Implementations§
Source§impl InferenceAnalysis
impl InferenceAnalysis
Sourcepub fn from_ctx(ctx: &Context) -> Self
pub fn from_ctx(ctx: &Context) -> Self
Builds FixUp struct from a ctx. Looks at all primitives and component signatures to get latency information.
Sourcepub fn add_component(
&mut self,
(comp_name, latency, go_done): (Id, u64, GoDone),
)
pub fn add_component( &mut self, (comp_name, latency, go_done): (Id, u64, GoDone), )
Updates the component, given a component name and a new latency and GoDone object.
Sourcepub fn remove_component(&mut self, comp_name: Id)
pub fn remove_component(&mut self, comp_name: Id)
Updates the component, given a component name and a new latency. Note that this expects that the component already is accounted for in self.latency_data and self.static_component_latencies.
Sourcepub fn adjust_component(&mut self, (comp_name, adjusted_latency): (Id, u64))
pub fn adjust_component(&mut self, (comp_name, adjusted_latency): (Id, u64))
Updates the component, given a component name and a new latency. Note that this expects that the component already is accounted for in self.latency_data and self.static_component_latencies.
Sourcepub fn get_possible_latency(c: &Control) -> Option<u64>
pub fn get_possible_latency(c: &Control) -> Option<u64>
Returns Some(latency) if a control statement has a latency, because it is static or is has the @promotable attribute
pub fn remove_promotable_from_seq(seq: &mut Seq)
Sourcepub fn remove_promotable_attribute(c: &mut Control)
pub fn remove_promotable_attribute(c: &mut Control)
Removes the @promotable attribute from the control program. Recursively visits the children of the control.
pub fn fixup_seq(&self, seq: &mut Seq)
pub fn fixup_par(&self, par: &mut Par)
pub fn fixup_if(&self, _if: &mut If)
pub fn fixup_while(&self, _while: &mut While)
pub fn fixup_repeat(&self, repeat: &mut Repeat)
pub fn fixup_ctrl(&self, ctrl: &mut Control)
Sourcepub fn fixup_timing(&self, comp: &mut Component)
pub fn fixup_timing(&self, comp: &mut Component)
“Fixes Up” the component. In particular:
- Removes @promotable annotations for any groups that write to any
updated_components
. - Try to re-infer groups’ latencies.
- Removes all @promotable annotation from the control program.
- Re-infers the @promotable annotations for any groups or control.
Note that this only fixes up the component’s ``internals’’. It does not fix the component’s signature.
Auto Trait Implementations§
impl Freeze for InferenceAnalysis
impl RefUnwindSafe for InferenceAnalysis
impl Send for InferenceAnalysis
impl Sync for InferenceAnalysis
impl Unpin for InferenceAnalysis
impl UnwindSafe for InferenceAnalysis
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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