HAL
hal::dataflow::Configuration Struct Reference

Configuration of a dataflow analysis run. More...

#include <configuration.h>

Collaboration diagram for hal::dataflow::Configuration:
Collaboration graph

Public Member Functions

 Configuration (Netlist *nl)
 Construct a new dataflow analysis configuration for the given netlist. More...
 
Configurationwith_min_group_size (u32 size)
 Set the minimum size of a group. Smaller groups will be penalized during analysis. More...
 
Configurationwith_expected_sizes (const std::vector< u32 > &sizes)
 Set the expected group sizes. Groups of these sizes will be prioritized. More...
 
Configurationwith_known_structures (const std::vector< Module * > &structures, bool overwrite=false)
 Add modules to the set of previously identified word-level structures. More...
 
Configurationwith_known_structures (const std::vector< std::pair< Module *, std::vector< PinGroup< ModulePin > * >>> &structures, bool overwrite=false)
 Add modules to the set of previously identified word-level structures. More...
 
Configurationwith_known_structures (const std::vector< Gate * > &structures, bool overwrite=false)
 Add (typically large) gates to the set of previously identified word-level structures. More...
 
Configurationwith_known_structures (const std::vector< std::pair< Gate *, std::vector< PinGroup< GatePin > * >>> &structures, bool overwrite=false)
 Add (typically large) gates to the set of previously identified word-level structures. More...
 
Configurationwith_known_structures (const std::unordered_set< const GateType * > &structures, bool overwrite=false)
 Add all gates of a (typically large) gate type to the set of previously identified word-level structures. More...
 
Configurationwith_known_structures (const std::unordered_map< const GateType *, std::vector< PinGroup< GatePin > * >> &structures, bool overwrite=false)
 Add all gates of a (typically large) gate type to the set of previously identified word-level structures. More...
 
Configurationwith_known_groups (const std::vector< Module * > &groups, bool overwrite=false)
 Add modules to the set of previously identified word-level groups. More...
 
Configurationwith_known_groups (const std::vector< std::vector< Gate * >> &groups, bool overwrite=false)
 Add vectors of gates to the set of previously identified word-level groups. More...
 
Configurationwith_known_groups (const std::vector< std::vector< u32 >> &groups, bool overwrite=false)
 Add vectors of gate IDs to the set of previously identified word-level groups. More...
 
Configurationwith_known_groups (const std::unordered_map< u32, std::unordered_set< Gate * >> &groups, bool overwrite=false)
 Add groups from a previous dataflow analysis run to the set of previously identified word-level groups. More...
 
Configurationwith_gate_types (const std::set< const GateType * > &types, bool overwrite=false)
 Add the gate types to the set of gate types to be grouped by dataflow analysis. More...
 
Configurationwith_gate_types (const std::set< GateTypeProperty > &type_properties, bool overwrite=false)
 Add the gate types featuring the specified properties to the set of gate types to be grouped by dataflow analysis. More...
 
Configurationwith_control_pin_types (const std::set< PinType > &types, bool overwrite=false)
 Set the pin types of the pins to be considered control pins by dataflow analysis. More...
 
Configurationwith_flip_flops ()
 Use the default detection configuration for flip-flops. More...
 
Configurationwith_stage_identification (bool enable=true)
 Enable stage identification as part of dataflow analysis. More...
 
Configurationwith_type_consistency (bool enable=true)
 Enable type consistency as part of dataflow analysis when deciding whether two gates are allowed to merge into the same group. More...
 

Public Attributes

Netlistnetlist
 The netlist to be analyzed. More...
 
u32 min_group_size = 8
 Minimum size of a group. Smaller groups will be penalized during analysis. Defaults to 8. More...
 
std::vector< u32expected_sizes = {}
 Expected group sizes. Groups of these sizes will be prioritized. Defaults to an empty vector. More...
 
std::vector< std::vector< Gate * > > known_gate_groups = {}
 Groups of gates that have already been identified as word-level groups beforehand. All gates of a group must be of one of the target gate types. Defaults to an empty vector. More...
 
