![]() |
HAL
|
Result of a dataflow analysis run. More...
#include <result.h>
Public Member Functions | |
Result (Netlist *nl, const Grouping &grouping) | |
Netlist * | get_netlist () const |
Get the netlist on which dataflow analysis has been performed. More... | |
const std::unordered_map< u32, std::unordered_set< Gate * > > & | get_groups () const |
Get the groups of sequential gates resulting from dataflow analysis. More... | |
std::vector< Gate * > | get_gates () const |
Get all gates contained in any of the groups groups. More... | |
hal::Result< std::unordered_set< Gate * > > | get_gates_of_group (const u32 group_id) const |
Get the gates of the specified group of sequential gates. More... | |
hal::Result< u32 > | get_group_id_of_gate (const Gate *gate) const |
Get the group ID of the group that contains the given gate. More... | |
hal::Result< std::unordered_set< Net * > > | get_group_control_nets (const u32 group_id, const PinType type) const |
Get the control nets of the group with the given group ID that are connected to a pin of the specified type. More... | |
hal::Result< std::unordered_set< Net * > > | get_gate_control_nets (const Gate *gate, const PinType type) const |
Get the control nets of the given gate that are connected to a pin of the specified type. More... | |
hal::Result< std::unordered_set< u32 > > | get_group_successors (const u32 group_id) const |
Get the successor groups of the group with the given ID. More... | |
hal::Result< std::unordered_set< Gate * > > | get_gate_successors (const Gate *gate) const |
Get the sequential successor gates of the given sequential gate. More... | |
hal::Result< std::unordered_set< u32 > > | get_group_predecessors (const u32 group_id) const |
Get the predecessor groups of the group with the given ID. More... | |
hal::Result< std::unordered_set< Gate * > > | get_gate_predecessors (const Gate *gate) const |
Get the sequential predecessor gates of the given sequential gate. More... | |
hal::Result< std::monostate > | write_dot (const std::filesystem::path &out_path, const std::unordered_set< u32 > &group_ids={}) const |
Write the dataflow graph as a DOT graph to the specified location. More... | |
hal::Result< std::monostate > | write_txt (const std::filesystem::path &out_path, const std::unordered_set< u32 > &group_ids={}) const |
Write the groups resulting from dataflow analysis to a .txt file. More... | |
hal::Result< std::unordered_map< u32, Module * > > | create_modules (const std::unordered_set< u32 > &group_ids={}) const |
Create modules for the dataflow analysis result. More... | |
hal::Result< std::unordered_map< u32, Module * > > | create_modules (const std::map< const GateType *, std::string > &module_suffixes, const std::map< std::pair< PinDirection, std::string >, std::string > &pin_prefixes, const std::unordered_set< u32 > &group_ids) const |
Create modules for the dataflow analysis result. More... | |
hal::Result< std::unordered_map< u32, Module * > > | create_modules (const std::map< GateTypeProperty, std::string > &module_suffixes, const std::map< std::pair< PinDirection, std::string >, std::string > &pin_prefixes, const std::unordered_set< u32 > &group_ids) const |
Create modules for the dataflow analysis result. More... | |
std::vector< std::vector< Gate * > > | get_groups_as_list (const std::unordered_set< u32 > &group_ids={}) const |
Get the groups of the dataflow analysis result as a list. More... | |
hal::Result< u32 > | merge_groups (const std::vector< u32 > &group_ids) |
Merge multiple groups specified by ID. More... | |
hal::Result< std::vector< u32 > > | split_group (u32 group_id, const std::vector< std::unordered_set< Gate * >> &new_groups) |
Split a group into multiple smaller groups specified by sets of gates. More... | |
Result of a dataflow analysis run.
This class holds result of a dataflow analysis run, which contains the identified groups of sequential gates and their interconnections. Each such group is assigned a unique ID by which it can be addressed in many of the member functions of this class. Please note that this ID is not related to any other HAL ID.
Definition at line 29 of file result.cpp.
References hal::dataflow::Grouping::gates_of_group, hal::dataflow::Grouping::get_control_signals_of_group(), hal::Netlist::get_gate_by_id(), hal::Netlist::get_net_by_id(), hal::dataflow::Grouping::get_predecessor_groups_of_group(), hal::dataflow::Grouping::get_successor_groups_of_group(), hal::dataflow::Grouping::netlist_abstr, and type.
hal::Result< std::unordered_map< u32, Module * > > hal::dataflow::Result::create_modules | ( | const std::map< const GateType *, std::string > & | module_suffixes, |
const std::map< std::pair< PinDirection, std::string >, std::string > & | pin_prefixes, | ||
const std::unordered_set< u32 > & | group_ids | ||
) | const |
Create modules for the dataflow analysis result.
Please note that the IDs of the module are assigned independent of the group IDs of the register groups.
[in] | module_suffixes | - The suffixes to use for modules containing only gates of a specific gate type. Defaults to "module" for mixed and unspecified gate types. |
[in] | pin_prefixes | - The prefixes to use for the module pins that (within the module) only connect to gate pins of a specific name. |
[in] | group_ids | - The group IDs to consider. If no IDs are provided, all groups will be considered. |
Definition at line 422 of file result.cpp.
References hal::Endpoint::get_gate(), hal::PinGroup< T >::get_type(), hal::input, log_info, log_warning, OK, hal::output, and hal::utils::starts_with().
hal::Result< std::unordered_map< u32, Module * > > hal::dataflow::Result::create_modules | ( | const std::map< GateTypeProperty, std::string > & | module_suffixes, |
const std::map< std::pair< PinDirection, std::string >, std::string > & | pin_prefixes, | ||
const std::unordered_set< u32 > & | group_ids | ||
) | const |
Create modules for the dataflow analysis result.
Please note that the IDs of the module are assigned independent of the group IDs of the register groups.
[in] | module_suffixes | - The suffixes to use for modules containing only gates of a specific gate type. All gate types featuring the specified gate type property are considered, but the module must still be pure (i.e., all gates must be of the same type) for the suffix to be used. Defaults to "module" for mixed and unspecified gate types. |
[in] | pin_prefixes | - The prefixes to use for the module pins that (within the module) only connect to gate pins of a specific name. |
[in] | group_ids | - The group IDs to consider. If no IDs are provided, all groups will be considered. |
Definition at line 597 of file result.cpp.
References type.
hal::Result< std::unordered_map< u32, Module * > > hal::dataflow::Result::create_modules | ( | const std::unordered_set< u32 > & | group_ids = {} | ) | const |
Create modules for the dataflow analysis result.
Please note that the IDs of the module are assigned independent of the group IDs of the register groups.
[in] | group_ids | - The group IDs to consider. If an empty set is provided, all groups will be considered. Defaults to an empty set. |
Definition at line 417 of file result.cpp.
hal::Result< std::unordered_set< Net * > > hal::dataflow::Result::get_gate_control_nets | ( | const Gate * | gate, |
const PinType | type | ||
) | const |
Get the control nets of the given gate that are connected to a pin of the specified type.
[in] | gate | - The gate. |
[in] | type | - The pin type. |
Definition at line 169 of file result.cpp.
hal::Result< std::unordered_set< Gate * > > hal::dataflow::Result::get_gate_predecessors | ( | const Gate * | gate | ) | const |
Get the sequential predecessor gates of the given sequential gate.
[in] | gate | - The gate. |
Definition at line 233 of file result.cpp.
hal::Result< std::unordered_set< Gate * > > hal::dataflow::Result::get_gate_successors | ( | const Gate * | gate | ) | const |
Get the sequential successor gates of the given sequential gate.
[in] | gate | - The gate. |
Definition at line 203 of file result.cpp.
std::vector< Gate * > hal::dataflow::Result::get_gates | ( | ) | const |
Get all gates contained in any of the groups groups.
Definition at line 109 of file result.cpp.
Referenced by hal::PYBIND11_PLUGIN().
hal::Result< std::unordered_set< Gate * > > hal::dataflow::Result::get_gates_of_group | ( | const u32 | group_id | ) | const |
Get the gates of the specified group of sequential gates.
[in] | group_id | - The ID of the group. |
Definition at line 121 of file result.cpp.
hal::Result< std::unordered_set< Net * > > hal::dataflow::Result::get_group_control_nets | ( | const u32 | group_id, |
const PinType | type | ||
) | const |
Get the control nets of the group with the given group ID that are connected to a pin of the specified type.
[in] | group_id | - The group ID. |
[in] | type | - The pin type. |
Definition at line 150 of file result.cpp.
hal::Result< u32 > hal::dataflow::Result::get_group_id_of_gate | ( | const Gate * | gate | ) | const |
Get the group ID of the group that contains the given gate.
[in] | gate | - The gate. |
Definition at line 133 of file result.cpp.
hal::Result< std::unordered_set< u32 > > hal::dataflow::Result::get_group_predecessors | ( | const u32 | group_id | ) | const |
Get the predecessor groups of the group with the given ID.
[in] | group_id | - The group ID. |
Definition at line 218 of file result.cpp.
hal::Result< std::unordered_set< u32 > > hal::dataflow::Result::get_group_successors | ( | const u32 | group_id | ) | const |
Get the successor groups of the group with the given ID.
[in] | group_id | - The group ID. |
Definition at line 188 of file result.cpp.
const std::unordered_map< u32, std::unordered_set< Gate * > > & hal::dataflow::Result::get_groups | ( | ) | const |
Get the groups of sequential gates resulting from dataflow analysis.
Definition at line 104 of file result.cpp.
Referenced by hal::PYBIND11_PLUGIN().
std::vector< std::vector< Gate * > > hal::dataflow::Result::get_groups_as_list | ( | const std::unordered_set< u32 > & | group_ids = {} | ) | const |
Get the groups of the dataflow analysis result as a list.
[in] | group_ids | - The group IDs to consider. If no IDs are provided, all groups will be considered. Defaults to an empty set. |
Definition at line 614 of file result.cpp.
Referenced by hal::PYBIND11_PLUGIN().
Netlist * hal::dataflow::Result::get_netlist | ( | ) | const |
Get the netlist on which dataflow analysis has been performed.
Definition at line 99 of file result.cpp.
Referenced by hal::PYBIND11_PLUGIN().
hal::Result< u32 > hal::dataflow::Result::merge_groups | ( | const std::vector< u32 > & | group_ids | ) |
Merge multiple groups specified by ID.
All specified groups are merged into the first group of the provided vector and are subsequently deleted.
[in] | group_ids | - The group IDs of the groups to merge. |
Definition at line 634 of file result.cpp.
References ERR, test_plugin::g, and OK.
hal::Result< std::vector< u32 > > hal::dataflow::Result::split_group | ( | u32 | group_id, |
const std::vector< std::unordered_set< Gate * >> & | new_groups | ||
) |
Split a group into multiple smaller groups specified by sets of gates.
All gates of the group to split must be contained in the sets exactly once and all gates in the sets must be contained in the group to split. The group that is being split is deleted in the process.
[in] | group_id | - The group ID of the group to split. |
[in] | new_groups | - A vector of groups specified as unordered sets of gates. |
Definition at line 707 of file result.cpp.
References hal::clock, hal::enable, ERR, test_plugin::g, OK, hal::reset, hal::set, and type.
hal::Result< std::monostate > hal::dataflow::Result::write_dot | ( | const std::filesystem::path & | out_path, |
const std::unordered_set< u32 > & | group_ids = {} |
||
) | const |
Write the dataflow graph as a DOT graph to the specified location.
[in] | out_path | - The output path. |
[in] | group_ids | - The group IDs to consider. If no IDs are provided, all groups will be considered. Defaults to an empty set. |
Definition at line 248 of file result.cpp.
hal::Result< std::monostate > hal::dataflow::Result::write_txt | ( | const std::filesystem::path & | out_path, |
const std::unordered_set< u32 > & | group_ids = {} |
||
) | const |
Write the groups resulting from dataflow analysis to a .txt
file.
[in] | out_path | - The output path. |
[in] | group_ids | - The group IDs to consider. If no IDs are provided, all groups will be considered. Defaults to an empty set. |
Definition at line 321 of file result.cpp.
References hal::clock, hal::data, hal::enable, ERR, id, hal::utils::join(), log_info, name, OK, hal::reset, hal::set, and type.