Netlist Traversal Decorator
- class hal_py.NetlistTraversalDecorator
A netlist decorator that provides functionality to traverse the associated netlist without making any modifications.
- __init__(self: hal_py.NetlistTraversalDecorator, netlist: hal_py.Netlist) None
Construct new NetlistTraversalDecorator object.
- Parameters
netlist (hal_py.Netlist) – The netlist to operate on.
- get_combinational_cone(*args, **kwargs)
Overloaded function.
get_combinational_cone(self: hal_py.NetlistTraversalDecorator, net: hal_py.Net, successors: bool, forbidden_pins: Set[hal_py.PinType] = set()) -> Optional[Set[hal_py.Gate]]
Starting from the given net, collect the combinational cone in the given direction, i.e., the combinational fan-out (
successors = True) or fan-in (successors = False) of the net. Continue traversal as long as further combinational gates are found and stop at gates that are not combinational, so that the cone extends up to (but not including) the sequential boundary. All combinational gates found during traversal are added to the result. Forbidden pins can be provided to, e.g., avoid the inclusion of logic in front of flip-flop control inputs.- param hal_py.Net net
Start net.
- param bool successors
Set
Trueto get the fan-out cone, setFalseto get the fan-in cone.- param set[hal_py.PinType] forbidden_pins
Traversal stops at pins of these types, i.e., gates reached through such a pin are not part of the result. Defaults to an empty set.
- returns
The gates of the combinational cone on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
get_combinational_cone(self: hal_py.NetlistTraversalDecorator, gate: hal_py.Gate, successors: bool, forbidden_pins: Set[hal_py.PinType] = set()) -> Optional[Set[hal_py.Gate]]
Starting from the given gate, collect the combinational cone in the given direction, i.e., the combinational fan-out (
successors = True) or fan-in (successors = False) of the gate. Continue traversal as long as further combinational gates are found and stop at gates that are not combinational, so that the cone extends up to (but not including) the sequential boundary. All combinational gates found during traversal are added to the result. Forbidden pins can be provided to, e.g., avoid the inclusion of logic in front of flip-flop control inputs.- param hal_py.Gate gate
Start gate.
- param bool successors
Set
Trueto get the fan-out cone, setFalseto get the fan-in cone.- param set[hal_py.PinType] forbidden_pins
Traversal stops at pins of these types, i.e., gates reached through such a pin are not part of the result. Defaults to an empty set.
- returns
The gates of the combinational cone on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
- get_common_inputs(self: hal_py.NetlistTraversalDecorator, gates: List[hal_py.Gate], threshold: int = 0) Optional[List[hal_py.Net]]
Get the nets that are inputs to at least
thresholdof the given gates.Shared inputs across a group of gates typically indicate a shared control signal, so this is a cheap way to test whether a set of gates belongs together. Nets driven by GND or VCC gates do not count.
- Parameters
gates (list[hal_py.Gate]) – The gates to inspect.
threshold (int) – The number of gates a net has to feed.
0to require all of them. Defaults to0.
- Returns
The common input nets on success,
Noneotherwise.- Return type
list[hal_py.Net] or None
- get_complex_gate_chain(self: hal_py.NetlistTraversalDecorator, start_gate: hal_py.Gate, chain_types: List[hal_py.GateType], input_pins: Dict[hal_py.GateType, List[hal_py.GatePin]], output_pins: Dict[hal_py.GateType, List[hal_py.GatePin]], filter: Callable[[hal_py.Gate], bool] = None) List[hal_py.Gate]
Find a sequence of gates (of the specified sequence of gate types) that are connected via the specified input and output pins. The start gate may be any gate within a such a sequence, it is not required to be the first or the last gate. However, the start gate must be of the first gate type within the repeating sequence. If input and/or output pins are specified for a gate type, the gates must be connected through one of the input pins and/or one of the output pins. The optional filter is evaluated on every gate such that the result only contains gates matching the specified condition.
- Parameters
start_gate (hal_py.Gate) – The gate at which to start the chain detection.
chain_types (list[hal_py.GateType]) – The sequence of gate types that is expected to make up the gate chain.
input_pins (dict[hal_py.GateType,set[str]]) – The input pins (of every gate type of the sequence) through which the gates must be connected.
output_pins (dict[hal_py.GateType,set[str]]) – The output pins (of every gate type of the sequence) through which the gates must be connected.
filter (lambda) – An optional filter function to be evaluated on each gate.
- Returns
A list of gates that form a chain on success, an empty list on error.
- Return type
- get_gate_chain(self: hal_py.NetlistTraversalDecorator, start_gate: hal_py.Gate, input_pins: List[hal_py.GatePin] = [], output_pins: List[hal_py.GatePin] = [], filter: Callable[[hal_py.Gate], bool] = None) List[hal_py.Gate]
Find a sequence of identical gates that are connected via the specified input and output pins. The start gate may be any gate within a such a sequence, it is not required to be the first or the last gate. If input and/or output pins are specified, the gates must be connected through one of the input pins and/or one of the output pins. The optional filter is evaluated on every gate such that the result only contains gates matching the specified condition.
- Parameters
start_gate (hal_py.Gate) – The gate at which to start the chain detection.
input_pins (list[hal_py.GatePin]) – The input pins through which the gates must be connected. Defaults to an empty list.
output_pins (set[hal_py.GatePin]) – The output pins through which the gates must be connected. Defaults to an empty list.
filter (lambda) – An optional filter function to be evaluated on each gate.
- Returns
A list of gates that form a chain on success, an empty list on error.
- Return type
- get_gates(*args, **kwargs)
Overloaded function.
get_gates(self: hal_py.NetlistTraversalDecorator, gate: hal_py.Gate, cache: hal_py.TraversalCache) -> Optional[Set[hal_py.Gate]]
Traverse the netlist from the given gate, sharing results through the cache: what an earlier call worked out is not walked again.
- param hal_py.Gate gate
The gate to start from.
- param hal_py.TraversalCache cache
The cache holding the traversal and its results.
- returns
The collected gates on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
get_gates(self: hal_py.NetlistTraversalDecorator, net: hal_py.Net, cache: hal_py.TraversalCache) -> Optional[Set[hal_py.Gate]]
Traverse the netlist from the given net, sharing results through the cache: what an earlier call worked out is not walked again.
- param hal_py.Net net
The net to start from.
- param hal_py.TraversalCache cache
The cache holding the traversal and its results.
- returns
The collected gates on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
get_gates(self: hal_py.NetlistTraversalDecorator, gate: hal_py.Gate, direction: hal_py.TraversalDirection, match: Callable[[hal_py.Gate], bool], stop: hal_py.TraversalStop, max_depth: int = 0, exit_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None, entry_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None) -> Optional[Set[hal_py.Gate]]
Traverse the netlist from the given gate, collecting the gates that
matchaccepts.- param hal_py.Gate gate
The gate to start from.
- param hal_py.TraversalDirection direction
The direction to traverse in.
- param lambda match
The condition a gate has to meet to be collected.
- param hal_py.TraversalStop stop
Where to stop traversing, relative to the gates that
matchaccepts.- param int max_depth
The maximum number of gates to traverse through.
0for no limit.- param lambda exit_endpoint_filter
Condition that has to hold to leave a gate.
- param lambda entry_endpoint_filter
Condition that has to hold to enter a gate.
- returns
The collected gates on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
- get_next_matching_gates(*args, **kwargs)
Overloaded function.
get_next_matching_gates(self: hal_py.NetlistTraversalDecorator, net: hal_py.Net, successors: bool, target_gate_filter: Callable[[hal_py.Gate], bool], continue_on_match: bool = False, exit_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None, entry_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None) -> Optional[Set[hal_py.Gate]]
Starting from the given net, traverse the netlist and return only the successor/predecessor gates for which the
target_gate_filterevaluates toTrue. Traverse over gates that do not meet thetarget_gate_filtercondition. Stop traversal if (1)continue_on_matchisFalsethetarget_gate_filterevaluates toTrue, (2) theexit_endpoint_filterevaluates toFalseon a fan-in/out endpoint (i.e., when exiting the current gate during traversal), or (3) theentry_endpoint_filterevaluates toFalseon a successor/predecessor endpoint (i.e., when entering the next gate during traversal). Both theentry_endpoint_filterand theexit_endpoint_filtermay be omitted.- param hal_py.Net net
Start net.
- param bool successors
Set
Trueto get successors, setFalseto get predecessors.- param lambda target_gate_filter
Filter condition that must be met for the target gates.
- param bool continue_on_match
Set
Trueto continue even iftarget_gate_filterevaluated toTrue,Falseotherwise. Defaults toFalse.- param lambda exit_endpoint_filter
Filter condition that determines whether to stop traversal on a fan-in/out endpoint.
- param lambda entry_endpoint_filter
Filter condition that determines whether to stop traversal on a successor/predecessor endpoint.
- returns
The next gates fulfilling the target gate filter condition on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
get_next_matching_gates(self: hal_py.NetlistTraversalDecorator, gate: hal_py.Gate, successors: bool, target_gate_filter: Callable[[hal_py.Gate], bool], continue_on_match: bool = False, exit_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None, entry_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None) -> Optional[Set[hal_py.Gate]]
Starting from the given gate, traverse the netlist and return only the successor/predecessor gates for which the
target_gate_filterevaluates toTrue. Traverse over gates that do not meet thetarget_gate_filtercondition. Stop traversal if (1)continue_on_matchisFalsethetarget_gate_filterevaluates toTrue, (2) theexit_endpoint_filterevaluates toFalseon a fan-in/out endpoint (i.e., when exiting the current gate during traversal), or (3) theentry_endpoint_filterevaluates toFalseon a successor/predecessor endpoint (i.e., when entering the next gate during traversal). Both theentry_endpoint_filterand theexit_endpoint_filtermay be omitted.- param hal_py.Gate gate
Start gate.
- param bool successors
Set
Trueto get successors, setFalseto get predecessors.- param lambda target_gate_filter
Filter condition that must be met for the target gates.
- param bool continue_on_match
Set
Trueto continue even iftarget_gate_filterevaluated toTrue,Falseotherwise. Defaults toFalse.- param lambda exit_endpoint_filter
Filter condition that determines whether to stop traversal on a fan-in/out endpoint.
- param lambda entry_endpoint_filter
Filter condition that determines whether to stop traversal on a successor/predecessor endpoint.
- returns
The next gates fulfilling the target gate filter condition on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
- get_next_matching_gates_until(*args, **kwargs)
Overloaded function.
get_next_matching_gates_until(self: hal_py.NetlistTraversalDecorator, net: hal_py.Net, successors: bool, target_gate_filter: Callable[[hal_py.Gate], bool], continue_on_mismatch: bool = False, exit_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None, entry_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None) -> Optional[Set[hal_py.Gate]]
Starting from the given net, traverse the netlist and return only the successor/predecessor gates for which the
target_gate_filterevaluates toTrue. Continue traversal independent of whatevertarget_gate_filterevaluates to. Stop traversal if (1)continue_on_mismatchisFalsethetarget_gate_filterevaluates toFalse, (2) theexit_endpoint_filterevaluates toFalseon a fan-in/out endpoint (i.e., when exiting the current gate during traversal), or (3) theentry_endpoint_filterevaluates toFalseon a successor/predecessor endpoint (i.e., when entering the next gate during traversal). Bothentry_endpoint_filterand theexit_endpoint_filtermay be omitted.- param hal_py.Net net
Start net.
- param bool successors
Set
Trueto get successors, setFalseto get predecessors.- param lambda target_gate_filter
Filter condition that must be met for the target gates.
- param bool continue_on_mismatch
Set
Trueto continue even iftarget_gate_filterevaluated toFalse,Falseotherwise. Defaults toFalse.- param lambda exit_endpoint_filter
Filter condition that determines whether to stop traversal on a fan-in/out endpoint.
- param lambda entry_endpoint_filter
Filter condition that determines whether to stop traversal on a successor/predecessor endpoint.
- returns
The next gates fulfilling the target gate filter condition on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
get_next_matching_gates_until(self: hal_py.NetlistTraversalDecorator, gate: hal_py.Gate, successors: bool, target_gate_filter: Callable[[hal_py.Gate], bool], continue_on_mismatch: bool = False, exit_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None, entry_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None) -> Optional[Set[hal_py.Gate]]
Starting from the given gate, traverse the netlist and return only the successor/predecessor gates for which the
target_gate_filterevaluates toTrue. Continue traversal independent of whatevertarget_gate_filterevaluates to. Stop traversal if (1)continue_on_mismatchisFalsethetarget_gate_filterevaluates toFalse, (2) theexit_endpoint_filterevaluates toFalseon a fan-in/out endpoint (i.e., when exiting the current gate during traversal), or (3) theentry_endpoint_filterevaluates toFalseon a successor/predecessor endpoint (i.e., when entering the next gate during traversal). Bothentry_endpoint_filterand theexit_endpoint_filtermay be omitted.- param hal_py.Gate gate
Start gate.
- param bool successors
Set
Trueto get successors, setFalseto get predecessors.- param lambda target_gate_filter
Filter condition that must be met for the target gates.
- param bool continue_on_mismatch
Set
Trueto continue even iftarget_gate_filterevaluated toFalse,Falseotherwise. Defaults toFalse.- param lambda exit_endpoint_filter
Filter condition that determines whether to stop traversal on a fan-in/out endpoint.
- param lambda entry_endpoint_filter
Filter condition that determines whether to stop traversal on a successor/predecessor endpoint.
- returns
The next gates fulfilling the target gate filter condition on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
- get_next_matching_gates_until_depth(*args, **kwargs)
Overloaded function.
get_next_matching_gates_until_depth(self: hal_py.NetlistTraversalDecorator, net: hal_py.Net, successors: bool, max_depth: int, target_gate_filter: Callable[[hal_py.Gate], bool] = None) -> Optional[Set[hal_py.Gate]]
Starting from the given net, traverse the netlist and return only the successor/predecessor gates for which the
target_gate_filterevaluates toTrue. Continue traversal independent of whatevertarget_gate_filterevaluates to. Stop traversal if the specified depth is reached. The current depth is counted starting at 1 for the destinations of the provided net. For amax_depthof0, all gates between the start net and the global netlist outputs will be traversed. The target_gate_filter may be omitted in which case all traversed gates will be returned.- param hal_py.Net net
Start net.
- param bool successors
Set
Trueto get successors, setFalseto get predecessors.- param int max_depth
The maximum depth for netlist traversal starting from the start net.
- param lambda target_gate_filter
Filter condition that must be met for the target gates.
- returns
The next gates fulfilling the target gate filter condition on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
get_next_matching_gates_until_depth(self: hal_py.NetlistTraversalDecorator, gate: hal_py.Gate, successors: bool, max_depth: int, target_gate_filter: Callable[[hal_py.Gate], bool] = None) -> Optional[Set[hal_py.Gate]]
Starting from the given gate, traverse the netlist and return only the successor/predecessor gates for which the
target_gate_filterevaluates toTrue. Continue traversal independent of whatevertarget_gate_filterevaluates to. Stop traversal if the specified depth is reached. The current depth is counted starting at 1 for the direct successors/predecessors of the provided gate. For amax_depthof0, all gates between the start gate and the global netlist outputs will be traversed. The target_gate_filter may be omitted in which case all traversed gates will be returned.- param hal_py.Gate gate
Start gate.
- param bool successors
Set
Trueto get successors, setFalseto get predecessors.- param int max_depth
The maximum depth for netlist traversal starting from the start gate.
- param lambda target_gate_filter
Filter condition that must be met for the target gates.
- returns
The next gates fulfilling the target gate filter condition on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
- get_next_sequential_gates(*args, **kwargs)
Overloaded function.
get_next_sequential_gates(self: hal_py.NetlistTraversalDecorator, net: hal_py.Net, successors: bool, forbidden_pins: Set[hal_py.PinType] = set()) -> Optional[Set[hal_py.Gate]]
Starting from the given net, traverse the netlist and return only the next layer of sequential successor/predecessor gates. Traverse over gates that are not sequential until a sequential gate is found. Stop traversal at all sequential gates, but only adds those to the result that have not been reached through a pin of one of the forbidden types.
- param hal_py.Net net
Start net.
- param bool successors
Set
Trueto get successors, setFalseto get predecessors.- param set[hal_py.PinType] forbidden_pins
Sequential gates reached through these pins will not be part of the result. Defaults to an empty set.
- returns
The next sequential gates on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
get_next_sequential_gates(self: hal_py.NetlistTraversalDecorator, gate: hal_py.Gate, successors: bool, forbidden_pins: Set[hal_py.PinType] = set()) -> Optional[Set[hal_py.Gate]]
Starting from the given gate, traverse the netlist and return only the next layer of sequential successor/predecessor gates. Traverse over gates that are not sequential until a sequential gate is found. Stop traversal at all sequential gates, but only adds those to the result that have not been reached through a pin of one of the forbidden types.
- param hal_py.Gate gate
Start gate.
- param bool successors
Set
Trueto get successors, setFalseto get predecessors.- param set[hal_py.PinType] forbidden_pins
Sequential gates reached through these pins will not be part of the result.
- returns
The next sequential gates on success,
Noneotherwise.- rtype
set[hal_py.Gate] or None
- get_next_sequential_gates_map(self: hal_py.NetlistTraversalDecorator, successors: bool, forbidden_pins: Set[hal_py.PinType]) Optional[Dict[hal_py.Gate, Set[hal_py.Gate]]]
Get the next sequential gates for all sequential gates in the netlist by traversing through remaining logic (e.g., combinational logic). Compute a dict from a sequential gate to all its successors. Stop traversal at all sequential gates, but only adds those to the result that have not been reached through a pin of one of the forbidden types.
- Parameters
successors (bool) – Set
Trueto get successors, setFalseto get predecessors.forbidden_pins (set[hal_py.PinType]) – Sequential gates reached through these pins will not be part of the result.
- Returns
A dict from each sequential gate to all its sequential successors on success,
Noneotherwise.- Return type
dict[hal_py.Gate,set[hal_py.Gate]] or None
- get_shortest_path(*args, **kwargs)
Overloaded function.
get_shortest_path(self: hal_py.NetlistTraversalDecorator, start_gate: hal_py.Gate, end_gate: hal_py.Gate, direction: hal_py.PinDirection, exit_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None, entry_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None) -> Optional[List[hal_py.Gate]]
Find the shortest path (i.e., the smallest number of gates) that connects the start gate with the end gate. The gate where the search started from will be the first in the result list, the end gate will be the last. If there is no such path,
Noneis returned. If there is more than one path with the same length, only the first one is returned.- param hal_py.Gate start_gate
The gate to start from.
- param hal_py.Gate end_gate
The gate to connect to.
- param hal_py.PinDirection direction
The direction to search in. Can be
hal_py.PinDirection.input,hal_py.PinDirection.outputorhal_py.PinDirection.inoutto search both directions and return the shorter one.- param lambda exit_endpoint_filter
Filter condition that determines whether to stop traversal on a fan-in/out endpoint.
- param lambda entry_endpoint_filter
Filter condition that determines whether to stop traversal on a successor/predecessor endpoint.
- returns
A list of gates that connect the start with end gate on success,
Noneotherwise.- rtype
list[hal_py.Gate] or None
get_shortest_path(self: hal_py.NetlistTraversalDecorator, start_gate: hal_py.Gate, end_module: hal_py.Module, direction: hal_py.PinDirection, exit_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None, entry_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None) -> Optional[List[hal_py.Gate]]
Find the shortest path that connects the start gate with any gate of the given module.
- param hal_py.Gate start_gate
The gate to start from.
- param hal_py.Module end_module
The module to connect to. Gates of its submodules count as belonging to it.
- param hal_py.PinDirection direction
The direction to search in.
- param lambda exit_endpoint_filter
Filter condition that determines whether to stop traversal on a fan-in/out endpoint.
- param lambda entry_endpoint_filter
Filter condition that determines whether to stop traversal on a successor/predecessor endpoint.
- returns
The path on success,
Noneotherwise.- rtype
list[hal_py.Gate] or None
get_shortest_path(self: hal_py.NetlistTraversalDecorator, start_module: hal_py.Module, end_module: hal_py.Module, direction: hal_py.PinDirection, exit_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None, entry_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None) -> Optional[List[List[hal_py.Gate]]]
Find every shortest path that connects the start module with the end module.
- param hal_py.Module start_module
The module to start from. Gates of its submodules count as belonging to it.
- param hal_py.Module end_module
The module to connect to. Gates of its submodules count as belonging to it.
- param hal_py.PinDirection direction
The direction to search in.
- param lambda exit_endpoint_filter
Filter condition that determines whether to stop traversal on a fan-in/out endpoint.
- param lambda entry_endpoint_filter
Filter condition that determines whether to stop traversal on a successor/predecessor endpoint.
- returns
The shortest paths on success,
Noneotherwise.- rtype
list[list[hal_py.Gate]] or None
- get_shortest_path_distance(self: hal_py.NetlistTraversalDecorator, start_gate: hal_py.Gate, end_gate: hal_py.Gate, direction: hal_py.PinDirection, exit_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None, entry_endpoint_filter: Callable[[hal_py.Endpoint, int], bool] = None) Optional[int]
Find the length of the shortest path (i.e., the smallest number of gates) that connects the start gate with the end gate. If there is no such path,
Noneis returned. Computing only the shortest distance to a gate is faster than computing the shortest path, since it does not have to keep track of the path to reach each gate.- Parameters
start_gate (hal_py.Gate) – The gate to start from.
end_gate (hal_py.Gate) – The gate to connect to.
direction (hal_py.PinDirection) – The direction to search in. Can be
hal_py.PinDirection.input,hal_py.PinDirection.outputorhal_py.PinDirection.inoutto search both directions and return the shorter one.exit_endpoint_filter (lambda) – Filter condition that determines whether to stop traversal on a fan-in/out endpoint.
entry_endpoint_filter (lambda) – Filter condition that determines whether to stop traversal on a successor/predecessor endpoint.
- Returns
The shortest distance between the start and end gate on success,
Noneotherwise.- Return type
- make_traversal_cache(self: hal_py.NetlistTraversalDecorator, direction: hal_py.TraversalDirection, match: Callable[[hal_py.Gate], bool], stop: hal_py.TraversalStop, exit_endpoint_filter: Callable[[hal_py.Endpoint], bool] = None, entry_endpoint_filter: Callable[[hal_py.Endpoint], bool] = None) hal_py.TraversalCache
Create a cache for one specific traversal, to be handed to
get_gatesin place of the traversal’s parameters.The direction must be
TraversalDirection.forwardorbackward. The endpoint filters receive no depth and there is no depth limit, as either would make the cached answers depend on how a net was reached.- Parameters
direction (hal_py.TraversalDirection) – The direction to traverse in.
match (lambda) – The condition a gate has to meet to be collected.
stop (hal_py.TraversalStop) – Where to stop traversing, relative to the gates that
matchaccepts.exit_endpoint_filter (lambda) – Condition that has to hold to leave a gate.
entry_endpoint_filter (lambda) – Condition that has to hold to enter a gate.
- Returns
The cache.
- Return type
- class hal_py.TraversalDirection
The direction in which a netlist is traversed.
Members:
forward : Follow the fan-out, i.e., towards the successors of a gate.
backward : Follow the fan-in, i.e., towards the predecessors of a gate.
both : Follow both directions.
- property name
- class hal_py.TraversalStop
Where a traversal stops relative to the gates it is looking for.
Members:
at_match : Stop at a gate the filter accepts, so the collected gates bound the search.
at_mismatch : Stop at a gate the filter rejects, so the collected gates form a connected region.
never : Do not stop at a gate; bound the traversal with a depth or the endpoint filters.
- property name
- class hal_py.TraversalCache
A reusable store for the results of one specific traversal, handed to
NetlistTraversalDecorator.get_gates.The traversal a cache belongs to is sealed in when it is created and the cache can only ever be used for exactly that traversal, which is what makes reuse sound. Create one with
NetlistTraversalDecorator.make_traversal_cacheand drop it when the netlist is modified.