Skip to main content

Netlist

Struct Netlist 

Source
pub struct Netlist<'d> {
    pub templates: Vec<Template>,
    pub instances: InstanceTree,
    pub top: Vec<InstanceId>,
    pub time_scale: TimeScale,
    pub tick_ns_per_unit: u64,
    /* private fields */
}
Expand description

The hand-off value elaborate() produces: the full undeduped InstanceTree plus (this task) a trivial 1:1 Template per instance.

Fields§

§templates: Vec<Template>§instances: InstanceTree§top: Vec<InstanceId>§time_scale: TimeScale

Task 6 (NL-026): the design’s global time scale — see resolve_time_scale’s doc comment for exactly where this comes from (a documented deviation from the plan’s literal spec).

§tick_ns_per_unit: u64

Task 6 (NL-025): the tick-per-nanosecond normalization factor SCHED reads as its sole source of truth — see tick_ns_per_unit_of.

Implementations§

Source§

impl<'d> Netlist<'d>

Source

pub fn member_symbol(&self, instance: InstanceId, key: SymbolKey) -> Symbol<'d>

Task 3 (Deviation #18): the real sv_lang::Symbol<'d> handle for one instance’s own copy of a deduped Template member, keyed by that member’s SymbolKey. sv_lang::Symbol is an internal handle type no external NetlistView consumer needs (the trait’s public surface stays exactly InstanceId/TemplateId/SymbolKey-based), so the plan’s own doc comment calls this “crate-private”. Deviation from the plan’s literal pub(crate): verified this function must actually be pub, not pub(crate) — the plan’s own test member_symbols_are_distinct_real_symbols_per_instance_not_the_canonical_aliased calls netlist.member_symbol(..) from tests/netlist_dedup_invariants.rs, an external integration-test crate (tests/*.rs files are compiled as separate crates and only see this crate’s pub surface — exactly the reasoning the plan’s own confirm_and_assign_symbol_keys doc comment gives for why that function is pub, immediately above this one). pub(crate) would make that test fail to compile. Still not part of NetlistView and not re-exported from netlist::mod beyond Netlist itself, so it remains effectively internal to callers that hold a concrete Netlist<'d> (same crate, or an integration test). Panics only if called with an (instance, key) pair elaborate() itself never produced — every real caller (Task 8, same crate) only ever passes pairs read off this same Netlist’s own Template/InstanceTree data, so this can never fire for a correct caller; a wrong caller is a programmer error this wave chooses to catch loudly, not a Result (this is not an sv_lang/sv_lang_kinds kind match, so it is not bound by this plan’s “match must fall through to a typed error” rule — it is an internal indexing precondition).

Source

pub fn instance_symbol(&self, id: InstanceId) -> Symbol<'d>

Task F3 (CG-125/NL-035): the real, undeduped Instance-kind sv_lang::Symbol<'d> for id — the instantiation site itself (see instance_syms’s own doc comment for why this, not member_symbol, is what the run pipeline needs to reach instance_body()/ instance_port_connections()). Panics only for an InstanceId elaborate() itself never produced, the same indexing-precondition posture member_symbol’s own doc comment documents immediately above.

Trait Implementations§

Source§

impl<'d> NetlistView for Netlist<'d>

Source§

fn registration_order(&self) -> Vec<InstanceId>

Source§

fn hierarchical_path(&self, id: InstanceId) -> &str

Source§

fn resolve_hier_path(&self, path: &str) -> Option<InstantiatedSignalId>

Source§

fn dedup_key(&self, tmpl: TemplateId) -> &TemplateKey

Source§

fn tick_ns_per_unit(&self) -> u64

The single source of truth for the scheduler’s time precision (netlist-analysis.md Decision 8).
Source§

fn instance(&self, id: InstanceId) -> &InstanceNode

NL-024 (Task 4): the instance-level query half of the public surface netlist-analysis.md’s impl<'d> Netlist<'d> specifies. Purely additive to this trait (Deviation #1) — every existing method keeps its exact signature.
Source§

fn template(&self, id: TemplateId) -> &Template

NL-024 (Task 4): the template-level query half.

Auto Trait Implementations§

§

impl<'d> !RefUnwindSafe for Netlist<'d>

§

impl<'d> !UnwindSafe for Netlist<'d>

§

impl<'d> Freeze for Netlist<'d>

§

impl<'d> Send for Netlist<'d>

§

impl<'d> Sync for Netlist<'d>

§

impl<'d> Unpin for Netlist<'d>

§

impl<'d> UnsafeUnpin for Netlist<'d>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HierPathResolver for T
where T: NetlistView + ?Sized,

Source§

impl<T> HierarchicalNames for T
where T: NetlistView + ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V