Definition¶
- class spydrnet_physical.ir.definition.Definition(name=None, properties=None)[source]¶
Bases:
DefinitionExtending the definitions representation
Methods:
Creates an empty object of type definition
Remove a cable from the definition.
Remove port from the definition.
Alias to create_feedthroughs_ports
Given the cable object it creates a feedthrough ports on this definition
Creates a feedthrough for a single cable passing through list of instances
create_parallel_feedthroughAlias to create_feedthrough_multiple
This creates feedthough from list of instances on multiple locations Expects the list of tuples in following format
This method can merge multiple group of instances having same order of reference definition.
Merges the list of instances to unique definition
This method optimizes the definitions pins bu inspecting all the instances of the definition
List the wires which can be optimised based on different constraints
Duplicates existing port in the definition Uses assign block beetween to short two cables If post in output port
assign new_port = initial_portelseassign initial_port = new_portCombines multiple cables to new cable.
This method can combine multiple input or output ports togther to create a bus structure.
Split the given port into multiple ports This is used to split the fanout ports
create_unconn_wiresmerge_portsSplit the given port
Flatterns single instance in the given definition
This method converts current module into networkx graph each cell is represented as as node and nets are represented as edges
clone the definition and point the reference to the new definition
Adds buffer on the given net :Parameters: * wire (sdn.Wire, sdn.Cable) -- Cable or a wire to be buffered * buffer (str) * instance_name (sdn.Instance) * ports tuple (str, str)
add_cableAdd a cable to the definition.
add_childAdd an existing instance to the definition.
add_portAdd a preexisting port to the definition.
clean_single_bit_assigncloneClone the definition in an api safe way.
create_cableCreate a cable, add it to the definition, and return the cable.
create_childCreate an instance to add to the definition, add it, and return the instance.
create_portCreate a port, add it to the definition, and return that port.
getget the item from the data structure
get_cablesget_cables(...)
get_definitionsget_definitions(...)
get_hcablesget_hcables(...)
get_hinstancesget_hinstances(...)
get_hpinsget_hpins(...)
get_hportsget_hports(...)
get_hwiresget_hwires(...)
get_instancesget_instances(...)
get_librariesget_libraries(...)
get_netlistsget_netlists(...)
get_pinsget_pins(...)
get_portsget_ports(...)
get_wiresget_wires(...)
is_leafCheck to see if this definition represents a leaf cell.
poppop the object from the data structure
remove_cables_fromRemove a set of cables from the definition.
remove_childRemove an instance from the definition.
remove_children_fromRemove a set of instances from the definition.
remove_ports_fromRemove a set of ports from the definition.
somhingAttributes:
Return utilization of this module
areacablesGet the cables that are instanced in this definition.
childrenReturn a list of all instances instantiated in this definition
dataData stores information about the element
get_indexReturns python index of element
get_verilog_indexReturns verilog index of element
libraryGet the library that contains this definition
nameThe name of this element
portsGet the ports that are instanced in this definition
propertiesReturns properties of the object
referencesGet a list of all the instances of this definition
- __init__(name=None, properties=None)[source]¶
Creates an empty object of type definition
- Parameters:
name - (str) the name of this instance
properties - (dict) the dictionary which holds the properties
- property utilization¶
Return utilization of this module
- remove_cable(cable)[source]¶
Remove a cable from the definition.
The cable must be a member of the definition.
- Parameters:
cable - (Cable) the cable to be removed from the definition
- remove_port(port)[source]¶
Remove port from the definition. (Overrides the base method)
- Parameters:
port ((Port) the port to be removed, must be of this definition)
- create_feedthroughs_ports(cable, suffix='ft', get_port_names=<function Definition.<lambda>>)[source]¶
Given the cable object it creates a feedthrough ports on this definition
The new ports names as {cable_name}_{suffix}_in and {cable_name}_{suffix}_out - Direct assignment is created beetween newly added two ports
- Parameters:
cable (Port) – The cable for which feedthrough needs to be created
suffix (str) – Sufffix used for the port naming
get_port_names (callable) – function to return custom names get_port_names(sdn.IN or sdn.out)
- Returns:
Feedthrough port (inport and outport)
- Return type:
tuple
- create_feedthrough(instances_list, cable, get_port_names=<function Definition.<lambda>>, get_cable_names=<function Definition.<lambda>>)[source]¶
Creates a feedthrough for a single cable passing through list of instances
The driver cable name is unchanged and newly created feedthrough cable name {cable_name}_ft_{indx}
- Parameters:
instances_list (list[instance]) – List of instances to create feedthrough from
cable (Cable) – cable fro which feedthrough needs to be creared
get_port_names (callable) – –
get_cable_names (callable) – –
- Returns:
List of newly created cables in order
- Return type:
list(Cable)
- create_feedthrough_multiple(instances_list)[source]¶
This creates feedthough from list of instances on multiple locations Expects the list of tuples in following format
- Parameters:
instances_list ((Cable, (inst1, inst1, … .instn))
- merge_multiple_instance(instances_list_tuple, new_definition_name=None, pin_map=None)[source]¶
This method can merge multiple group of instances having same order of reference definition.
First pair of the instances_list_tuple is used to create new definition and that is reused while grouping remaining group of instances
- Parameters:
instances_list_tuple = [ (inst_1, inst_2, …., inst_n)
new_definition_name (str)
pin_map (Callable)
- merge_instance(instances_list, new_definition_name='', new_instance_name='', pin_map=None)[source]¶
Merges the list of instances to unique definition
- Parameters:
instances_list (List(Instance)) – List of instances to be merged
new_definition_name – Name of the new definition created
new_instance_name – Name of the new instance created
pin_map (Callable, Dict) – External function to map new pin name based in definition and instance name get_pin_name(<definition_name:<str>, <pin_name:<str>, <instance_name:<str>)
- Returns:
(Definition, Instance, Dict)
- OptPins(pins=<function Definition.<lambda>>, dry_run=False, merge=True, absorb=True, remove_unconn=False)[source]¶
This method optimizes the definitions pins bu inspecting all the instances of the definition
- Parameters:
dry_run (Just performs the dryrun and list the pins which can be merged or absorbed)
pins (only consider specific pins, provide filter function)
absorb (if two pins are only connected to each other they will be absorbed and internal connection will be made)
merge (if two pins are connected to each other and few other instances, one of the pin will be absorbed and other will exist)
remove_unconn (Remove unconnected pins)
- OptWires(no_load=True, no_driver=False, floating=True)[source]¶
List the wires which can be optimised based on different constraints
- Parameters:
no_load ((bool) (Default: True) Wires without load pin)
no_driver ((bool) (Default: False) Wires without drivers pin)
floating ((bool) (Default: True) Wires without any connection to pin)
- duplicate_port(port, port_name=None)[source]¶
Duplicates existing port in the definition Uses assign block beetween to short two cables If post in output port
assign new_port = initial_portelseassign initial_port = new_port- Parameters:
port ((Port) Port of this definition)
port_name ((str) Options New port name (default {port_name}_dup))
- combine_cables(new_cable_name, cables, quiet=False)[source]¶
Combines multiple cables to new cable. Helpful in creating Bus/Vector from scalar wires
- Parameters:
new_cable_name ((str) New cable name)
cables ((list[Cable]) List of cables)
quiet ((bool) Do not raise error if no cables are passed)
- combine_ports(port_name, ports, is_downto=False)[source]¶
This method can combine multiple input or output ports togther to create a bus structure.
It does create a cable for internal wires, but does not change anything about the external wire connection ports[0] will be newport[0] default properties will be used for creating a new port
- Parameters:
port_name (str) – Name of the new port
ports (list[Ports]) – List of ports to combine
- Returns:
return new port and internal cable
- Return type:
(new_port, new_cable)
- split_port_fanout(port, port_names=None)[source]¶
Split the given port into multiple ports This is used to split the fanout ports
- split_port(port)[source]¶
Split the given port
- Parameters:
port (Port) – Definition port to split into independent pins
- get_connectivity_network(get_weights=None, split_ports=False)[source]¶
This method converts current module into networkx graph each cell is represented as as node and nets are represented as edges
Netowrkx should be installed
Higher fanout nets are represented with independent edge from driver
to each load