Gate Type Component

class hal_py.GateTypeComponent

A component defining additional functionality of a gate type.

class ComponentType
The type of a gate type component.

Members:

lut : LUT component type.

ff : Flip-flop component type.

latch : Latch component type.

ram : RAM component type.

mac : MAC component type.

init : Initializiation component type.

state : State component type.

ram_port : RAM port component type.

name
components

All components of the gate type component as a list.

Type:list[hal_py.GateTypeComponent]
get_component(self: hal_py.GateTypeComponent, filter: Callable[[hal_py.GateTypeComponent], bool] = None) → hal_py.GateTypeComponent

Get a single component matching the filter condition (if provided). Returns None if (i) the gate type does not contain any components, (ii) multiple components match the filter condition, or (iii) no component matches the filter condition.

Parameters:filter (lambda) – The filter applied to all candidate components.
Returns:The component or None.
Return type:hal_py.GateTypeComponent or None
get_components(self: hal_py.GateTypeComponent, filter: Callable[[hal_py.GateTypeComponent], bool] = None) → List[hal_py.GateTypeComponent]

Get all components matching the filter condition (if provided) as a list. Returns an empty list if (i) the gate type does not contain any components or (ii) no component matches the filter condition.

Parameters:filter (lambda) – The filter applied to all candidate components, disabled by default.
Returns:The components.
Return type:list[hal_py.GateTypeComponent]
get_type(self: hal_py.GateTypeComponent) → hal_py.GateTypeComponent.ComponentType

Get the type of the gate type component.

Returns:The type of the gate type component.
Return type:hal_py.GateTypeComponent.ComponentType
type

The type of the gate type component.

Type:hal_py.GateTypeComponent.ComponentType
class hal_py.LUTComponent

A LUT component specifying the LUT gate type’s functionality.

init_ascending

The bit-order of the initialization string. True if ascending, False otherwise.

Type:bool
static is_class_of(component: hal_py.GateTypeComponent) → bool

Check whether a component is a LUTComponent.

Parameters:component (hal_py.GateTypeComponent) – The component to check.
Returns:True if component is a LUTComponent, False otherwise.
Return type:bool
is_init_ascending(self: hal_py.LUTComponent) → bool

Get the bit-order of the initialization string.

Returns:True if ascending bit-order, False otherwise.
Return type:bool
set_init_ascending(self: hal_py.LUTComponent, init_ascending: bool = True) → None

Set the bit-order of the initialization string.

Parameters:init_ascending (bool) – True if ascending bit-order, False otherwise.
class hal_py.FFComponent

A FF component specifying the FF gate type’s functionality.

async_reset_function

The Boolean function describing the asynchronous reset behavior of the flip-flop. Is an empty function if asynchronous reset is not supported by the flip-flop.

async_set_function

The Boolean function describing the asynchronous set behavior of the flip-flop. Is an empty function if asynchronous set is not supported by the flip-flop.

clock_function

The Boolean function describing the clock input of the flip-flop.

get_async_reset_function(self: hal_py.FFComponent) → hal::BooleanFunction

Get the Boolean function describing the asynchronous reset behavior of the flip-flop. Returns an empty function if asynchronous reset is not supported by the flip-flop.

Returns:The function describing the asynchronous reset behavior.
Return type:hal_py.BooleanFunction
get_async_set_function(self: hal_py.FFComponent) → hal::BooleanFunction

Get the Boolean function describing the asynchronous set behavior of the flip-flop. Returns an empty function if asynchronous set is not supported by the flip-flop.

Returns:The function describing the asynchronous set behavior.
Return type:hal_py.BooleanFunction
get_async_set_reset_behavior(self: hal_py.FFComponent) → Tuple[hal_py.AsyncSetResetBehavior, hal_py.AsyncSetResetBehavior]

Get the behavior of the internal state and the negated internal state when both asynchronous set and reset are active at the same time.

