![]() |
HAL
|
Grouping used during dataflow analysis. More...
#include <grouping.h>
Public Member Functions | |
Grouping (const NetlistAbstraction &na) | |
Construct a new (empty) grouping from a netlist abstraction. More... | |
Grouping (const NetlistAbstraction &na, const std::vector< std::vector< Gate * >> &groups) | |
Construct a new grouping from a netlist abstraction and a vector of groups (as a vector of gates). More... | |
Grouping (const Grouping &other) | |
Construct a new grouping as a copy of an existing grouping. More... | |
bool | operator== (const Grouping &other) const |
Check two groupings for equality. More... | |
bool | operator!= (const Grouping &other) const |
Check two groupings for inequality. More... | |
std::map< PinType, std::unordered_set< u32 > > | get_control_signals_of_group (u32 group_id) const |
Get the control signals of a group as a map from the control pin type to the connected net IDs. More... | |
std::unordered_set< u32 > | get_successor_groups_of_group (u32 group_id) const |
Get the successor groups of a group. More... | |
std::unordered_set< u32 > | get_predecessor_groups_of_group (u32 group_id) const |
Get the predecessor groups of a group. More... | |
std::unordered_set< u32 > | get_known_successor_groups_of_group (u32 group_id) const |
Get the known successor groups of a group. More... | |
std::unordered_set< u32 > | get_known_predecessor_groups_of_group (u32 group_id) const |
Get the known predecessor groups of a group. More... | |
std::set< u32 > | get_register_stage_intersect_of_group (u32 group_id) const |
Get the intersection of the register stages of all gates of the group. More... | |
bool | are_groups_allowed_to_merge (u32 group_1_id, u32 group_2_id, bool enforce_type_consistency) const |
Check if two groups are allowed to be merged. More... | |
bool | is_group_allowed_to_split (u32 group_id) const |
Check if the group is allowed to be split. More... | |
Public Attributes | |
const NetlistAbstraction & | netlist_abstr |
std::unordered_map< u32, std::vector< u32 > > | group_control_fingerprint_map |
std::unordered_map< u32, std::unordered_set< u32 > > | gates_of_group |
std::unordered_map< u32, u32 > | parent_group_of_gate |
std::map< u32, bool > | operations_on_group_allowed |
std::shared_mutex | mutex |
std::unordered_map< u32, std::unordered_set< u32 > > | suc_cache |
std::unordered_map< u32, std::unordered_set< u32 > > | pred_cache |
std::unordered_map< u32, std::unordered_set< u32 > > | suc_known_group_cache |
std::unordered_map< u32, std::unordered_set< u32 > > | pred_known_group_cache |
std::set< std::set< u32 > > | comparison_cache |
Grouping used during dataflow analysis.
This class provides access to all information related to a grouping as an (intermediate) product of dataflow analysis. Each grouping is a collection of groups of, e.g., flip-flops that result from different paths that have been executed on a previous grouping.
Definition at line 54 of file grouping.h.
hal::dataflow::Grouping::Grouping | ( | const NetlistAbstraction & | na | ) |
Construct a new (empty) grouping from a netlist abstraction.
[in] | na | - The netlist abstraction. |
Definition at line 12 of file grouping.cpp.
hal::dataflow::Grouping::Grouping | ( | const NetlistAbstraction & | na, |
const std::vector< std::vector< Gate * >> & | groups | ||
) |
Construct a new grouping from a netlist abstraction and a vector of groups (as a vector of gates).
[in] | na | - The netlist abstraction. |
[in] | groups | - A vector of groups. |
Definition at line 16 of file grouping.cpp.
References test_plugin::g, hal::dataflow::NetlistAbstraction::gate_to_fingerprint, gates_of_group, group_control_fingerprint_map, operations_on_group_allowed, parent_group_of_gate, and hal::dataflow::NetlistAbstraction::target_gates.
hal::dataflow::Grouping::Grouping | ( | const Grouping & | other | ) |
Construct a new grouping as a copy of an existing grouping.
Definition at line 75 of file grouping.cpp.
References gates_of_group, group_control_fingerprint_map, and parent_group_of_gate.
bool hal::dataflow::Grouping::are_groups_allowed_to_merge | ( | u32 | group_1_id, |
u32 | group_2_id, | ||
bool | enforce_type_consistency | ||
) | const |
Check if two groups are allowed to be merged.
[in] | group_1_id | - The ID of the first group. |
[in] | group_2_id | - The ID of the second group. |
[in] | enforce_type_consistency | - Set true to enforce that the gates of both groups must be of the same type, false otherwise. |
true
if the groups are allowed to be joined, false
otherwise. Definition at line 297 of file grouping.cpp.
References gates_of_group, hal::Netlist::get_gate_by_id(), get_register_stage_intersect_of_group(), hal::Gate::get_type(), group_control_fingerprint_map, netlist_abstr, hal::dataflow::NetlistAbstraction::nl, and operations_on_group_allowed.
std::map< PinType, std::unordered_set< u32 > > hal::dataflow::Grouping::get_control_signals_of_group | ( | u32 | group_id | ) | const |
Get the control signals of a group as a map from the control pin type to the connected net IDs.
[in] | group_id | - The ID of the group. |
Definition at line 109 of file grouping.cpp.
References hal::dataflow::NetlistAbstraction::gate_to_control_signals, gates_of_group, and netlist_abstr.
Referenced by hal::dataflow::Result::Result().
std::unordered_set< u32 > hal::dataflow::Grouping::get_known_predecessor_groups_of_group | ( | u32 | group_id | ) | const |
Get the known predecessor groups of a group.
The known groups have initially been fed to the dataflow analysis by the user.
[in] | group_id | - The ID of the group. |
Definition at line 266 of file grouping.cpp.
References hal::dataflow::NetlistAbstraction::gate_to_known_predecessor_groups, gates_of_group, and netlist_abstr.
std::unordered_set< u32 > hal::dataflow::Grouping::get_known_successor_groups_of_group | ( | u32 | group_id | ) | const |
Get the known successor groups of a group.
The known groups have initially been fed to the dataflow analysis by the user.
[in] | group_id | - The ID of the group. |
Definition at line 235 of file grouping.cpp.
References hal::dataflow::NetlistAbstraction::gate_to_known_successor_groups, gates_of_group, and netlist_abstr.
std::unordered_set< u32 > hal::dataflow::Grouping::get_predecessor_groups_of_group | ( | u32 | group_id | ) | const |
Get the predecessor groups of a group.
[in] | group_id | - The ID of the group. |
Definition at line 204 of file grouping.cpp.
References hal::dataflow::NetlistAbstraction::gate_to_predecessors, gates_of_group, netlist_abstr, and parent_group_of_gate.
Referenced by hal::dataflow::Result::Result().
std::set< u32 > hal::dataflow::Grouping::get_register_stage_intersect_of_group | ( | u32 | group_id | ) | const |
Get the intersection of the register stages of all gates of the group.
[in] | group_id | - The ID of the group. |
Definition at line 139 of file grouping.cpp.
References hal::dataflow::NetlistAbstraction::gate_to_register_stages, gates_of_group, and netlist_abstr.
Referenced by are_groups_allowed_to_merge().
std::unordered_set< u32 > hal::dataflow::Grouping::get_successor_groups_of_group | ( | u32 | group_id | ) | const |
Get the successor groups of a group.
[in] | group_id | - The ID of the group. |
Definition at line 173 of file grouping.cpp.
References hal::dataflow::NetlistAbstraction::gate_to_successors, gates_of_group, netlist_abstr, and parent_group_of_gate.
Referenced by hal::dataflow::Result::Result().
bool hal::dataflow::Grouping::is_group_allowed_to_split | ( | u32 | group_id | ) | const |
Check if the group is allowed to be split.
[in] | group_id | - The ID of the group. |
true
if the group is allowed to be split, false
otherwise. Definition at line 328 of file grouping.cpp.
References operations_on_group_allowed.
bool hal::dataflow::Grouping::operator!= | ( | const Grouping & | other | ) | const |
Check two groupings for inequality.
Two groupings are equal if the comprise the same number of groups and if these groups are made up from the same gates.
[in] | other | - The other grouping. |
true
if the groupings are unequal, false
otherwise. Definition at line 104 of file grouping.cpp.
bool hal::dataflow::Grouping::operator== | ( | const Grouping & | other | ) | const |
Check two groupings for equality.
Two groupings are equal if the comprise the same number of groups and if these groups are made up from the same gates.
[in] | other | - The other grouping. |
true
if the groupings are equal, false
otherwise. Definition at line 94 of file grouping.cpp.
References gates_of_group.
std::set<std::set<u32> > hal::dataflow::Grouping::comparison_cache |
Definition at line 200 of file grouping.h.
A map from group to all gates contained in the group.
Definition at line 89 of file grouping.h.
Referenced by are_groups_allowed_to_merge(), get_control_signals_of_group(), get_known_predecessor_groups_of_group(), get_known_successor_groups_of_group(), get_predecessor_groups_of_group(), get_register_stage_intersect_of_group(), get_successor_groups_of_group(), Grouping(), operator==(), and hal::dataflow::Result::Result().
A map from group the an ordered list of control net IDs.
Definition at line 84 of file grouping.h.
Referenced by are_groups_allowed_to_merge(), and Grouping().
std::shared_mutex hal::dataflow::Grouping::mutex |
Definition at line 195 of file grouping.h.
const NetlistAbstraction& hal::dataflow::Grouping::netlist_abstr |
The netlist abstraction associated with the grouping.
Definition at line 79 of file grouping.h.
Referenced by are_groups_allowed_to_merge(), get_control_signals_of_group(), get_known_predecessor_groups_of_group(), get_known_successor_groups_of_group(), get_predecessor_groups_of_group(), get_register_stage_intersect_of_group(), get_successor_groups_of_group(), and hal::dataflow::Result::Result().
std::map<u32, bool> hal::dataflow::Grouping::operations_on_group_allowed |
A map from a group to a flag that determines whether operations on the group are allowed.
Definition at line 99 of file grouping.h.
Referenced by are_groups_allowed_to_merge(), Grouping(), and is_group_allowed_to_split().
A map from gate ID to the group that this gate belongs to.
Definition at line 94 of file grouping.h.
Referenced by get_predecessor_groups_of_group(), get_successor_groups_of_group(), and Grouping().
Definition at line 197 of file grouping.h.
Definition at line 199 of file grouping.h.
Definition at line 196 of file grouping.h.
Definition at line 198 of file grouping.h.