Scheme API for retrieving netlist information. More...
Functions | |
def | check_argument_type |
Helper function for checking the type of an API function argument. More... | |
def | spicified_net_name |
Return the net name visible through the API. More... | |
def | get_packages |
Return a list of all package refdes's in the design. More... | |
def | get_non_unique_packages |
Return a list of all package refdes's in the design; might return duplicates. More... | |
def | get_pins |
Return a list of pin numbers for a given package. More... | |
def | get_all_nets |
Return a list of all net names in the design; might return duplicates. More... | |
def | get_all_unique_nets |
Return a list of all net names in the design. More... | |
def | get_all_connections |
Return a list of pins connected to the a given net. More... | |
def | get_nets |
Return the net to which a given pin is connected and a list of pins graphically connected to it. More... | |
def | get_pins_nets |
Return a list of pairs (pinnumber, netname) for a given package. More... | |
def | get_all_package_attributes |
Get attribute value(s) from a package with given refdes. More... | |
def | get_toplevel_attribute |
Return value of attribute, otherwise string "not found" . More... | |
def | get_attribute_by_pinseq |
Take a refdes and pinseq number and return wanted_attribute associated with that pinseq pin and component. More... | |
def | get_attribute_by_pinnumber |
Take a pin number and return the appropriate attribute on that pin. More... | |
def | vams_get_package_attributes |
def | graphical_objs_in_net_with_attrib_get_attrib |
Given a net name, an attribute, and a wanted attribute, return all the given attribute of all the graphical objects connected to that net. More... | |
def | get_backend_arguments |
Obtain a list of `-O' backend arguments. More... | |
def | get_input_files |
Get input files from command line. More... | |
def | get_verbosity |
Indicate the verbosity level for messages. More... | |
Variables | |
the_netlist = None | |
Global netlist object. More... | |
the_backend_arguments = None | |
Global backend argument list. More... | |
the_verbosity = None | |
Global backend verbosity flag. More... | |
the_spice_mode = None | |
Whether to return net names appropriate for SPICE backends. More... | |
Scheme API for retrieving netlist information.
This module mirrors the gnetlist Scheme API which exposes the results of a netlister run to a netlist backend written in Scheme. For each gnetlist API function, this module contains an equivalent Python function and makes it available by creating a top-level Scheme binding.
The gnetlist API included a function gnetlist:get-renamed-nets
which returned a list of "renamed nets" and could be used to unit test the internals of the netlister. Due to the way nets are handled, the concept of a "renamed net" isn't applicable and this function isn't supported any more.
Some functions take a dummy argument "level" which must be a string but is otherwise ignored.
def xorn.geda.netlist.guile.check_argument_type | ( | fun, | |
i, | |||
arg, | |||
t | |||
) |
Helper function for checking the type of an API function argument.
When constructing an error message, fun and i are used to indicate the API function and argument index, respectively.
TypeError | if arg is not an instance of t or of a subclass thereof |
def xorn.geda.netlist.guile.get_all_connections | ( | wanted_net_name | ) |
Return a list of pins connected to the a given net.
For each pin, a pair (refdes, pinnumber)
is returned.
If wanted_net_name doesn't refer to an existing net, an empty list is returned.
For historical reasons, this function returns its results in reversed order.
def xorn.geda.netlist.guile.get_all_nets | ( | level | ) |
Return a list of all net names in the design; might return duplicates.
Walks through the list of components (skipping power symbols) and through the list of individual pins on each component (skipping unconnected pins), and returns a list of the names of all found nets.
Due to the way hierarchy is handled in the new netlisting code, subsheet symbols and ports aren't part of the finished netlist. Therefore, when using hierarchical schematics, this function doesn't return some of the net name duplications the old function did.
For historical reasons, this function returns its results in reversed order.
def xorn.geda.netlist.guile.get_all_package_attributes | ( | refdes, | |
wanted_attrib | |||
) |
Get attribute value(s) from a package with given refdes.
This function returns the values of a specific attribute type attached to the symbol instances with the given refdes.
Every first attribute value found is added to the return list. False
is added if the instance has no such attribute.
This function does not return its results in reversed order.
[in] | refdes | package reference |
[in] | wanted_attrib | attribute name |
False
def xorn.geda.netlist.guile.get_all_unique_nets | ( | level | ) |
def xorn.geda.netlist.guile.get_attribute_by_pinnumber | ( | refdes, | |
pin, | |||
wanted_attrib | |||
) |
def xorn.geda.netlist.guile.get_attribute_by_pinseq | ( | refdes, | |
pinseq, | |||
wanted_attrib | |||
) |
def xorn.geda.netlist.guile.get_backend_arguments | ( | ) |
def xorn.geda.netlist.guile.get_input_files | ( | ) |
def xorn.geda.netlist.guile.get_nets | ( | wanted_refdes, | |
wanted_pin | |||
) |
Return the net to which a given pin is connected and a list of pins graphically connected to it.
The result is a pair (netname, [(refdes, pin), (refdes, pin), ...]
).
If wanted_refdes and wanted_pin don't refer to an existing pin, the pair ('ERROR_INVALID_PIN', None)
is returned.
Reflecting the behavior of gnetlist:get-nets
, this function doesn't return the pin itself if it isn't connected to anything.
For historical reasons, this function returns the list in reversed order.
def xorn.geda.netlist.guile.get_non_unique_packages | ( | level | ) |
Return a list of all package refdes's in the design; might return duplicates.
Walks through the list of components and returns a list of each component's refdes. Power symbols don't have a refdes and are skipped.
For historical reasons, this function returns its results in reversed order.
def xorn.geda.netlist.guile.get_packages | ( | level | ) |
def xorn.geda.netlist.guile.get_pins | ( | refdes | ) |
def xorn.geda.netlist.guile.get_pins_nets | ( | wanted_refdes | ) |
Return a list of pairs (pinnumber, netname)
for a given package.
Each pair contains the name of a pin of that package and the name of the net connected to that pin.
If refdes doesn't refer to an existing package, an empty list is returned.
This function does not return its results in reversed order.
def xorn.geda.netlist.guile.get_toplevel_attribute | ( | wanted_attrib | ) |
def xorn.geda.netlist.guile.get_verbosity | ( | ) |
def xorn.geda.netlist.guile.graphical_objs_in_net_with_attrib_get_attrib | ( | wanted_net_name, | |
has_attrib, | |||
wanted_attrib | |||
) |
def xorn.geda.netlist.guile.spicified_net_name | ( | net | ) |
Return the net name visible through the API.
If the name of the invoked backend starts with "spice"
, gnetlist
omits the "unnamed_net"
net name prefix. Here, however, the generated netlist is independent of the backend, so the API needs to fix up the net name before passing it to the backend.
If the_spice_mode isn't true when evaluated in a boolean context, this function just returns net.name.
def xorn.geda.netlist.guile.vams_get_package_attributes | ( | refdes | ) |
xorn.geda.netlist.guile.the_backend_arguments = None |
xorn.geda.netlist.guile.the_netlist = None |
xorn.geda.netlist.guile.the_spice_mode = None |
Whether to return net names appropriate for SPICE backends.
Set this to True
or False
depending on whether the backend expects the API functions to return SPICE net names.