![]() |
HAL
|
#include <pin_group.h>
Public Member Functions | |
PinGroup (const u32 id, const std::string &name, PinDirection direction, PinType type, bool ascending=true, u32 start_index=0, bool ordered=false) | |
~PinGroup ()=default | |
bool | operator== (const PinGroup< T > &other) const |
bool | operator!= (const PinGroup< T > &other) const |
ssize_t | get_hash () const |
u32 | get_id () const |
void | set_name (const std::string &name) |
const std::string & | get_name () const |
void | set_type (PinType type) |
PinType | get_type () const |
void | set_direction (PinDirection direction) |
PinDirection | get_direction () const |
std::vector< T * > | get_pins (const std::function< bool(T *)> &filter=nullptr) const |
Result< T * > | get_pin_at_index (i32 index) const |
Result< i32 > | get_index (const T *pin) const |
bool | is_ascending () const |
i32 | get_start_index () const |
bool | is_ordered () const |
void | set_ordered (bool ordered=true) |
bool | empty () const |
size_t | size () const |
bool | assign_pin (T *pin) |
Result< std::monostate > | move_pin (T *pin, i32 new_index) |
bool | remove_pin (T *pin) |
bool | contains_pin (T *pin) |
A group of pins made up of a name, the pins, a pin order, and a start index.
Definition at line 50 of file pin_group.h.
|
inline |
Construct a new pin group from its name, pin order, and start index.
[in] | id | - The ID of the pin group. |
[in] | name | - The name of the pin group. |
[in] | direction | - The direction of the pin group. |
[in] | type | - The type of the pin group. |
[in] | ascending | - Set true for ascending pin order (from 0 to n-1), false otherwise (from n-1 to 0). Defaults to true . |
[in] | start_index | - The start index of the pin group. Defaults to 0 . |
[in] | ordered | - Set true if the pin group features an inherent order, false otherwise. Defaults to false . |
Definition at line 64 of file pin_group.h.
|
default |
|
inline |
Assign a pin to the pin group.
[in] | pin | - The pin to assign. |
Definition at line 341 of file pin_group.h.
References log_warning.
Referenced by hal::GateType::assign_pin_to_group(), hal::Module::assign_pin_to_group(), and hal::NetlistModificationDecorator::connect_nets().
|
inline |
Check whether the pin group contains the given pin.
[in] | pin | - The pin to check. |
true
if the pin group contains the pin, false
otherwise. Definition at line 507 of file pin_group.h.
Referenced by hal::Module::assign_pin_to_group().
|
inline |
Check whether the pin group is empty, i.e., contains no pins.
Definition at line 320 of file pin_group.h.
|
inline |
Get the direction of the pin group.
Definition at line 190 of file pin_group.h.
Referenced by hal::ActionPingroup::exec(), hal::ModulePinsTreeModel::handleModulePortsChanged(), hal::PinGroup< T >::operator==(), and hal::Module::set_pin_group_direction().
|
inline |
Hash function for python binding.
Definition at line 120 of file pin_group.h.
|
inline |
Get the ID of the pin group. The ID is unique within an entity, e.g., a module or a gate type.
Definition at line 130 of file pin_group.h.
Referenced by hal::GateType::assign_pin_to_group(), hal::Module::assign_pin_to_group(), hal::Module::create_pin_group(), hal::GateType::delete_pin_group(), hal::Module::delete_pin_group(), hal::ActionPingroup::deletePinGroup(), hal::ActionPingroup::exec(), hal::ModulePinsTreeModel::handleModulePortsChanged(), hal::Module::move_pin_group(), hal::Module::move_pin_within_group(), hal::PinGroup< T >::operator==(), hal::Module::remove_pin_from_group(), hal::GateType::set_pin_group_direction(), hal::Module::set_pin_group_direction(), hal::GateType::set_pin_group_name(), hal::Module::set_pin_group_name(), hal::GateType::set_pin_group_type(), and hal::Module::set_pin_group_type().
|
inline |
Get the index within the pin group of the given pin.
[in] | pin | - The pin. |
Definition at line 258 of file pin_group.h.
|
inline |
Get the name of the pin group.
Definition at line 150 of file pin_group.h.
Referenced by hal::GateType::assign_pin_to_group(), hal::Module::assign_pin_to_group(), hal::GateType::delete_pin_group(), hal::Module::delete_pin_group(), hal::ActionPingroup::deletePinGroup(), hal::ActionPingroup::exec(), hal::ModulePinsTreeModel::handleModulePortsChanged(), hal::Module::move_pin_group(), hal::Module::move_pin_within_group(), hal::PinGroup< T >::operator==(), hal::Module::remove_pin_from_group(), hal::GateType::set_pin_group_direction(), hal::Module::set_pin_group_direction(), hal::GateType::set_pin_group_name(), hal::Module::set_pin_group_name(), hal::GateType::set_pin_group_type(), and hal::Module::set_pin_group_type().
|
inline |
Get the pin specified by the given index.
[in] | index | - The index of the pin within the pin group. |
Definition at line 228 of file pin_group.h.
|
inline |
Get the (ordered) pins of the pin groups. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.
[in] | filter | - An optional filter. |
Definition at line 202 of file pin_group.h.
References hal::T.
Referenced by hal::GateType::delete_pin_group(), hal::Module::delete_pin_group(), hal::ActionPingroup::deletePinGroup(), hal::BooleanFunctionDecorator::get_boolean_function_from(), and hal::PinGroup< T >::operator==().
|
inline |
Get the start index of the pin group. Commonly, pin groups start at index 0, but this may not always be the case. Note that the start index for a pin group comprising n pins is 0 independent of whether it is ascending or descending.
Definition at line 290 of file pin_group.h.
Referenced by hal::ActionPingroup::exec(), and hal::PinGroup< T >::operator==().
|
inline |
Get the type of the pin group.
Definition at line 170 of file pin_group.h.
Referenced by hal::dataflow::Result::create_modules(), hal::ActionPingroup::exec(), hal::ModulePinsTreeModel::handleModulePortsChanged(), hal::PinGroup< T >::operator==(), and hal::Module::set_pin_group_type().
|
inline |
Check whether the pin order of a pin group comprising n pins is ascending (from 0 to n-1) or descending (from n-1 to 0).
true
for ascending bit order, false
otherwise. Definition at line 278 of file pin_group.h.
Referenced by hal::ActionPingroup::exec(), and hal::PinGroup< T >::operator==().
|
inline |
Check whether the pin group features an inherent order.
true
if the pin group is inherently ordered, false
otherwise. Definition at line 300 of file pin_group.h.
Referenced by hal::PinGroup< T >::operator==().
|
inline |
Move a pin to another index within the pin group.
[in] | pin | - The pin to move. |
[in] | new_index | - The index to move the pin to. |
Definition at line 380 of file pin_group.h.
References direction, ERR, and OK.
Referenced by hal::NetlistModificationDecorator::connect_nets(), and hal::Module::move_pin_within_group().
|
inline |
Check whether two pin groups are unequal.
[in] | other | - The pin group to compare against. |
true
if both pin groups are unequal, false
otherwise. Definition at line 110 of file pin_group.h.
References hal::PinGroup< T >::operator==().
|
inline |
Check whether two pin groups are equal.
[in] | other | - The pin group to compare against. |
true
if both pin groups are equal, false
otherwise. Definition at line 77 of file pin_group.h.
References hal::PinGroup< T >::get_direction(), hal::PinGroup< T >::get_id(), hal::PinGroup< T >::get_name(), hal::PinGroup< T >::get_pins(), hal::PinGroup< T >::get_start_index(), hal::PinGroup< T >::get_type(), hal::PinGroup< T >::is_ascending(), and hal::PinGroup< T >::is_ordered().
Referenced by hal::PinGroup< T >::operator!=().
|
inline |
Remove a pin from the pin group.
[in] | pin | - The pin to remove. |
Definition at line 453 of file pin_group.h.
References log_warning.
|
inline |
Set the direction of the pin group.
[in] | direction | - The direction of the pin group. |
Definition at line 180 of file pin_group.h.
References direction.
Referenced by hal::GateType::set_pin_group_direction(), and hal::Module::set_pin_group_direction().
|
inline |
Set the name of the pin group.
[in] | name | - The name of the pin group. |
Definition at line 140 of file pin_group.h.
References name.
Referenced by hal::GateType::set_pin_group_name(), and hal::Module::set_pin_group_name().
|
inline |
Set whether the pin group features an inherent order.
[in] | ordered | - Set true if the pin group is inherently ordered, false otherwise. Defaults to true . |
Definition at line 310 of file pin_group.h.
References ordered.
|
inline |
Set the type of the pin group.
[in] | type | - The pin group type. |
Definition at line 160 of file pin_group.h.
References type.
Referenced by hal::GateType::set_pin_group_type(), and hal::Module::set_pin_group_type().
|
inline |
Get the size, i.e., the number of pins, of the pin group.
Definition at line 330 of file pin_group.h.