HAL
hal::dataflow::Grouping Class Reference

Grouping used during dataflow analysis. More...

#include <grouping.h>

Collaboration diagram for hal::dataflow::Grouping:
Collaboration graph

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< u32get_successor_groups_of_group (u32 group_id) const
 Get the successor groups of a group. More...
 
std::unordered_set< u32get_predecessor_groups_of_group (u32 group_id) const
 Get the predecessor groups of a group. More...
 
std::unordered_set< u32get_known_successor_groups_of_group (u32 group_id) const
 Get the known successor groups of a group. More...
 
std::unordered_set< u32get_known_predecessor_groups_of_group (u32 group_id) const
 Get the known predecessor groups of a group. More...
 
std::set< u32get_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 NetlistAbstractionnetlist_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, u32parent_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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Grouping() [1/3]

hal::dataflow::Grouping::Grouping ( const NetlistAbstraction na)

Construct a new (empty) grouping from a netlist abstraction.

Parameters
[in]na- The netlist abstraction.

Definition at line 12 of file grouping.cpp.

◆ Grouping() [2/3]

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).

Parameters
[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.

◆ Grouping() [3/3]

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.

Member Function Documentation

◆ are_groups_allowed_to_merge()

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.

Parameters
[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.
Returns
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.

◆ get_control_signals_of_group()

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.

Parameters
[in]group_id- The ID of the group.
Returns
The group's control signals.

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().

◆ get_known_predecessor_groups_of_group()

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.

Parameters
[in]group_id- The ID of the group.
Returns
The group's known predecessor groups.

Definition at line 266 of file grouping.cpp.

References hal::dataflow::NetlistAbstraction::gate_to_known_predecessor_groups, gates_of_group, and netlist_abstr.

◆ get_known_successor_groups_of_group()

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.

Parameters
[in]group_id- The ID of the group.
Returns
The group's known successor groups.

Definition at line 235 of file grouping.cpp.

References hal::dataflow::NetlistAbstraction::gate_to_known_successor_groups, gates_of_group, and netlist_abstr.

◆ get_predecessor_groups_of_group()

std::unordered_set< u32 > hal::dataflow::Grouping::get_predecessor_groups_of_group ( u32  group_id) const

Get the predecessor groups of a group.

Parameters
[in]group_id- The ID of the group.
Returns
The group's predecessor groups.

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().

◆ get_register_stage_intersect_of_group()

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.

Parameters
[in]group_id- The ID of the group.
Returns
The register stage intersection of all gates 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().

◆ get_successor_groups_of_group()

std::unordered_set< u32 > hal::dataflow::Grouping::get_successor_groups_of_group ( u32  group_id) const

Get the successor groups of a group.

Parameters
[in]group_id- The ID of the group.
Returns
The group's successor groups.

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().

◆ is_group_allowed_to_split()

bool hal::dataflow::Grouping::is_group_allowed_to_split ( u32  group_id) const

Check if the group is allowed to be split.

Parameters
[in]group_id- The ID of the group.
Returns
true if the group is allowed to be split, false otherwise.

Definition at line 328 of file grouping.cpp.

References operations_on_group_allowed.

◆ operator!=()

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.

Parameters
[in]other- The other grouping.
Returns
true if the groupings are unequal, false otherwise.

Definition at line 104 of file grouping.cpp.

◆ operator==()

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.

Parameters
[in]other- The other grouping.
Returns
true if the groupings are equal, false otherwise.

Definition at line 94 of file grouping.cpp.

References gates_of_group.

Member Data Documentation

◆ comparison_cache

std::set<std::set<u32> > hal::dataflow::Grouping::comparison_cache

Definition at line 200 of file grouping.h.

◆ gates_of_group

std::unordered_map<u32, std::unordered_set<u32> > hal::dataflow::Grouping::gates_of_group

◆ group_control_fingerprint_map

std::unordered_map<u32, std::vector<u32> > hal::dataflow::Grouping::group_control_fingerprint_map

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().

◆ mutex

std::shared_mutex hal::dataflow::Grouping::mutex

Definition at line 195 of file grouping.h.

◆ netlist_abstr

◆ operations_on_group_allowed

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().

◆ parent_group_of_gate

std::unordered_map<u32, u32> hal::dataflow::Grouping::parent_group_of_gate

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().

◆ pred_cache

std::unordered_map<u32, std::unordered_set<u32> > hal::dataflow::Grouping::pred_cache

Definition at line 197 of file grouping.h.

◆ pred_known_group_cache

std::unordered_map<u32, std::unordered_set<u32> > hal::dataflow::Grouping::pred_known_group_cache

Definition at line 199 of file grouping.h.

◆ suc_cache

std::unordered_map<u32, std::unordered_set<u32> > hal::dataflow::Grouping::suc_cache

Definition at line 196 of file grouping.h.

◆ suc_known_group_cache

std::unordered_map<u32, std::unordered_set<u32> > hal::dataflow::Grouping::suc_known_group_cache

Definition at line 198 of file grouping.h.


The documentation for this class was generated from the following files: