pub struct TlmFifo<T: 'static> { /* private fields */ }Expand description
A bounded (or unbounded) FIFO that is also a component in the hierarchy.
Declare it as a child with #[component] so it appears in the tree,
then hand out its exports in connect.
Implementations§
Source§impl<T: 'static> TlmFifo<T>
impl<T: 'static> TlmFifo<T>
Sourcepub fn new(size: usize) -> TlmFifo<T>
pub fn new(size: usize) -> TlmFifo<T>
A FIFO size items deep. Depth 1 is the UVM default and forces the
producer to wait for the consumer.
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> bool
Sourcepub fn put_export(&self) -> PutExport<T>
pub fn put_export(&self) -> PutExport<T>
The put side, to connect to a component’s PutPort.
Sourcepub fn get_export(&self) -> GetExport<T>
pub fn get_export(&self) -> GetExport<T>
The get side, to connect to a component’s GetPort.
Sourcepub fn put_ap(&self) -> TapExport<T>
pub fn put_ap(&self) -> TapExport<T>
The tap that fires as each item goes in (uvm_tlm_fifo::put_ap).
Sourcepub fn get_ap(&self) -> TapExport<T>
pub fn get_ap(&self) -> TapExport<T>
The tap that fires as each item comes out (uvm_tlm_fifo::get_ap).
pub async fn put(&self, item: T)
pub fn try_put(&self, item: T) -> Result<(), T>
pub async fn get(&self) -> T
pub fn try_get(&self) -> Option<T>
Trait Implementations§
Source§impl<T: 'static> Component for TlmFifo<T>
impl<T: 'static> Component for TlmFifo<T>
Source§fn build(&mut self, ctx: &mut RustdvCtx)
fn build(&mut self, ctx: &mut RustdvCtx)
build — top-down. Where a component constructs its children
(D6); the gap between “a component exists” and “its children exist”
that all late binding lives in. Read moreSource§fn connect(&mut self, ctx: &mut RustdvCtx)
fn connect(&mut self, ctx: &mut RustdvCtx)
connect — bottom-up. Wire children together once they exist. Read moreSource§fn end_of_elaboration(&mut self, ctx: &mut RustdvCtx)
fn end_of_elaboration(&mut self, ctx: &mut RustdvCtx)
end_of_elaboration — top-down. The hierarchy is final. Read moreSource§fn start_of_simulation(&mut self, ctx: &mut RustdvCtx)
fn start_of_simulation(&mut self, ctx: &mut RustdvCtx)
start_of_simulation — top-down. Last chance before time moves. Read moreSource§fn check(&mut self, ctx: &mut RustdvCtx, errors: &mut CheckSink)
fn check(&mut self, ctx: &mut RustdvCtx, errors: &mut CheckSink)
check — top-down. Report failures into the sink. Read moreSource§fn final_phase(&mut self, ctx: &mut RustdvCtx)
fn final_phase(&mut self, ctx: &mut RustdvCtx)
Source§fn start(&mut self, ctx: &mut RustdvCtx)
fn start(&mut self, ctx: &mut RustdvCtx)
Transitional spawn hook, pre-dating the restored
run
traversal. tinyalu_tb and the not-yet-converted chapters still
spawn free-running behavior here; it folds into run as each
converts. Not part of the nine-phase lifecycle.Source§fn comp_name() -> &'static strwhere
Self: Sized,
fn comp_name() -> &'static strwhere
Self: Sized,
This type’s registered short name, used as the factory override key.
The last path segment of the type name (
Foo from
crate::mod::Foo), which matches the name #[derive(Component)]
registers.Source§fn new_comp() -> RustdvComp
fn new_comp() -> RustdvComp
Build this component the normal way and drop it in an
crate::factory::RustdvComp
slot — the analogue of UVM’s new (D75). Not overridable.Source§fn create_comp() -> RustdvComp
fn create_comp() -> RustdvComp
Build this component through the factory — the analogue of UVM’s
create (D75). The default is built now and the slot is flagged; the
build walk swaps in an override if one applies.Source§impl<T: 'static> ComponentNode for TlmFifo<T>
impl<T: 'static> ComponentNode for TlmFifo<T>
Source§fn node_name(&self) -> &'static str
fn node_name(&self) -> &'static str
The component’s type-level name (hierarchical path is synthesized
from field names during traversal).
Source§fn children_mut(&mut self) -> Vec<(String, &mut (dyn ComponentNode + 'static))>
fn children_mut(&mut self) -> Vec<(String, &mut (dyn ComponentNode + 'static))>
Direct children as (field-derived name, node) pairs, in declaration
order. An owned Vec, not a
visit_children-style sync callback:
run_all awaits inside the walk, and a higher-ranked closure
cannot yield a child borrow that outlives the call, so the borrows
have to come back in a value the caller holds. An Option<T> child
created during build (D6) appears here only once it is Some.Source§fn port_slot(&self, name: &str) -> Option<Rc<dyn Any>>
fn port_slot(&self, name: &str) -> Option<Rc<dyn Any>>
This node’s port binding cell of the given name, erased (D83). Read more
Source§fn port_infos(&self) -> Vec<PortInfo>
fn port_infos(&self) -> Vec<PortInfo>
Every port this node declares, for the elaboration report.
Source§fn resolve_children(&mut self, ctx: &RustdvCtx)
fn resolve_children(&mut self, ctx: &RustdvCtx)
Resolve factory overrides for this node’s
RustdvComp fields (D75).
The derive generates this to call field.resolve(ctx, "field") for
each RustdvComp field; the default is a no-op for nodes with none.
Called by build_all after build, before descending — so a
swapped-out default’s own phases never run.Source§fn take_children(&mut self) -> Vec<(String, Box<dyn ComponentNode>)>
fn take_children(&mut self) -> Vec<(String, Box<dyn ComponentNode>)>
Move this node’s
RustdvComp children out, for the run phase (D82b). Read moreSource§fn restore_children(&mut self, taken: Vec<(String, Box<dyn ComponentNode>)>)
fn restore_children(&mut self, taken: Vec<(String, Box<dyn ComponentNode>)>)
Put back what
ComponentNode::take_children removed, in the same order.
Called unconditionally after the run phase — including on error — so the
post-run phases walk a whole tree.Auto Trait Implementations§
impl<T> !RefUnwindSafe for TlmFifo<T>
impl<T> !Send for TlmFifo<T>
impl<T> !Sync for TlmFifo<T>
impl<T> !UnwindSafe for TlmFifo<T>
impl<T> Freeze for TlmFifo<T>
impl<T> Unpin for TlmFifo<T>
impl<T> UnsafeUnpin for TlmFifo<T>
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
Mutably borrows from an owned value. Read more
Source§impl<T> DynPhases for Twhere
T: Component,
impl<T> DynPhases for Twhere
T: Component,
fn dyn_build(&mut self, ctx: &mut RustdvCtx)
Source§fn dyn_run<'a>(
&'a mut self,
ctx: &'a mut RustdvCtx,
) -> Pin<Box<dyn Future<Output = Result<(), TestError>> + 'a>>
fn dyn_run<'a>( &'a mut self, ctx: &'a mut RustdvCtx, ) -> Pin<Box<dyn Future<Output = Result<(), TestError>> + 'a>>
The async
run, boxed so it can be awaited behind dyn (D48). This
is the object-safe shim run_all needs to fire each component’s run.