Returns:The values specifying the behavior for the internal and negated internal state.
Rytpe:tuple(hal_py.AsyncSetResetBehavior, hal_py.AsyncSetResetBehavior)
get_clock_function(self: hal_py.FFComponent) → hal::BooleanFunction

Get the Boolean function describing the clock input of the flip-flop.

Returns:The function describing the clock input.
Return type:hal_py.BooleanFunction
get_next_state_function(self: hal_py.FFComponent) → hal::BooleanFunction

Get the Boolean function describing the next internal state of the flip-flop.

Returns:The function describing the internal state.
Return type:hal_py.BooleanFunction
static is_class_of(component: hal_py.GateTypeComponent) → bool

Check whether a component is a FFComponent.

Parameters:component (hal_py.GateTypeComponent) – The component to check.
Returns:True if component is a FFComponent, False otherwise.
Return type:bool
next_state_function

The Boolean function describing the next internal state of the flip-flop.

set_async_reset_function(self: hal_py.FFComponent, async_reset_bf: hal::BooleanFunction) → None

Set the Boolean function describing the asynchronous reset behavior of the flip-flop.

Parameters:async_reset_bf (hal_py.BooleanFunction) – The function describing the asynchronous reset behavior.
set_async_set_function(self: hal_py.FFComponent, async_set_bf: hal::BooleanFunction) → None

Set the Boolean function describing the asynchronous set behavior of the flip-flop.

Parameters:async_set_bf (hal_py.BooleanFunction) – The function describing the asynchronous set behavior.
set_async_set_reset_behavior(self: hal_py.FFComponent, behav_state: hal_py.AsyncSetResetBehavior, behav_neg_state: hal_py.AsyncSetResetBehavior) → None

Set the behavior of the internal state and the negated internal state when both asynchronous set and reset are active at the same time.

Parameters:
  • behav_state (hal_py.AsyncSetResetBehavior) – The behavior of the internal state.
  • behav_neg_state (hal_py.AsyncSetResetBehavior) – The behavior of the negated internal state.
set_clock_function(self: hal_py.FFComponent, clock_bf: hal::BooleanFunction) → None

Set the Boolean function describing the clock input of the flip-flop.

Parameters:clock_bf (hal_py.BooleanFunction) – The function describing the clock input.
set_next_state_function(self: hal_py.FFComponent, next_state_bf: hal::BooleanFunction) → None

Set the Boolean function describing the next internal state of the flip-flop.

Parameters:next_state_bf (hal_py.BooleanFunction) – The function describing the internal state.
class hal_py.LatchComponent

A latch component specifying the latch gate type’s functionality.

async_reset_function

The Boolean function describing the asynchronous reset behavior of the latch. Is an empty function if asynchronous reset is not supported by the latch.

async_set_function

The Boolean function describing the asynchronous set behavior of the latch. Is an empty function if asynchronous set is not supported by the latch.

data_in_function

The Boolean function describing the data input of the latch.

enable_function

The Boolean function describing the enable behavior of the latch.

get_async_reset_function(self: hal_py.LatchComponent) → hal::BooleanFunction

Get the Boolean function describing the asynchronous reset behavior of the latch. Returns an empty function if asynchronous reset is not supported by the latch.

Returns:The function describing the asynchronous reset behavior.
Return type:hal_py.BooleanFunction
get_async_set_function(self: hal_py.LatchComponent) → hal::BooleanFunction

Get the Boolean function describing the asynchronous set behavior of the latch. Returns an empty function if asynchronous set is not supported by the latch.

Returns:The function describing the asynchronous set behavior.
Return type:hal_py.BooleanFunction
get_async_set_reset_behavior(self: hal_py.LatchComponent) → Tuple[hal_py.AsyncSetResetBehavior, hal_py.AsyncSetResetBehavior]

Get the behavior of the internal state and the negated internal state when both asynchronous set and reset are active at the same time.

Returns:The values specifying the behavior for the internal and negated internal state.
Rytpe:tuple(hal_py.AsyncSetResetBehavior, hal_py.AsyncSetResetBehavior)
get_data_in_function(self: hal_py.LatchComponent) → hal::BooleanFunction