std::vector< std::vector< Net * > > known_net_groups = {}
 Groups of nets that have been identified as word-level datapathes beforehand. Defaults to an empty vector. More...
 
std::set< const GateType * > gate_types = {}
 The gate types to be grouped by dataflow analysis. Defaults to an empty set. More...
 
std::set< PinTypecontrol_pin_types = {}
 The pin types of the pins to be considered control pins. Defaults to an empty set. More...
 
bool enable_stages = false
 Enable stage identification as part of dataflow analysis. Defaults to false. More...
 
bool enforce_type_consistency = false
 Enforce gate type consistency inside of a group. Defaults to false. More...
 

Detailed Description

Configuration of a dataflow analysis run.

This struct holds all information relevant for the configuration of a dataflow analysis run, including the netlist to analyze.

Definition at line 60 of file configuration.h.

Constructor & Destructor Documentation

◆ Configuration()

hal::dataflow::Configuration::Configuration ( Netlist nl)

Construct a new dataflow analysis configuration for the given netlist.

Parameters
[in]nl- The netlist.

Definition at line 13 of file configuration.cpp.

Member Function Documentation

◆ with_control_pin_types()

Configuration & hal::dataflow::Configuration::with_control_pin_types ( const std::set< PinType > &  types,
bool  overwrite = false 
)

Set the pin types of the pins to be considered control pins by dataflow analysis.

Overwrite the existing set of pin types by setting the optional overwrite flag to true.

Parameters
[in]types- A set of pin types.
[in]overwrite- Set true to overwrite existing set of pin types, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 290 of file configuration.cpp.

References control_pin_types.

Referenced by hal::GuiExtensionDataflow::execute_function(), and hal::PYBIND11_PLUGIN().

◆ with_expected_sizes()

Configuration & hal::dataflow::Configuration::with_expected_sizes ( const std::vector< u32 > &  sizes)

Set the expected group sizes. Groups of these sizes will be prioritized.

Parameters
[in]sizes- The expected group sizes.
Returns
The updated dataflow analysis configuration.

Definition at line 23 of file configuration.cpp.

References expected_sizes.

Referenced by hal::GuiExtensionDataflow::execute_function(), and hal::PYBIND11_PLUGIN().

◆ with_flip_flops()

Configuration & hal::dataflow::Configuration::with_flip_flops ( )

Use the default detection configuration for flip-flops.

Includes all flip-flop types as target gate types and sets clock, enable, set, and reset pins as control pins. Overwrites any existing gate type and control pin configuration.

Returns
The updated dataflow analysis configuration.

Definition at line 304 of file configuration.cpp.

References hal::clock, control_pin_types, hal::enable, hal::ff, hal::reset, hal::set, and with_gate_types().

Referenced by hal::PYBIND11_PLUGIN().

◆ with_gate_types() [1/2]

Configuration & hal::dataflow::Configuration::with_gate_types ( const std::set< const GateType * > &  types,
bool  overwrite = false 
)

Add the gate types to the set of gate types to be grouped by dataflow analysis.

Overwrite the existing set of gate types by setting the optional overwrite flag to true.

Parameters
[in]types- A set of gate types.
[in]overwrite- Set true to overwrite existing set of gate types, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 257 of file configuration.cpp.

References gate_types.

Referenced by hal::PYBIND11_PLUGIN(), with_flip_flops(), and with_gate_types().

◆ with_gate_types() [2/2]

Configuration & hal::dataflow::Configuration::with_gate_types ( const std::set< GateTypeProperty > &  type_properties,
bool  overwrite = false 
)

Add the gate types featuring the specified properties to the set of gate types to be grouped by dataflow analysis.

Overwrite the existing set of gate types by setting the optional overwrite flag to true.

Parameters
[in]type_properties- A set of gate type properties.
[in]overwrite- Set true to overwrite existing set of gate types, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 271 of file configuration.cpp.

