bag.design.netlist

netlist processing utilities.

Module Contents

Classes

NetlistNode

Helper class that provides a standard way to create an ABC using

Netlist

Helper class that provides a standard way to create an ABC using

Header

Helper class that provides a standard way to create an ABC using

Instance

Helper class that provides a standard way to create an ABC using

Subcircuit

Helper class that provides a standard way to create an ABC using

Parser

Helper class that provides a standard way to create an ABC using

ParserCDL

Helper class that provides a standard way to create an ABC using

ParserSpectre

Helper class that provides a standard way to create an ABC using

Functions

guess_netlist_type(→ pybag.enum.DesignOutput)

parse_netlist(→ Netlist)

add_mismatch_offsets(→ Dict[str, Any])

add_internal_sources(→ Dict[str, Any])

_read_lines(→ List[str])

Reads the given Spectre or CDL netlist.

bag.design.netlist.guess_netlist_type(netlist_in: Union[pathlib.Path, str]) pybag.enum.DesignOutput[source]
bag.design.netlist.parse_netlist(netlist_in: Union[pathlib.Path, str], netlist_type: pybag.enum.DesignOutput) Netlist[source]
bag.design.netlist.add_mismatch_offsets(netlist_in: Union[pathlib.Path, str], netlist_out: Union[pathlib.Path, str], netlist_type: pybag.enum.DesignOutput) Dict[str, Any][source]
bag.design.netlist.add_internal_sources(netlist_in: Union[pathlib.Path, str], netlist_out: Union[pathlib.Path, str], netlist_type: pybag.enum.DesignOutput, ports: List[str]) Dict[str, Any][source]
class bag.design.netlist.NetlistNode[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract netlist(stream: TextIO, netlist_type: pybag.enum.DesignOutput) None[source]
abstract netlist_with_offset(stream: TextIO, used_names: Set[str], offset_map: Dict[str, str], netlist_type: pybag.enum.DesignOutput, ports: List[str], bag_mos: Set[str], pdk_mos: Set[str]) None[source]
class bag.design.netlist.Netlist(header: Header, subckts: List[Subcircuit])[source]

Bases: NetlistNode

Helper class that provides a standard way to create an ABC using inheritance.

property used_names: Set[str][source]
netlist(stream: TextIO, netlist_type: pybag.enum.DesignOutput) None[source]
netlist_with_offset(stream: TextIO, used_names: Set[str], offset_map: Dict[str, str], netlist_type: pybag.enum.DesignOutput, ports: List[str], bag_mos: Set[str], pdk_mos: Set[str]) None[source]
class bag.design.netlist.Header(lines: List[str])[source]

Bases: NetlistNode

Helper class that provides a standard way to create an ABC using inheritance.

netlist(stream: TextIO, netlist_type: pybag.enum.DesignOutput) None[source]
netlist_with_offset(stream: TextIO, used_names: Set[str], offset_map: Dict[str, str], netlist_type: pybag.enum.DesignOutput, ports: List[str], bag_mos: Set[str], pdk_mos: Set[str]) None[source]
class bag.design.netlist.Instance(inst_name: str, cell_name: str, ports: List[str], params: List[str])[source]

Bases: NetlistNode

Helper class that provides a standard way to create an ABC using inheritance.

netlist(stream: TextIO, netlist_type: pybag.enum.DesignOutput) None[source]
netlist_with_offset(stream: TextIO, used_names: Set[str], offset_map: Dict[str, str], netlist_type: pybag.enum.DesignOutput, ports: List[str], bag_mos: Set[str], pdk_mos: Set[str]) None[source]
class bag.design.netlist.Subcircuit(name: str, ports: List[str], items: List[Union[str, Instance]])[source]

Bases: NetlistNode

Helper class that provides a standard way to create an ABC using inheritance.

property name: str[source]
netlist(stream: TextIO, netlist_type: pybag.enum.DesignOutput) None[source]
netlist_with_offset(stream: TextIO, used_names: Set[str], offset_map: Dict[str, str], netlist_type: pybag.enum.DesignOutput, ports: List[str], bag_mos: Set[str], pdk_mos: Set[str]) None[source]
_netlist_helper(stream, netlist_type: pybag.enum.DesignOutput, fun: Callable[[NetlistNode], None]) None[source]
class bag.design.netlist.Parser[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract classmethod is_subckt_start(line: str) bool[source]
abstract classmethod is_subckt_end(line: str) bool[source]
abstract classmethod is_comment(line) bool[source]
abstract classmethod parse_instance(tokens: List[str]) Instance[source]
classmethod parse_netlist(lines: List[str]) Netlist[source]
classmethod parse_header(lines: List[str], start: int, stop: int) Header[source]
classmethod parse_subcircuit(lines: List[str], start: int, stop: int) Subcircuit[source]
class bag.design.netlist.ParserCDL[source]

Bases: Parser

Helper class that provides a standard way to create an ABC using inheritance.

prim_prefix[source]
classmethod is_subckt_start(line: str) bool[source]
classmethod is_subckt_end(line: str) bool[source]
classmethod is_comment(line) bool[source]
classmethod parse_instance(tokens: List[str]) Instance[source]
class bag.design.netlist.ParserSpectre[source]

Bases: Parser

Helper class that provides a standard way to create an ABC using inheritance.

classmethod is_subckt_start(line: str) bool[source]
classmethod is_subckt_end(line: str) bool[source]
classmethod is_comment(line) bool[source]
classmethod parse_instance(tokens: List[str]) Instance[source]
bag.design.netlist._read_lines(netlist: pathlib.Path) List[str][source]

Reads the given Spectre or CDL netlist.

This function process line continuation and comments so we don’t have to worry about it.