Get the Boolean function describing the data input of the latch.

Returns:The function describing the data input.
Return type:hal_py.BooleanFunction
get_enable_function(self: hal_py.LatchComponent) → hal::BooleanFunction

Get the Boolean function describing the enable behavior of the latch.

Returns:The function describing the enable behavior.
Return type:hal_py.BooleanFunction
static is_class_of(component: hal_py.GateTypeComponent) → bool

Check whether a component is a LatchComponent.

Parameters:component (hal_py.GateTypeComponent) – The component to check.
Returns:True if component is a LatchComponent, False otherwise.
Return type:bool
set_async_reset_function(self: hal_py.LatchComponent, async_reset_bf: hal::BooleanFunction) → None

Set the Boolean function describing the asynchronous reset behavior of the latch.

Parameters:async_reset_bf (hal_py.BooleanFunction) – The function describing the asynchronous reset behavior.
set_async_set_function(self: hal_py.LatchComponent, async_set_bf: hal::BooleanFunction) → None

Set the Boolean function describing the asynchronous set behavior of the latch.

Parameters:async_set_bf (hal_py.BooleanFunction) – The function describing the asynchronous set behavior.
set_async_set_reset_behavior(self: hal_py.LatchComponent, behav_state: hal_py.AsyncSetResetBehavior, behav_neg_state: hal_py.AsyncSetResetBehavior) → None

Set the behavior of the internal state and the negated internal state when both asynchronous set and reset are active at the same time.

Parameters:
  • behav_state (hal_py.AsyncSetResetBehavior) – The behavior of the internal state.
  • behav_neg_state (hal_py.AsyncSetResetBehavior) – The behavior of the negated internal state.
set_data_in_function(self: hal_py.LatchComponent, data_in_bf: hal::BooleanFunction) → None

Set the Boolean function describing the data input of the latch.

Parameters:data_in_bf (hal_py.BooleanFunction) – The function describing the data input.
set_enable_function(self: hal_py.LatchComponent, enable_bf: hal::BooleanFunction) → None

Set the Boolean function describing the enable behavior of the latch.

Parameters:enable_bf (hal_py.BooleanFunction) – The function describing the enable behavior.
class hal_py.RAMComponent

A RAM component specifying the RAM gate type’s functionality.

bit_size

The size of the RAM in bits.

Type:int
get_bit_size(self: hal_py.RAMComponent) → int

Get the size of the RAM in bits.

Returns:The size of the RAM in bits.
static is_class_of(component: hal_py.GateTypeComponent) → bool

Check whether a component is a RAMComponent.

Parameters:component (hal_py.GateTypeComponent) – The component to check.
Returns:True if component is a RAMComponent, False otherwise.
Return type:bool
set_bit_size(self: hal_py.RAMComponent, bit_size: int) → None

Set the size of the RAM in bits.

Parameters:bit_size (int) – The size of the RAM in bits.
class hal_py.InitComponent

An initialization component specifying the initialization behavior of a gate type.

get_init_category(self: hal_py.InitComponent) → str

Get the category in which to find the initialization data.

Returns:The data category.
Return type:str
get_init_identifier(self: hal_py.InitComponent) → List[str]

Get the list of identifiers at which to find the initialization data.

Returns:The data identifiers.
Return type:list[str]
init_category

The category in which to find the initialization data.

Type:str
init_identifiers

The list of identifiers at which to find initialization data.

Type:str
static is_class_of(component: hal_py.GateTypeComponent) → bool

Check whether a component is an InitComponent.

Parameters:component (hal_py.GateTypeComponent) – The component to check.
Returns:True if component is a InitComponent, False otherwise.
Return type:bool
set_init_category(self: hal_py.InitComponent, init_category: str) → None

Set the category in which to find the initialization data.

Parameters:init_category (str) – The data category.
set_init_identifier(self: hal_py.InitComponent, init_identifiers: List[str]) → None