References hal::Netlist::get_gate_library(), hal::GateLibrary::get_gate_types(), hal::GateType::has_property(), netlist, and with_gate_types().

◆ with_known_groups() [1/4]

Configuration & hal::dataflow::Configuration::with_known_groups ( const std::unordered_map< u32, std::unordered_set< Gate * >> &  groups,
bool  overwrite = false 
)

Add groups from a previous dataflow analysis run to the set of previously identified word-level groups.

These groups must only contain gates of the target gate types specified for analysis and will otherwise be ignored. The groups will be used to guide dataflow analysis, but will remain unaltered in the process. The group IDs will be ignored during analysis and the same group may be assigned a new ID.

Parameters
[in]groups- A map from group IDs to groups, each of them given as a set of gates.
[in]overwrite- Set true to overwrite existing set of identified word-level structures, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 241 of file configuration.cpp.

References known_gate_groups.

◆ with_known_groups() [2/4]

Configuration & hal::dataflow::Configuration::with_known_groups ( const std::vector< Module * > &  groups,
bool  overwrite = false 
)

Add modules to the set of previously identified word-level groups.

These groups must only contain gates of the target gate types specified for analysis and will otherwise be ignored. The groups will be used to guide dataflow analysis, but will remain unaltered in the process.

Parameters
[in]groups- A vector of modules.
[in]overwrite- Set true to overwrite the existing previously identified word-level groups, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 195 of file configuration.cpp.

References known_gate_groups.

Referenced by hal::PYBIND11_PLUGIN().

◆ with_known_groups() [3/4]

Configuration & hal::dataflow::Configuration::with_known_groups ( const std::vector< std::vector< Gate * >> &  groups,
bool  overwrite = false 
)

Add vectors of gates to the set of previously identified word-level groups.

These groups must only contain gates of the target gate types specified for analysis and will otherwise be ignored. The groups will be used to guide dataflow analysis, but will remain unaltered in the process.

Parameters
[in]groups- A vector of groups, each of them as a vector of gates.
[in]overwrite- Set true to overwrite existing set of identified word-level structures, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 210 of file configuration.cpp.

References known_gate_groups.

◆ with_known_groups() [4/4]

Configuration & hal::dataflow::Configuration::with_known_groups ( const std::vector< std::vector< u32 >> &  groups,
bool  overwrite = false 
)

Add vectors of gate IDs to the set of previously identified word-level groups.

These groups must only contain gates of the target gate types specified for analysis and will otherwise be ignored. The groups will be used to guide dataflow analysis, but will remain unaltered in the process.

Parameters
[in]groups- A vector of groups, each of them given as a vector of gate IDs.
[in]overwrite- Set true to overwrite existing set of identified word-level structures, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 224 of file configuration.cpp.

References known_gate_groups.

◆ with_known_structures() [1/6]

Configuration & hal::dataflow::Configuration::with_known_structures ( const std::unordered_map< const GateType *, std::vector< PinGroup< GatePin > * >> &  structures,
bool  overwrite = false 
)

Add all gates of a (typically large) gate type to the set of previously identified word-level structures.

The gate types do not have to be part of the target gate types. The input and output pin groups of the gates of these types will be used to guide datapath analysis. For each gate type, the input and output pin groups to be considered for analysis must be specified. An empty pin group vector results in all pin groups of the gate type being considered. Only pin groups larger than `min_group_size´ will be considered.

Parameters
[in]structures- A map from gates to a vector of a subset of their pin groups.
[in]overwrite- Set true to overwrite the existing known word-level structures, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 165 of file configuration.cpp.

References test_plugin::g, hal::Netlist::get_gates(), hal::input, known_net_groups, netlist, and hal::output.

◆ with_known_structures() [2/6]

Configuration & hal::dataflow::Configuration::with_known_structures ( const std::unordered_set< const GateType * > &  structures,
bool  overwrite = false 
)

Add all gates of a (typically large) gate type to the set of previously identified word-level structures.

The gate types do not have to be part of the target gate types. The input and output pin groups of the gates of these types will be used to guide datapath analysis. Only pin groups larger than `min_group_size´ will be considered.

