API Summary

Basic object types

The following three classes are the classes from which the above elements inherit. They are included here for completeness of documentation and can be used if needed. If the above types will suffice it may be simpler to use them.

Pin()

Bundle()

Element()

FirstClassElement()

Getter Functions

get_netlists(obj, ...)

Get netlists within an object.

get_libraries(obj, ...)

Get libraries within an object.

get_definitions(obj, ...)

Get definitions within an object.

get_ports(obj, ...)

Get ports within an object.

get_pins(obj, ...)

Get pins within an object.

get_cables(obj, ...)

Get cables within an object.

get_wires(obj, ...)

Get wires within an object.

get_instances(obj, ...)

Get instances within an object.

get_hinstances(obj, ...)

Get hierarchical references to instances within an object.

get_hports(obj, ...)

Get hierarchical references to ports within an object.

get_hpins(obj, ...)

Get hierarchical references to wires within an object.

get_hcables(obj, ...)

Get hierarchical references to cables within an object.

get_hwires(obj, ...)

Get hierarchical references to wires within an object.

Other Functions

parse(filename[, architecture])

The parse function is able to parse an EDIF (.edf) file, a Verilog file (.v), or an EBLIF file (.eblif).

compose(netlist, filename[, ...])

To compose a file into a netlist format

flatten(netlist)

starts at the top instance and brings all the different subelements to the top level.

uniquify(netlist)

Make the instances in the netlist unique Uniqification is done in place. Each instance will correspond to exactly one definition and each definition will correspond to exactly one instance with the exception of leaf cells. Leaf cells are can be instanced unlimited numbers of times. Any netlist elements that are not instantiated by the top instance will not be modified and may retain duplicate instances Currently there is no guarantee that the original definition names will be maintained, but it is guaranteed that they will be unique within the scope of all hardware that is below the top instance.

clone(element)

Clone any netlist objects

Shortcuts

In Summary

The SpyDrNet API can be used to create, analyze, and transform a netlist. Netlist are represented in memory in an Intermediate Representation. Fig. 5 show the representation of a simple circuit in the SpyDrNet Intermediate Representation. If you would like an example of using the SpyDrNet tool to create a netlist like this, click here

Example Netlist in a SpyDrNet Intermediate Representation

Fig. 5 Example Netlist in the Intermediate Representaion

The API calls documented here can be used in Python as follows:

>>> # create an empty netlist and add an empty library to it
>>> import spydrnet as sdn
>>> netlist = sdn.ir.Netlist()
>>> library = netlist.create_library()
>>>

If the parser is used, the calls can be made in the same way:

>>> # parse an edif file in and add an empty library to the netlist.
>>> import spydrnet as sdn
>>> netlist = sdn.parse('four_bit_counter.edf')
>>> library = netlist.create_library
>>>