Net

class hal_py.net

Bases: hal_py.data_container

HAL Net functions.

add_dst(*args, **kwargs)

Overloaded function.

  1. add_dst(self: hal_py.net, gate: hal_py.gate, pin_type: str) -> bool

Add a destination to this net.

Parameters:
  • gate (hal_py.gate) – The destination gate.
  • pin_type (str) – The input pin of the gate.
Returns:

True on succes

Return type:

bool

  1. add_dst(self: hal_py.net, dst: hal_py.endpoint) -> bool

Add a destination to this net.

Parameters:dst (hal_py.endpoint) – The destination endpoint.
Returns:True on succes.
Return type:bool
data

Gets all stored data.

Returns:A dict from ((1) category, (2) key) to ((1) type, (2) value)
Return type:dict[tuple(str,str), tuple(str,str)]
data_keys

Returns all data key

Returns:A list of tuples ((1) category, (2) key)
Return type:list[tuple(str,str)]
delete_data(self: hal_py.data_container, category: str, key: str, log_with_info_level: bool=False) → bool

Deletes custom data.

Parameters:
  • category (str) – Category of key
  • key (str) – Data key
  • log_with_info_level (bool) – Force explicit logging channel ‘netlist’ with log level info to trace GUI events (default = false)
Returns:

True on success.

Return type:

bool

get_data_by_key(self: hal_py.data_container, category: str, key: str) → Tuple[str, str]

Gets data specified by key and category

Parameters:
  • category (str) – Category of key
  • key (str) – Data key
Returns:

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

Return type:

tuple(str, str)

get_dsts(self: hal_py.net, gate_type: str='__DONT_CARE__') → List[hal_py.endpoint]

Get the list of destinations of the net specified by type.

Parameters:gate_type (str) – The desired destination gate type.
Returns:A list of destination endpoints.
Return type:list(hal_py.endpoint)
get_dsts_by_type(self: hal_py.net, gate_type: str) → List[hal_py.endpoint]

Get the list of destinations of the net specified by type.

Parameters:gate_type (str) – The desired destination gate type.
Returns:A list of destination endpoints.
Return type:list(hal_py.endpoint)
get_id(self: hal_py.net) → int

Gets the unique id of the net.

Returns:The net’s id.
Return type:int
get_name(self: hal_py.net) → str

Gets the net’s name.

Returns:The name.
Return type:str
get_num_of_dsts(self: hal_py.net) → int

Get the number of destinations.

Returns:The number of destinations of this net.
Return type:int
get_src(self: hal_py.net, gate_type: str='__DONT_CARE__') → hal_py.endpoint

Get the src of the net specified by type. If the specifications don’t match the actual source, the gate element of the returned endpoint is None.

Parameters:gate_type (str) – The desired source gate type.
Returns:The source endpoint.
Return type:hal_py.endpoint
get_src_by_type(self: hal_py.net, gate_type: str) → hal_py.endpoint

Get the src of the net specified by type. If the specifications don’t match the actual source, the gate element of the returned endpoint is None.

Parameters:gate_type (str) – The desired source gate type.
Returns:The source endpoint.
Return type:hal_py.endpoint
id

Gets the unique id of the net.

Returns:The net’s id.
Return type:int
is_a_dst(*args, **kwargs)

Overloaded function.

  1. is_a_dst(self: hal_py.net, gate: hal_py.gate, pin_type: str=’__DONT_CARE__’) -> bool

Check whether a gate’s input pin is a destination of this net.

Parameters:
  • gate (hal_py.gate) – The destination gate.
  • pin_type (str) – The input pin of the gate. Leave empty if the pin does not matter.
Returns:

True if the input’s pin is a destination.

Return type:

bool

  1. is_a_dst(self: hal_py.net, endpoint: hal_py.endpoint) -> bool

Check whether a gate’s input pin is a destination of this net.

Parameters:endpoint (hal_py.endpoint) – The input endpoint.
Returns:True if the input’s pin is a destination.
Return type:bool
is_global_inout_net(self: hal_py.net) → bool

Checks whether this net is a global inout net.

Returns:True if the net is a global inout net.
Return type: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.
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.
Return type:bool
is_unrouted(self: hal_py.net) → bool

Check whether the net is routed, i.e. it has no source or no destinations.

Returns:True if the net is unrouted.
Return type:bool
mark_global_inout_net(self: hal_py.net) → bool

Mark this net as a global inout net.

Returns:True on success.
Return type:bool
mark_global_input_net(self: hal_py.net) → bool

Mark this net as a global input net.

Returns:True on success.
Return type:bool
mark_global_output_net(self: hal_py.net) → bool

Mark this net as a global output net.

Returns:True on success.
Return type:bool
name

The net’s name.

Type:str
num_of_dsts

Get the number of destinations.

Returns:The number of destinations of this net.
Return type:int
remove_dst(*args, **kwargs)

Overloaded function.

  1. remove_dst(self: hal_py.net, gate: hal_py.gate, pin_type: str) -> bool

Remove a destination from this net.

Parameters:
  • gate (hal_py.gate) – The destination gate.
  • pin_type (str) – The input pin of the gate. Leave empty if the pin does not matter.
Returns:

True on succes

Return type:

bool

  1. remove_dst(self: hal_py.net, dst: hal_py.endpoint) -> bool

Remove a destination from this net.

Parameters:dst (hal_py.endpoint) – The destination endpoint.
Returns:True on succes.
Return type:bool
remove_src(self: hal_py.net) → bool

Removes the source of the net.

Returns:True on success.
Return type:bool
set_data(self: hal_py.data_container, category: str, key: str, value_data_type: str, value: str, log_with_info_level: bool=False) → bool

Sets a custom data entry If it does not exist yet, it is added.

Parameters:
  • category (str) – Key category
  • key (str) – Data key
  • data_type (str) – Data type of value
  • value (str) – Data value
  • log_with_info_level (bool) – Force explicit logging channel ‘netlist’ with log level info to trace GUI events (default = false)
Returns:

True on success.

Return type:

bool

set_name(self: hal_py.net, name: str) → None

Sets the net’s name.

Parameters:name (str) – The new name.
set_src(*args, **kwargs)

Overloaded function.

  1. set_src(self: hal_py.net, gate: hal_py.gate, pin_type: str) -> bool

Sets the source of this net to a gate’s output pin.

Parameters:
  • gate (hal_py.gate) – The source gate.
  • pin_type (str) – THe pin of the source gate.
Returns:

True on succes.

Return type:

bool

  1. set_src(self: hal_py.net, endpoint: hal_py.endpoint) -> bool

Sets the source of this net to a gate’s output pin.

Parameters:endpoint (hal_py.endpoint) – The source endpoint.
Returns:True on success.
Return type:bool
unmark_global_inout_net(self: hal_py.net) → bool

Unmark this net as a global inout net.

Returns:True on success.
Return type:bool
unmark_global_input_net(self: hal_py.net) → bool

Unmark this net as a global input net.

Returns:True on success.
Return type:bool
unmark_global_output_net(self: hal_py.net) → bool

Unmark this net as a global output net.

Returns:True on success.
Return type:bool