Parameters
[in]structures- A set of gate types.
[in]overwrite- Set true to overwrite the existing known word-level structures, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 135 of file configuration.cpp.

References test_plugin::g, hal::Netlist::get_gates(), hal::input, known_net_groups, netlist, and hal::output.

◆ with_known_structures() [3/6]

Configuration & hal::dataflow::Configuration::with_known_structures ( const std::vector< Gate * > &  structures,
bool  overwrite = false 
)

Add (typically large) gates to the set of previously identified word-level structures.

The gates do not have to be of the target gate types. The input and output pin groups of these gates will be used to guide datapath analysis. Only pin groups larger than `min_group_size´ will be considered.

Parameters
[in]structures- A vector of gates.
[in]overwrite- Set true to overwrite the existing known word-level structures, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 75 of file configuration.cpp.

References hal::input, known_net_groups, and hal::output.

◆ with_known_structures() [4/6]

Configuration & hal::dataflow::Configuration::with_known_structures ( const std::vector< Module * > &  structures,
bool  overwrite = false 
)

Add modules to the set of previously identified word-level structures.

The gates contained in the modules do not have to be of the target gate types. The input and output pin groups of these modules will be used to guide datapath analysis. Only pin groups larger than `min_group_size´ will be considered.

Parameters
[in]structures- A vector of modules.
[in]overwrite- Set true to overwrite the existing known word-level structures, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 29 of file configuration.cpp.

References known_net_groups.

Referenced by hal::PYBIND11_PLUGIN().

◆ with_known_structures() [5/6]

Configuration & hal::dataflow::Configuration::with_known_structures ( const std::vector< std::pair< Gate *, std::vector< PinGroup< GatePin > * >>> &  structures,
bool  overwrite = false 
)

Add (typically large) gates to the set of previously identified word-level structures.

The gates do not have to be of the target gate types. The input and output pin groups of these gates will be used to guide datapath analysis. For each gate, the input and output pin groups to be considered for analysis must be specified. An empty pin group vector results in all pin groups of the gate being considered. Only pin groups larger than `min_group_size´ will be considered.

Parameters
[in]structures- A vector of gates, each of them with a vector of gate pin groups.
[in]overwrite- Set true to overwrite the existing known word-level structures, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 105 of file configuration.cpp.

References hal::input, known_net_groups, and hal::output.

◆ with_known_structures() [6/6]

Configuration & hal::dataflow::Configuration::with_known_structures ( const std::vector< std::pair< Module *, std::vector< PinGroup< ModulePin > * >>> &  structures,
bool  overwrite = false 
)

Add modules to the set of previously identified word-level structures.

The gates contained in the modules do not have to be of the target gate types. The input and output pin groups of these modules will be used to guide datapath analysis. For each module, the input and output pin groups to be considered for analysis must be specified. An empty pin group vector results in all pin groups of the module being considered. Only pin groups larger than `min_group_size´ will be considered.

Parameters
[in]structures- A vector of modules, each of them with a vector of module pin groups.
[in]overwrite- Set true to overwrite the existing known word-level structures, false otherwise. Defaults to false.
Returns
The updated dataflow analysis configuration.

Definition at line 52 of file configuration.cpp.

References known_net_groups.

◆ with_min_group_size()

Configuration & hal::dataflow::Configuration::with_min_group_size ( u32  size)

Set the minimum size of a group. Smaller groups will be penalized during analysis.

Parameters
[in]size- The minimum group size.
Returns
The updated dataflow analysis configuration.

Definition at line 17 of file configuration.cpp.

References min_group_size.

Referenced by hal::GuiExtensionDataflow::execute_function(), and hal::PYBIND11_PLUGIN().

◆ with_stage_identification()

Configuration & hal::dataflow::Configuration::with_stage_identification ( bool  enable = true)

Enable stage identification as part of dataflow analysis.

