Skip to main content

ElaborateSession

Struct ElaborateSession 

Source
pub struct ElaborateSession { /* private fields */ }
Expand description

Session token holding the unfrozen circuit (AD-13).

Implementations§

Source§

impl ElaborateSession

Source

pub fn new(circuit_name: impl Into<String>) -> Self

Source

pub fn begin_module(&mut self, name: impl Into<String>, span: Span)

Source

pub fn bind_domain(&mut self, name: impl Into<String>, domain: u32)

Bind a phantom clock-domain id to a signal (AD-22).

Source

pub fn mark_cdc_bridge(&mut self, name: impl Into<String>)

Mark a CDC bridge signal that may legally cross domains.

Source

pub fn add_input(&mut self, name: impl Into<String>, ty: GroundType, span: Span)

Source

pub fn add_output( &mut self, name: impl Into<String>, ty: GroundType, span: Span, )

Source

pub fn add_inout(&mut self, name: impl Into<String>, ty: GroundType, span: Span)

Top-level InOut / Analog IO (FR27). Non-top uses are rejected at freeze.

Source

pub fn declare_wire( &mut self, name: impl Into<String>, ty: GroundType, span: Span, )

Source

pub fn declare_reg( &mut self, name: impl Into<String>, ty: GroundType, span: Span, )

Source

pub fn declare_reg_ex( &mut self, name: impl Into<String>, ty: GroundType, async_reset: bool, has_enable: bool, span: Span, )

Declare a register with optional async reset / clock enable (AD-23).

Source

pub fn declare_sync_read_mem( &mut self, name: impl Into<String>, depth: u32, width: u32, span: Span, )

Declare SyncReadMem (CHIRRTL-friendly; sync_read=true).

Source

pub fn declare_mem( &mut self, name: impl Into<String>, depth: u32, width: u32, span: Span, )

Declare Mem (async-read / reg-file style; sync_read=false).

Source

pub fn check_add(&mut self, lhs: &str, rhs: &str, span: Span) -> Option<u32>

Same-width binary add. Returns Err diagnostic via session if widths differ.

Source

pub fn check_connect(&mut self, lhs: &str, rhs: &str, span: Span) -> Option<u32>

Source

pub fn pad_to( &mut self, src: &str, to_width: u32, dest: impl Into<String>, span: Span, ) -> bool

Explicit zero-extend / sign-pad to a wider width; records result as a temp wire name.

Source

pub fn trunc_to( &mut self, src: &str, to_width: u32, dest: impl Into<String>, span: Span, ) -> bool

Source

pub fn begin_combinational(&mut self, span: Span)

Source

pub fn begin_sequential(&mut self, span: Span)

Source

pub fn begin_then(&mut self, span: Span)

Start an if-branch inside a combinational process (latch analysis).

Source

pub fn begin_else(&mut self, span: Span)

Source

pub fn end_if(&mut self, span: Span)

Source

pub fn assign_add( &mut self, dst: impl Into<String>, lhs: impl Into<String>, rhs: impl Into<String>, span: Span, )

Combinational assign dst = lhs + rhs (same-width required).

Source

pub fn assign_net( &mut self, name: impl Into<String>, from: impl Into<String>, span: Span, )

Assign a combinational net / output / wire from from.

Source

pub fn assign_reg_d_inc(&mut self, name: impl Into<String>, span: Span)

Assign Reg.d next-state as name + 1 (wrapping).

Source

pub fn assign_reg_d_from( &mut self, name: impl Into<String>, from: impl Into<String>, span: Span, )

Assign Reg.d from another signal.

Source

pub fn assign_mem_write( &mut self, mem: impl Into<String>, addr: impl Into<String>, data: impl Into<String>, span: Span, )

Sequential SyncReadMem / Mem write: mem[addr] <= data.

Source

pub fn assign_reg_d_mem_read( &mut self, reg: impl Into<String>, mem: impl Into<String>, addr: impl Into<String>, span: Span, )

Sequential SyncReadMem read into a register (latency 1 on tick).

Source

pub fn end_process(&mut self)

Source

pub fn end_module(&mut self)

Source

pub fn finish(self) -> Result<FrozenHir, Diagnostics>

Source

pub fn reject_unsynthesizable(&mut self, construct: &str, span: Span)

Record a synthesizable-path violation (heap, threads, f64, …) as a structured diagnostic.

Source

pub fn add_instance( &mut self, name: impl Into<String>, module: impl Into<String>, connects: Vec<(String, String)>, params: Vec<(String, u32)>, span: Span, )

Hierarchical instance (Story 2.2); not flattened at elaborate.

Source

pub fn add_dangling_input( &mut self, instance: &str, child_port: impl Into<String>, span: Span, )

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