|
HAL
v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
#include <hal_core/netlist/pins/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 |
| bool | is_descending () const |
| i32 | get_lowest_index () const |
| i32 | get_highest_index () 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) |
An ordered collection of pins that belong together, e.g., the bits of a bus. A pin group assigns a consecutive index to each of its pins, either in ascending or in descending order.
A group of pins made up of a name, the pins, a pin order, and a start index.
Definition at line 53 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 67 of file pin_group.h.
|
default |
|
inline |
Assign a pin to the pin group. The pin will automatically assigned highest_index+1 as its index, independent of whether the group is ascending or descending. The highest_index of the group will be incremented by 1. For ascending groups, the pin will be inserted at the end of the list of pins. For descending groups, it will be inserted at the beginning of the list of pins.
| [in] | pin | - The pin to assign. |
true on success, false otherwise. Definition at line 373 of file pin_group.h.
References index, and 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 530 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.
true if the pin group is empty, false otherwise. Definition at line 348 of file pin_group.h.
|
inline |
Get the direction of the pin group.
Definition at line 193 of file pin_group.h.
Referenced by hal::ActionPingroup::exec(), hal::ModulePinsTreeModel::handleModulePortsChanged(), hal::PinGroup< T >::operator==(), hal::Module::set_pin_group_direction(), and hal::ActionPingroup::toggleAscendingGroup().
|
inline |
Hash function for python binding.
Definition at line 123 of file pin_group.h.
|
inline |
Get the numerically highest index of the pin group.
Definition at line 306 of file pin_group.h.
Referenced by hal::PinGroup< T >::operator==().
|
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 133 of file pin_group.h.
Referenced by hal::GateType::assign_pin_to_group(), hal::Module::assign_pin_to_group(), hal::ActionPingroup::changePinGroupType(), 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 256 of file pin_group.h.
|
inline |
Get the numerically lowest index of the pin group.
Definition at line 296 of file pin_group.h.
Referenced by hal::ActionPingroup::exec(), hal::PinGroup< T >::operator==(), and hal::ActionPingroup::toggleAscendingGroup().
|
inline |
Get the name of the pin group.
Definition at line 153 of file pin_group.h.
Referenced by hal::NetlistSimulatorController::add_waveform_group(), hal::GateType::assign_pin_to_group(), hal::Module::assign_pin_to_group(), hal::ActionPingroup::automaticallyRenamePins(), 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(), hal::Module::set_pin_group_type(), hal::GatePinsTreeModel::setGate(), and hal::ActionPingroup::toggleAscendingGroup().
|
inline |
Get the pin specified by the given index.
| [in] | index | - The index of the pin within the pin group. |
Definition at line 231 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 205 of file pin_group.h.
References hal::T.
Referenced by hal::NetlistSimulatorController::add_waveform_group(), hal::ActionPingroup::automaticallyRenamePins(), hal::ActionPingroup::changePinGroupType(), hal::GateType::delete_pin_group(), hal::Module::delete_pin_group(), hal::ActionPingroup::deletePinGroup(), hal::BooleanFunctionDecorator::get_boolean_function_from(), hal::PinGroup< T >::operator==(), hal::NetlistSimulatorController::set_input(), and hal::ActionPingroup::toggleAscendingGroup().
|
inline |
Get the start index of the pin group. For ascending pin groups, this index equals the lowest index of the pin group. For descending pin groups, it is equal to the highest index of the pin group.
Definition at line 318 of file pin_group.h.
|
inline |
Get the type of the pin group.
Definition at line 173 of file pin_group.h.
Referenced by hal::dataflow::Result::create_modules(), hal::ActionPingroup::exec(), hal::ModulePinsTreeModel::handleModulePortsChanged(), hal::PinGroup< T >::operator==(), hal::Module::set_pin_group_type(), and hal::ActionPingroup::toggleAscendingGroup().
|
inline |
Check whether the pin order of a pin group comprising n pins is ascending, e.g., from index 0 to n-1.
true for ascending bit order, false otherwise. Definition at line 276 of file pin_group.h.
Referenced by hal::ActionPingroup::exec(), hal::ModulePinsTreeModel::handleModulePortsChanged(), hal::PinGroup< T >::operator==(), hal::GatePinsTreeModel::setGate(), and hal::ActionPingroup::toggleAscendingGroup().
|
inline |
Check whether the pin order of a pin group comprising n pins is descending, e.g., from index n-1 to 0.
true for descending bit order, false otherwise. Definition at line 286 of file pin_group.h.
Referenced by hal::ActionPingroup::deletePinGroup().
|
inline |
Check whether the pin group features an inherent order.
true if the pin group is inherently ordered, false otherwise. Definition at line 328 of file pin_group.h.
Referenced by hal::PinGroup< T >::operator==().
|
inline |
Move a pin to another index within the pin group. The indices of all pins between the old index and the new index will be affected as well, because they are incremented or decremented accordingly.
| [in] | pin | - The pin to move. |
| [in] | new_index | - The index to move the pin to. |
Definition at line 403 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 113 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 80 of file pin_group.h.
References hal::PinGroup< T >::get_direction(), hal::PinGroup< T >::get_highest_index(), hal::PinGroup< T >::get_id(), hal::PinGroup< T >::get_lowest_index(), hal::PinGroup< T >::get_name(), hal::PinGroup< T >::get_pins(), 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. The indices of all pins with a higher index than the removed pin will be reduced by 1. The highest_index will also be reduced by 1.
| [in] | pin | - The pin to remove. |
true on success, false otherwise. Definition at line 481 of file pin_group.h.
References index, and log_warning.
|
inline |
Set the direction of the pin group.
| [in] | direction | - The direction of the pin group. |
Definition at line 183 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 143 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 338 of file pin_group.h.
References ordered.
|
inline |
Set the type of the pin group.
| [in] | type | - The pin group type. |
Definition at line 163 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 358 of file pin_group.h.