Net
- class hal_py.Net
Bases:
hal_py.DataContainer
Net class containing information about a net including its source and destination.
- add_destination(*args, **kwargs)
Overloaded function.
add_destination(self: hal_py.Net, gate: hal_py.Gate, pin_name: str) -> hal_py.Endpoint
Add a destination endpoint to the net. The endpoint is specified by a tuple of a gate and the name of an input pin of that gate.
- param hal_py.Gate gate
The gate.
- param str pin_name
The name of an input pin of the gate.
- returns
The endpoint on success, None otherwise.
- rtype
hal_py.Endpoint or None
add_destination(self: hal_py.Net, gate: hal_py.Gate, pin: hal_py.GatePin) -> hal_py.Endpoint
Add a destination endpoint to the net. The endpoint is specified by a tuple of a gate and an input pin of that gate.
- param hal_py.Gate gate
The gate.
- param str pin_name
The input pin of the gate.
- returns
The endpoint on success, None otherwise.
- rtype
hal_py.Endpoint or None
- add_source(*args, **kwargs)
Overloaded function.
add_source(self: hal_py.Net, gate: hal_py.Gate, pin_name: str) -> hal_py.Endpoint
Add a source endpoint to the net. The endpoint is specified by a tuple of a gate and the name of an output pin of that gate.
- param hal_py.Gate gate
The gate.
- param str pin_name
The name of an output pin of the gate.
- returns
The endpoint on success, None otherwise.
- rtype
hal_py.Endpoint or None
add_source(self: hal_py.Net, gate: hal_py.Gate, pin: hal_py.GatePin) -> hal_py.Endpoint
Add a source endpoint to the net. The endpoint is specified by a tuple of a gate and an output pin of that gate.
- param hal_py.Gate gate
The gate.
- param hal_py.GatePin pin
The output pin of the gate.
- returns
The endpoint on success, None otherwise.
- rtype
hal_py.Endpoint or None
- property data
A dict from ((1) category, (2) key) to ((1) type, (2) value) containing all stored data entries.
- delete_data(self: hal_py.DataContainer, category: str, key: str, log_with_info_level: bool = False) bool
Delete a data entry.
- property destinations
A list of destinations of the net.
- Type
- get_data(self: hal_py.DataContainer, category: str, key: str) Tuple[str, str]
Get the data entry specified by the given category and key.
- get_data_map(self: hal_py.DataContainer) Dict[Tuple[str, str], Tuple[str, str]]
Get a dict from ((1) category, (2) key) to ((1) type, (2) value) containing all stored data entries.
- get_destinations(self: hal_py.Net, filter: Callable[[hal_py.Endpoint], bool] = None) List[hal_py.Endpoint]
Get a vector of destinations of the net. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
- Parameters
filter – An optional filter.
- Returns
A list of destination endpoints.
- Return type
- get_grouping(self: hal_py.Net) hal::Grouping
Get the grouping in which this net is contained. If no grouping contains this gate, None is returned.
- Returns
The grouping.
- Return type
- get_id(self: hal_py.Net) int
Get the unique id of the net.
- Returns
The unique id.
- Return type
- get_name(self: hal_py.Net) str
Get the name of the net.
- Returns
The name.
- Return type
- get_netlist(self: hal_py.Net) hal_py.Netlist
Get the netlist this net is associated with.
- Returns
The netlist.
- Return type
- get_num_of_destinations(self: hal_py.Net, filter: Callable[[hal_py.Endpoint], bool] = None) int
Get the number of destinations of the net. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
- Parameters
filter – An optional filter.
- Returns
The number of destinations.
- Return type
- get_num_of_sources(self: hal_py.Net, filter: Callable[[hal_py.Endpoint], bool] = None) int
Get the number of sources of the net. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
- Parameters
filter (lambda) – An optional filter.
- Returns
The number of sources.
- Return type
- get_sources(self: hal_py.Net, filter: Callable[[hal_py.Endpoint], bool] = None) List[hal_py.Endpoint]
Get a list of sources of the net. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
- Parameters
filter (lambda) – An optional filter.
- Returns
A list of source endpoints.
- Return type
- has_data(self: hal_py.DataContainer, category: str, key: str) bool
Determine whether an entry of given category and key exists.
- is_a_destination(*args, **kwargs)
Overloaded function.
is_a_destination(self: hal_py.Net, gate: hal_py.Gate) -> bool
Check whether a gate is a destination of the net independent of the pin.
- param hal_py.Gate gate
The gate.
- returns
True if the gate is a destination of the net, False otherwise.
- rtype
bool
is_a_destination(self: hal_py.Net, gate: hal_py.Gate, pin_name: str) -> bool
Check whether an endpoint is a destination of the net. The endpoint is specified by a tuple of a gate and the name of an input pin of that gate.
- param hal_py.Gate gate
The gate.
- param str pin_name
The name of an input pin of the gate.
- returns
True if the endpoint is a destination of the net, False otherwise.
- rtype
bool
is_a_destination(self: hal_py.Net, gate: hal_py.Gate, pin: hal_py.GatePin) -> bool
Check whether an endpoint is a destination of the net. The endpoint is specified by a tuple of a gate and an input pin of that gate.
- param hal_py.Gate gate
The gate.
- param hal_py.GatePin pin
The input pin of the gate.
- returns
True if the endpoint is a destination of the net, False otherwise.
- rtype
bool
is_a_destination(self: hal_py.Net, ep: hal_py.Endpoint) -> bool
Check whether an endpoint is a destination of the net.
- param hal_py.Endpoint ep
The endpoint.
- returns
True if the endpoint is a destination of the net, False otherwise.
- rtype
bool
- is_a_source(*args, **kwargs)
Overloaded function.
is_a_source(self: hal_py.Net, gate: hal_py.Gate) -> bool
Check whether a gate is a source of the net independent of the pin.
- param hal_py.Gate gate
The gate.
- returns
True if the gate is a source of the net, False otherwise.
- rtype
bool
is_a_source(self: hal_py.Net, gate: hal_py.Gate, pin_name: str) -> bool
Check whether an endpoint is a source of the net. The endpoint is specified by a tuple of a gate and the name of an output pin of that gate.
- param hal_py.Gate gate
The gate.
- param str pin_name
The name of an output pin of the gate.
- returns
True if the endpoint is a source of the net, False otherwise.
- rtype
bool
is_a_source(self: hal_py.Net, gate: hal_py.Gate, pin: hal_py.GatePin) -> bool
Check whether an endpoint is a source of the net. The endpoint is specified by a tuple of a gate and the name of an output pin of that gate.
- param hal_py.Gate gate
The gate.
- param hal_py.GatePin pin
The output pin of the gate.
- returns
True if the endpoint is a source of the net, False otherwise.
- rtype
bool
is_a_source(self: hal_py.Net, ep: hal_py.Endpoint) -> bool
Check whether an endpoint is a source of the net.
- param hal_py.Endpoint ep
The endpoint.
- returns
True if the endpoint is a source of the net, False otherwise.
- rtype
bool
- is_global_input_net(self: hal_py.Net) bool
Checks whether this net is a global input net.
- Returns
True if the net is a global input net, False otherwise.
- Return type
- is_global_output_net(self: hal_py.Net) bool
Checks whether this net is a global output net.
- Returns
True if the net is a global output net, False otherwise.
- Return type
- is_gnd_net(self: hal_py.Net) bool
Check whether the net is connected to GND.
- Returns
True if the net is connected to GND, False otherwise.
- Return type
- is_unrouted(self: hal_py.Net) bool
Check whether the net is unrouted, i.e., it has no source or no destination.
- Returns
True if the net is unrouted, False otherwise.
- Return type
- is_vcc_net(self: hal_py.Net) bool
Check whether the net is connected to VCC.
- Returns
True if the net is connected to VCC, False otherwise.
- Return type
- mark_global_input_net(self: hal_py.Net) bool
Mark this net as a global input net.
- Returns
True on success, False otherwise.
- Return type
- mark_global_output_net(self: hal_py.Net) bool
Mark this net as a global output net.
- Returns
True on success, False otherwise.
- Return type
- property netlist
The netlist this net is associated with.
- Type
- remove_destination(*args, **kwargs)
Overloaded function.
remove_destination(self: hal_py.Net, gate: hal_py.Gate, pin_name: str) -> bool
Remove a destination endpoint from the net. The endpoint is specified by a tuple of a gate and the name of an input pin of that gate.
- param hal_py.Gate gate
The gate.
- param str pin_name
The name of an input pin of the gate.
- returns
True on success, False otherwise.
- rtype
bool
remove_destination(self: hal_py.Net, gate: hal_py.Gate, pin: hal_py.GatePin) -> bool
Remove a destination endpoint from the net. The endpoint is specified by a tuple of a gate and the name of an input pin of that gate.
- param hal_py.Gate gate
The gate.
- param hal_py.GatePin pin
The input pin of the gate.
- returns
True on success, False otherwise.
- rtype
bool
remove_destination(self: hal_py.Net, ep: hal_py.Endpoint) -> bool
Remove a destination endpoint from the net.
- param hal_py.Endpoint ep
The destination endpoint.
- returns
True on success, False otherwise.
- rtype
bool
- remove_source(*args, **kwargs)
Overloaded function.
remove_source(self: hal_py.Net, gate: hal_py.Gate, pin_name: str) -> bool
Remove a source endpoint from the net. The endpoint is specified by a tuple of a gate and the name of an output pin of that gate.
- param hal_py.Gate gate
The gate.
- param str pin_name
The name of an output pin of the gate.
- returns
True on success, False otherwise.
- rtype
bool
remove_source(self: hal_py.Net, gate: hal_py.Gate, pin: hal_py.GatePin) -> bool
Remove a source endpoint from the net. The endpoint is specified by a tuple of a gate and an output pin of that gate.
- param hal_py.Gate gate
The gate.
- param hal_py.GatePin pin
The output pin of the gate.
- returns
True on success, False otherwise.
- rtype
bool
remove_source(self: hal_py.Net, ep: hal_py.Endpoint) -> bool
Remove a source endpoint from the net.
- param hal_py.Endpoint ep
The endpoint.
- returns
True on success, False otherwise.
- rtype
bool
- set_data(self: hal_py.DataContainer, category: str, key: str, data_type: str, value: str, log_with_info_level: bool = False) bool
Add a data entry.<br> May overwrite an existing entry.
- Parameters
- Returns
True on success, false otherwise.
- Return type
- set_name(self: hal_py.Net, name: str) None
Set the name of the net.
- Parameters
name (str) – The new name.
- property sources
A list of sources of the net.
- Type
- unmark_global_input_net(self: hal_py.Net) bool
Unmark this net as a global input net.
- Returns
True on success, False otherwise.
- Return type
- unmark_global_output_net(self: hal_py.Net) bool
Unmark this net as a global output net.
- Returns
True on success, False otherwise.
- Return type