spice::netlist

Trait HasSpiceLikeNetlist

Source
pub trait HasSpiceLikeNetlist: Schema {
    // Required methods
    fn write_include<W: Write>(
        &self,
        out: &mut W,
        include: &Include,
    ) -> Result<()>;
    fn write_start_subckt<W: Write>(
        &self,
        out: &mut W,
        name: &ArcStr,
        ports: &[&SignalInfo],
    ) -> Result<()>;
    fn write_end_subckt<W: Write>(
        &self,
        out: &mut W,
        name: &ArcStr,
    ) -> Result<()>;
    fn write_instance<W: Write>(
        &self,
        out: &mut W,
        name: &ArcStr,
        connections: Vec<ArcStr>,
        child: &ArcStr,
    ) -> Result<ArcStr>;
    fn write_primitive_inst<W: Write>(
        &self,
        out: &mut W,
        name: &ArcStr,
        connections: HashMap<ArcStr, Vec<ArcStr>>,
        primitive: &<Self as Schema>::Primitive,
    ) -> Result<ArcStr>;

    // Provided methods
    fn write_prelude<W: Write>(
        &self,
        out: &mut W,
        lib: &Library<Self>,
    ) -> Result<()> { ... }
    fn write_slice<W: Write>(
        &self,
        out: &mut W,
        slice: Slice,
        info: &SignalInfo,
    ) -> Result<()> { ... }
    fn write_postlude<W: Write>(
        &self,
        out: &mut W,
        lib: &Library<Self>,
    ) -> Result<()> { ... }
}
Expand description

A schema with a SPICE-like netlist format.

Required Methods§

Source

fn write_include<W: Write>(&self, out: &mut W, include: &Include) -> Result<()>

Writes an include statement.

A newline will be added afterward.

Source

fn write_start_subckt<W: Write>( &self, out: &mut W, name: &ArcStr, ports: &[&SignalInfo], ) -> Result<()>

Writes a begin subcircuit statement.

A newline will be added afterward.

Source

fn write_end_subckt<W: Write>(&self, out: &mut W, name: &ArcStr) -> Result<()>

Writes an end subcircuit statement.

A newline will be added afterward.

Source

fn write_instance<W: Write>( &self, out: &mut W, name: &ArcStr, connections: Vec<ArcStr>, child: &ArcStr, ) -> Result<ArcStr>

Writes a SCIR instance.

A newline will be added afterward.

Source

fn write_primitive_inst<W: Write>( &self, out: &mut W, name: &ArcStr, connections: HashMap<ArcStr, Vec<ArcStr>>, primitive: &<Self as Schema>::Primitive, ) -> Result<ArcStr>

Writes a primitive instantiation.

A newline will be added afterward.

Provided Methods§

Source

fn write_prelude<W: Write>( &self, out: &mut W, lib: &Library<Self>, ) -> Result<()>

Writes a prelude to the beginning of the output stream.

Should include a newline after if needed.

Source

fn write_slice<W: Write>( &self, out: &mut W, slice: Slice, info: &SignalInfo, ) -> Result<()>

Writes a slice.

Should not include a newline at the end.

Source

fn write_postlude<W: Write>( &self, out: &mut W, lib: &Library<Self>, ) -> Result<()>

Writes a postlude to the end of the output stream.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§