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.

  1. 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

  2. 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.

  1. 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

  2. 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.

Type

dict[tuple(str,str),tuple(str,str)]

delete_data(self: hal_py.DataContainer, category: str, key: str, log_with_info_level: bool = False) bool

Delete a data entry.

Parameters
  • category (str) – The data key category.

  • key (str) – The data key.

  • log_with_info_level (bool) – Force explicit logging channel ‘netlist’ with log level ‘info’ to trace GUI events.

Returns

True on success, false otherwise.

Return type

bool

property destinations

A list of destinations of the net.

Type

list[hal_py.Endpoint]

get_data(self: hal_py.DataContainer, category: str, key: str) Tuple[str, str]

Get the data entry specified by the given category and key.

Parameters
  • category (str) – The data key category.

  • key (str) – The data key.

Returns

The tuple ((1) type, (2) value).

Return type

tuple(str,str)

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.

Returns

The stored data as a dict.

Return type

dict[tuple(str,str),tuple(str,str)]

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

list[hal_py.Endpoint]

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

hal_py.Grouping

get_id(self: hal_py.Net) int

Get the unique id of the net.

Returns

The unique id.

Return type

int

get_name(self: hal_py.Net) str

Get the name of the net.

Returns

The name.

Return type

str

get_netlist(self: hal_py.Net) hal_py.Netlist

Get the netlist this net is associated with.

Returns

The netlist.

Return type

hal_py.Netlist

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

int

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

int

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

list[hal_py.Endpoint]

has_data(self: hal_py.DataContainer, category: str, key: str) bool

Determine whether an entry of given category and key exists.

Parameters
  • category (str) – The data key category.

  • key (str) – The data key.

Returns

True if the entry exists, False otherwise.

Return type

bool

property id

The unique id of the net.

Type

int

is_a_destination(*args, **kwargs)

Overloaded function.

  1. 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

  2. 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

  3. 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

  4. 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.

  1. 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

  2. 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

  3. 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

  4. 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

bool

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

bool

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

bool

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

bool

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

bool

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

bool

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

bool

property name

The name of the net.

Type

str

property netlist

The netlist this net is associated with.

Type

hal_py.Netlist

property num_of_destinations

The number of destinations of the net.

Type

int

property num_of_sources

The number of sources of the net.

Type

int

remove_destination(*args, **kwargs)

Overloaded function.

  1. 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

  2. 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

  3. 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.

  1. 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

  2. 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

  3. 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
  • category (str) – The data key category.

  • key (str) – The data key.

  • data_type (str) – The data type.

  • value (str) – The data value.

  • log_with_info_level (bool) – Force explicit logging channel ‘netlist’ with log level ‘info’ to trace GUI events.

Returns

True on success, false otherwise.

Return type

bool

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

list[hal_py.Endpoint]

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

bool

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

bool