![]() |
HAL
|
Configuration of a dataflow analysis run. More...
#include <configuration.h>
Public Member Functions | |
Configuration (Netlist *nl) | |
Construct a new dataflow analysis configuration for the given netlist. More... | |
Configuration & | with_min_group_size (u32 size) |
Set the minimum size of a group. Smaller groups will be penalized during analysis. More... | |
Configuration & | with_expected_sizes (const std::vector< u32 > &sizes) |
Set the expected group sizes. Groups of these sizes will be prioritized. More... | |
Configuration & | with_known_structures (const std::vector< Module * > &structures, bool overwrite=false) |
Add modules to the set of previously identified word-level structures. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Configuration & | with_known_groups (const std::vector< Module * > &groups, bool overwrite=false) |
Add modules to the set of previously identified word-level groups. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Configuration & | with_flip_flops () |
Use the default detection configuration for flip-flops. More... | |
Configuration & | with_stage_identification (bool enable=true) |
Enable stage identification as part of dataflow analysis. More... | |
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. More... | |
Public Attributes | |
Netlist * | netlist |
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< u32 > | expected_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< PinType > | control_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... | |
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.
hal::dataflow::Configuration::Configuration | ( | Netlist * | nl | ) |
Construct a new dataflow analysis configuration for the given netlist.
[in] | nl | - The netlist. |
Definition at line 13 of file configuration.cpp.
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
.
[in] | types | - A set of pin types. |
[in] | overwrite | - Set true to overwrite existing set of pin types, false otherwise. Defaults to false . |
Definition at line 290 of file configuration.cpp.
References control_pin_types.
Referenced by hal::GuiExtensionDataflow::execute_function(), and hal::PYBIND11_PLUGIN().
Configuration & hal::dataflow::Configuration::with_expected_sizes | ( | const std::vector< u32 > & | sizes | ) |
Set the expected group sizes. Groups of these sizes will be prioritized.
[in] | sizes | - The expected group sizes. |
Definition at line 23 of file configuration.cpp.
References expected_sizes.
Referenced by hal::GuiExtensionDataflow::execute_function(), and hal::PYBIND11_PLUGIN().
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.
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().
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
.
[in] | types | - A set of gate types. |
[in] | overwrite | - Set true to overwrite existing set of gate types, false otherwise. Defaults to false . |
Definition at line 257 of file configuration.cpp.
References gate_types.
Referenced by hal::PYBIND11_PLUGIN(), with_flip_flops(), and with_gate_types().
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
.
[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 . |
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().
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.
[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 . |
Definition at line 241 of file configuration.cpp.
References known_gate_groups.
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.
[in] | groups | - A vector of modules. |
[in] | overwrite | - Set true to overwrite the existing previously identified word-level groups, false otherwise. Defaults to false . |
Definition at line 195 of file configuration.cpp.
References known_gate_groups.
Referenced by hal::PYBIND11_PLUGIN().
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.
[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 . |
Definition at line 210 of file configuration.cpp.
References known_gate_groups.
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.
[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 . |
Definition at line 224 of file configuration.cpp.
References known_gate_groups.
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.
[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 . |
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.
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.
[in] | structures | - A set of gate types. |
[in] | overwrite | - Set true to overwrite the existing known word-level structures, false otherwise. Defaults to false . |
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.
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.
[in] | structures | - A vector of gates. |
[in] | overwrite | - Set true to overwrite the existing known word-level structures, false otherwise. Defaults to false . |
Definition at line 75 of file configuration.cpp.
References hal::input, known_net_groups, and hal::output.
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.
[in] | structures | - A vector of modules. |
[in] | overwrite | - Set true to overwrite the existing known word-level structures, false otherwise. Defaults to false . |
Definition at line 29 of file configuration.cpp.
References known_net_groups.
Referenced by hal::PYBIND11_PLUGIN().
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.
[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 . |
Definition at line 105 of file configuration.cpp.
References hal::input, known_net_groups, and hal::output.
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.
[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 . |
Definition at line 52 of file configuration.cpp.
References known_net_groups.
Configuration & hal::dataflow::Configuration::with_min_group_size | ( | u32 | size | ) |
Set the minimum size of a group. Smaller groups will be penalized during analysis.
[in] | size | - The minimum group size. |
Definition at line 17 of file configuration.cpp.
References min_group_size.
Referenced by hal::GuiExtensionDataflow::execute_function(), and hal::PYBIND11_PLUGIN().
Configuration & hal::dataflow::Configuration::with_stage_identification | ( | bool | enable = true | ) |
Enable stage identification as part of dataflow analysis.
[in] | enable | - Set true to enable stage identification, false otherwise. Defaults to true . |
Definition at line 312 of file configuration.cpp.
References enable_stages.
Referenced by hal::GuiExtensionDataflow::execute_function(), and hal::PYBIND11_PLUGIN().
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.
[in] | enable | - Set true to enable type consistency inside of a group, false otherwise. Defaults to true . |
Definition at line 318 of file configuration.cpp.
References enforce_type_consistency.
Referenced by hal::PYBIND11_PLUGIN().
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().
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().
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().
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().
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().
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().
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().
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* 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().