Parameters
[in]enable- Set true to enable stage identification, false otherwise. Defaults to true.
Returns
The updated dataflow analysis configuration.

Definition at line 312 of file configuration.cpp.

References enable_stages.

Referenced by hal::GuiExtensionDataflow::execute_function(), and hal::PYBIND11_PLUGIN().

◆ with_type_consistency()

Configuration & hal::dataflow::Configuration::with_type_consistency ( bool  enable = true)

Enable type consistency as part of dataflow analysis when deciding whether two gates are allowed to merge into the same group.

Parameters
[in]enable- Set true to enable type consistency inside of a group, false otherwise. Defaults to true.
Returns
The updated dataflow analysis configuration.

Definition at line 318 of file configuration.cpp.

References enforce_type_consistency.

Referenced by hal::PYBIND11_PLUGIN().

Member Data Documentation

◆ control_pin_types

std::set<PinType> hal::dataflow::Configuration::control_pin_types = {}

The pin types of the pins to be considered control pins. Defaults to an empty set.

Definition at line 102 of file configuration.h.

Referenced by hal::dataflow::analyze(), hal::PYBIND11_PLUGIN(), with_control_pin_types(), and with_flip_flops().

◆ enable_stages

bool hal::dataflow::Configuration::enable_stages = false

Enable stage identification as part of dataflow analysis. Defaults to false.

Definition at line 107 of file configuration.h.

Referenced by hal::PYBIND11_PLUGIN(), hal::dataflow::pre_processing::run(), and with_stage_identification().

◆ enforce_type_consistency

bool hal::dataflow::Configuration::enforce_type_consistency = false

Enforce gate type consistency inside of a group. Defaults to false.

Definition at line 112 of file configuration.h.

Referenced by hal::dataflow::analyze(), hal::PYBIND11_PLUGIN(), and with_type_consistency().

◆ expected_sizes

std::vector<u32> hal::dataflow::Configuration::expected_sizes = {}

Expected group sizes. Groups of these sizes will be prioritized. Defaults to an empty vector.

Definition at line 82 of file configuration.h.

Referenced by hal::dataflow::analyze(), hal::CliExtensionDataflow::handle_cli_call(), hal::PYBIND11_PLUGIN(), and with_expected_sizes().

◆ gate_types

std::set<const GateType*> hal::dataflow::Configuration::gate_types = {}

The gate types to be grouped by dataflow analysis. Defaults to an empty set.

Definition at line 97 of file configuration.h.

Referenced by hal::dataflow::analyze(), hal::PYBIND11_PLUGIN(), and with_gate_types().

◆ known_gate_groups

std::vector<std::vector<Gate*> > hal::dataflow::Configuration::known_gate_groups = {}

Groups of gates that have already been identified as word-level groups beforehand. All gates of a group must be of one of the target gate types. Defaults to an empty vector.

Definition at line 87 of file configuration.h.

Referenced by hal::PYBIND11_PLUGIN(), and with_known_groups().

◆ known_net_groups

std::vector<std::vector<Net*> > hal::dataflow::Configuration::known_net_groups = {}

Groups of nets that have been identified as word-level datapathes beforehand. Defaults to an empty vector.

Definition at line 92 of file configuration.h.

Referenced by hal::dataflow::analyze(), hal::PYBIND11_PLUGIN(), and with_known_structures().

◆ min_group_size

u32 hal::dataflow::Configuration::min_group_size = 8

Minimum size of a group. Smaller groups will be penalized during analysis. Defaults to 8.

Definition at line 77 of file configuration.h.

Referenced by hal::dataflow::analyze(), hal::CliExtensionDataflow::handle_cli_call(), hal::PYBIND11_PLUGIN(), and with_min_group_size().

◆ netlist

Netlist* hal::dataflow::Configuration::netlist

The netlist to be analyzed.

Definition at line 72 of file configuration.h.

Referenced by hal::dataflow::analyze(), hal::dataflow::pre_processing::run(), with_gate_types(), and with_known_structures().


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