Set the list of identifiers at which to find the initialization data.

Parameters:init_identifiers (list[str]) – The data identifiers.
class hal_py.StateComponent

A StateComponent with given child component and the internal state identifiers.

get_neg_state_identifier(self: hal_py.StateComponent) → str

Get the identifier of the negated internal state.

Returns:The identifier of the negated internal state.
Return type:str
get_state_identifier(self: hal_py.StateComponent) → str

Get the identifier of the internal state.

Returns:The identifier of the internal state.
Return type:str
static is_class_of(component: hal_py.GateTypeComponent) → bool

Check whether a component is an StateComponent.

Parameters:component (hal_py.GateTypeComponent) – The component to check.
Returns:True if component is a StateComponent, False otherwise.
Return type:bool
neg_state_identifier

The identifier of the negated internal state.

Type:str
set_neg_state_identifier(self: hal_py.StateComponent, neg_state_identifier: str) → None

Set the identifier of the negated internal state.

Parameters:neg_state_identifier (str) – The identifier of the negated internal state.
set_state_identifier(self: hal_py.StateComponent, state_identifier: str) → None

Set the identifier of the internal state.

Parameters:state_identifier (str) – The identifier of the internal state.
state_identifier

The identifier of the internal state.

Type:str
class hal_py.RAMPortComponent

A RAM port component specifying the behavior of a port belonging to a RAM gate type.

address_group

The name of the read or write address pin group.

Type:str
clock_function

The Boolean function determining the read or write clock.

Type:hal_py.BooleanFunction
data_group

The name of the read or write data pin group.

Type:str
enable_function

The Boolean function determining the read or write enable.

Type:hal_py.BooleanFunction
get_address_group(self: hal_py.RAMPortComponent) → str

Get the name of the read or write address pin group.

Returns:The name of the pin group.
Return type:str
get_clock_function(self: hal_py.RAMPortComponent) → hal::BooleanFunction

Get the Boolean function determining the read or write clock.

Returns:The Boolean function.
Return type:hal_py.BooleanFunction
get_data_group(self: hal_py.RAMPortComponent) → str

Get the name of the read or write data pin group.

Returns:The name of the pin group.
Return type:str
get_enable_function(self: hal_py.RAMPortComponent) → hal::BooleanFunction

Get the Boolean function determining the read or write enable.

Returns:The Boolean function.
Return type:hal_py.BooleanFunction
static is_class_of(component: hal_py.GateTypeComponent) → bool

Check whether a component is a RAMPortComponent.

Parameters:component (hal_py.GateTypeComponent) – The component to check.
Returns:True if component is a RAMPortComponent, False otherwise.
Return type:bool
is_write_port(self: hal_py.RAMPortComponent) → bool

Check whether the port is a write or a read port.

Returns:True if the port is a write port, false if it is a read port.
Return type:bool
set_address_group(self: hal_py.RAMPortComponent, addr_group: str) → None

Set the name of the read or write address pin group.

Parameters:addr_group (str) – The name of the pin group.
set_clock_function(self: hal_py.RAMPortComponent, clock_bf: hal::BooleanFunction) → None

Set the Boolean function determining the read or write clock.

Parameters:clock_bf (hal_py.BooleanFunction) – The Boolean function.
set_data_group(self: hal_py.RAMPortComponent, data_group: str) → None

Set the name of the read or write data pin group.

Parameters:data_group (str) – The name of the pin group.
set_enable_function(self: hal_py.RAMPortComponent, enable_bf: hal::BooleanFunction) → None

Set the Boolean function determining the read or write enable.

Parameters:enable_bf (hal_py.BooleanFunction) – The Boolean function.
set_write_port(self: hal_py.RAMPortComponent, is_write: bool) → None

Set the port to be a write or a read port.

Parameters:is_write (bool) – True if the port is a write port, false if it is a read port.
write_port

True if the port is a write port, false if it is a read port.

Type:bool