Struct calyx_ir::Printer

source ·
pub struct Printer;
Expand description

Printer for the IR.

Implementations§

source§

impl Printer

source

pub fn write_context<F: Write>( ctx: &Context, skip_primitives: bool, f: &mut F ) -> Result<()>

Prints out the program context. If skip_primitives is true, the printer will skip printing primitives defined outside the source file.

source

pub fn write_externs<'a, F, I>( (path, prims): (&Path, I), f: &mut F ) -> Result<()>where F: Write, I: Iterator<Item = &'a Primitive>,

Formats and writes extern statements.

source

pub fn write_primitive<F: Write>( prim: &Primitive, indent: usize, f: &mut F ) -> Result<()>

source

pub fn write_component<F: Write>(comp: &Component, f: &mut F) -> Result<()>

Formats and writes the Component to the formatter.

source

pub fn write_cell<F: Write>( cell: &Cell, indent_level: usize, f: &mut F ) -> Result<()>

Format and write a cell.

source

pub fn write_assignment<F: Write, T: Clone + ToString + Eq>( assign: &Assignment<T>, indent_level: usize, f: &mut F ) -> Result<()>

Format and write an assignment.

source

pub fn assignment_to_str<T>(assign: &Assignment<T>) -> Stringwhere T: ToString + Clone + Eq,

Convinience method to get string representation of ir::Assignment.

source

pub fn control_to_str(assign: &Control) -> String

Convinience method to get string representation of ir::Control.

source

pub fn write_comb_group<F: Write>( group: &CombGroup, indent_level: usize, f: &mut F ) -> Result<()>

Format and write a combinational group.

source

pub fn write_group<F: Write>( group: &Group, indent_level: usize, f: &mut F ) -> Result<()>

Format and write a group.

source

pub fn write_static_group<F: Write>( group: &StaticGroup, indent_level: usize, f: &mut F ) -> Result<()>

Format and write a static group.

source

pub fn write_static_control<F: Write>( scontrol: &StaticControl, indent_level: usize, f: &mut F ) -> Result<()>

Format and write a static control program

source

pub fn write_control<F: Write>( control: &Control, indent_level: usize, f: &mut F ) -> Result<()>

Format and write a control program

source

pub fn guard_str<T>(guard: &Guard<T>) -> Stringwhere T: Eq + ToString,

Generate a String-based representation for a guard.

source

pub fn port_to_str(port: &Port) -> String

Get the port access expression.

source

pub fn format_metadata(metadata: &Option<String>) -> String

Formats the top-level metadata if present

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.