Gate

class hal_py.gate

Bases: hal_py.data_container

HAL Gate functions.

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

fan_in_nets

Gets all fan-in nets, i.e. all nets that are connected to one of the input pins.

Returns:A set of all connected input nets.
Return type:set(hal_py.net)
fan_out_nets

Get all fan-out nets, i.e. all nets that are connected to one of the output pins.

Returns:A set of all connected output nets.
Return type:set(hal_py.net)
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_fan_in_net(self: hal_py.gate, pin_type: str) → net

Get the fan-in net which is connected to a specific input pin.

Parameters:pin_type (str) – The input pin type.
Returns:The connected input net.
Return type:hal_py.net
get_fan_in_nets(self: hal_py.gate) → Set[net]

Gets all fan-in nets, i.e. all nets that are connected to one of the input pins.

Returns:A set of all connected input nets.
Return type:set(hal_py.net)
get_fan_out_net(self: hal_py.gate, pin_type: str) → net

Get the fan-out net which is connected to a specific output pin.

Parameters:pin_type (str) – The output pin type.
Returns:The connected output net.
Return type:hal_py.net
get_fan_out_nets(self: hal_py.gate) → Set[net]

Get all fan-out nets, i.e. all nets that are connected to one of the output pins.

Returns:A set of all connected output nets.
Return type:set(hal_py.net)
get_id(self: hal_py.gate) → int

Gets the gate’s unique id.

Returns:The gate’s id.
Return type:int
get_inout_pin_types(self: hal_py.gate) → List[str]

Get all inout pin types of the gate.

Returns:A list of inout pin types.
Return type:list(str)
get_input_pin_types(self: hal_py.gate) → List[str]

Get all input pin types of the gate.

Returns:A list of input pin types.
Return type:list(str)
get_module(self: hal_py.gate) → module

Gets the module this gate is contained in.

Returns:The owning module.
Return type:hal_py.module
get_name(self: hal_py.gate) → str

Gets the gate’s name.

Returns:The name.
Return type:str
get_output_pin_types(self: hal_py.gate) → List[str]

Get all output pin types of the gate.

Returns:A list of output pin types.
Return type:list(str)
get_predecessor(self: hal_py.gate, this_pin_type: str, pred_pin_type: str='__DONT_CARE__', gate_type: str='__DONT_CARE__') → hal_py.endpoint

Get the direct predecessor of a gate connected to a specific input pin and filterable by a specific gate type.

Parameters:
  • this_pin_type (str) – The input pin type of the this gate. Leave empty for no filtering.
  • pred_pin_type (str) – The filter for the output pin type of the predecessor gate. Leave empty for no filtering.
  • gate_type (str) – The filter for target gate types. Leave empty for no filtering.
Returns:

The predecessor endpoint.

Return type:

hal_py.endpoint

get_predecessors(self: hal_py.gate, this_pin_type: str='__DONT_CARE__', pred_pin_type: str='__DONT_CARE__', gate_type: str='__DONT_CARE__') → List[hal_py.endpoint]

Get all direct predecessors of a gate filterable by the gate’s input pin and a specific gate type.

Parameters:
  • this_pin_type (str) – The filter for the input pin type of the this gate. Leave empty for no filtering.
  • pred_pin_type (str) – The filter for the output pin type of the predecessor gate. Leave empty for no filtering.
  • gate_type (str) – The filter for target gate types. Leave empty for no filtering.
Returns:

A list of predecessors endpoints.

Return type:

list(hal_py.endpoint)

get_successors(self: hal_py.gate, this_pin_type: str='__DONT_CARE__', suc_pin_type: str='__DONT_CARE__', gate_type: str='__DONT_CARE__') → List[hal_py.endpoint]

Get all direct successors of a gate filterable by the gate’s output pin and a specific gate type.

Parameters:
  • this_pin_type (str) – The output pin type of the this gate. Leave empty for no filtering.
  • suc_pin_type (str) – The filter for the input pin type of the successor gate. Leave empty for no filtering.
  • gate_type (str) – The filter for target gate types. Leave empty for no filtering.
Returns:

A list of successor endpoints.

Return type:

list(hal_py.endpoint)

get_type(self: hal_py.gate) → str

Gets the type of the gate.

Returns:The gate’s type.
Return type:str
get_unique_predecessors(self: hal_py.gate, this_pin_type: str='__DONT_CARE__', pred_pin_type: str='__DONT_CARE__', gate_type: str='__DONT_CARE__') → Set[hal_py.endpoint]

Get all unique predecessors of a gate filterable by the gate’s input pin and a specific gate type.

Parameters:
  • this_pin_type (str) – The filter for the input pin type of the this gate. Leave empty for no filtering.
  • pred_pin_type (str) – The filter for the output pin type of the predecessor gate. Leave empty for no filtering.
  • gate_type (str) – The filter for target gate types. Leave empty for no filtering.
Returns:

A set of unique predecessors endpoints.

Return type:

set(hal_py.endpoint)

get_unique_successors(self: hal_py.gate, this_pin_type: str='__DONT_CARE__', suc_pin_type: str='__DONT_CARE__', gate_type: str='__DONT_CARE__') → Set[hal_py.endpoint]

Get all direct unique successors of a gate filterable by the gate’s output pin and a specific gate type.

Parameters:
  • this_pin_type (str) – The output pin type of the this gate. Leave empty for no filtering.
  • suc_pin_type (str) – The filter for the input pin type of the successor gate. Leave empty for no filtering.
  • gate_type (str) – The filter for target gate types. Leave empty for no filtering.
Returns:

A set of unique successor endpoints.

Return type:

set(hal_py.endpoint)

id

Gets the gate’s unique id.

Returns:The gate’s id.
Return type:int
inout_pin_types

Get all inout pin types of the gate.

Returns:A list of inout pin types.
Return type:list(str)
input_pin_types

Get all input pin types of the gate.

Returns:A list of input pin types.
Return type:list(str)
is_global_gnd_gate(self: hal_py.gate) → bool

Checks whether this gate is a global gnd gate.

Returns:True if the gate is a global gnd gate.
Return type:bool
is_global_vcc_gate(self: hal_py.gate) → bool

Checks whether this gate is a global vcc gate.

Returns:True if the gate is a global vcc gate.
Return type:bool
mark_global_gnd_gate(self: hal_py.gate) → bool

Mark this gate as a global gnd gate.

Returns:True on success.
Return type:bool
mark_global_vcc_gate(self: hal_py.gate) → bool

Mark this gate as a global vcc gate.

Returns:True on success.
Return type:bool
name

The gate’s name.

Parameters:name (str) – The new name.
Returns:The gate’s name.
Return type:str
output_pin_types

Get all output pin types of the gate.

Returns:A list of output pin types.
Return type:list(str)
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.gate, name: str) → None

Sets the gate’s name.

Parameters:name (str) – The new name.
type

Gets the type of the gate.

Returns:The gate’s type.
Return type:str
unmark_global_gnd_gate(self: hal_py.gate) → bool

Unmark this gate as a global gnd gate.

Returns:True on success.
Return type:bool
unmark_global_vcc_gate(self: hal_py.gate) → bool

Unmark this gate as a global vcc gate.

Returns:True on success.
Return type:bool