PandA-2024.02
|
#include <storage_value_information.hpp>
Public Member Functions | |
StorageValueInformation (const HLS_managerConstRef HLS_mgr, const unsigned int function_id) | |
Constructor. More... | |
virtual | ~StorageValueInformation () |
Destructor. More... | |
void | Initialize () |
Initialize the step (i.e., like a constructor) More... | |
unsigned int | get_number_of_storage_values () const |
Returns the number of storage values inserted. More... | |
virtual bool | is_a_storage_value (vertex curr_vertex, unsigned int var_index)=0 |
return true in case a storage value exist for the pair vertex variable More... | |
virtual unsigned int | get_storage_value_index (vertex curr_vertex, unsigned int var_index)=0 |
Returns the index of the storage value associated with the variable in a given vertex. More... | |
unsigned int | get_variable_index (unsigned int storage_value_index) const |
Returns the index of the variable associated with the storage value in a given vertex. More... | |
int | get_compatibility_weight (unsigned int storage_value_index1, unsigned int storage_value_index2) const |
return a weight that estimate how much two storage values are compatible. More... | |
virtual void | set_storage_value_index (vertex curr_state, unsigned int variable, unsigned int sv)=0 |
assign a storage value to a couple state-variable More... | |
bool | are_value_bitsize_compatible (unsigned int storage_value_index1, unsigned int storage_value_index2) const |
return the in case the storage values have compatible size More... | |
Protected Attributes | |
unsigned int | number_of_storage_values |
current number of storage values More... | |
CustomUnorderedMap< unsigned int, unsigned int > | variable_index_map |
put into relation storage value index with variables More... | |
CustomUnorderedMap< unsigned int, vertex > | vw2vertex |
relation between var written and operations More... | |
const HLS_managerConstRef | HLS_mgr |
The HLS manager. More... | |
const unsigned int | function_id |
The index of the function. More... | |
OpGraphConstRef | data |
operation graph used to compute the affinity between storage values More... | |
Wrefcount< const fu_binding > | fu |
functional unit assignments More... | |
Friends | |
class | values_scheme |
Definition at line 56 of file storage_value_information.hpp.
StorageValueInformation::StorageValueInformation | ( | const HLS_managerConstRef | _HLS_mgr, |
const unsigned int | _function_id | ||
) |
Constructor.
Header include.
Autoheader include behavior include HLS include HLS/binding/module_binding includes tree includes
Definition at line 65 of file storage_value_information.cpp.
References ~StorageValueInformation().
|
virtualdefault |
bool StorageValueInformation::are_value_bitsize_compatible | ( | unsigned int | storage_value_index1, |
unsigned int | storage_value_index2 | ||
) | const |
return the in case the storage values have compatible size
storage_value_index1 | is the first storage value |
storage_value_index2 | is the second storage value |
Definition at line 371 of file storage_value_information.cpp.
References get_variable_index(), HLS_mgr, tree_helper::IsRealType(), tree_helper::IsSignedIntegerType(), and tree_helper::Size().
Referenced by compatibility_based_register::create_compatibility_graph(), and conflict_based_register::create_conflict_graph().
int StorageValueInformation::get_compatibility_weight | ( | unsigned int | storage_value_index1, |
unsigned int | storage_value_index2 | ||
) | const |
return a weight that estimate how much two storage values are compatible.
An high value returned means an high compatibility between the two storage values.
disabled input register sharing
Definition at line 134 of file storage_value_information.cpp.
References OpGraph::CGetOpNodeInfo(), data, DEBUG_LEVEL_VERY_PEDANTIC, fu, GET_NAME, GET_TYPE, get_variable_index(), HLS_mgr, INDENT_DBG_MEX, INFINITE_UINT, Wrefcount< T >::lock(), SCALAR, STR, THROW_ASSERT, THROW_ERROR, TYPE_ENTRY, TYPE_PHI, USE, and vw2vertex.
Referenced by compatibility_based_register::create_compatibility_graph().
unsigned int StorageValueInformation::get_number_of_storage_values | ( | ) | const |
Returns the number of storage values inserted.
Definition at line 122 of file storage_value_information.cpp.
References number_of_storage_values.
Referenced by compatibility_based_register::create_compatibility_graph(), conflict_based_register::create_conflict_graph(), unique_binding_register::RegisterBinding(), chordal_coloring_register::RegisterBinding(), and weighted_clique_register::RegisterBinding().
|
pure virtual |
Returns the index of the storage value associated with the variable in a given vertex.
curr_vertex | is the vertex |
var_index | is the variable |
Implemented in StorageValueInformationFsm, and StorageValueInformationPipeline.
Referenced by reg_binding::bind(), mux_connection_binding::connect_to_registers(), compatibility_based_register::create_compatibility_graph(), conflict_based_register::create_conflict_graph(), mux_connection_binding::create_connections(), fsm_controller::create_state_machine(), estimate_muxes(), port_swapping::InternalExec(), vertex_coloring_register::RegisterBinding(), chordal_coloring_register::RegisterBinding(), and weighted_clique_register::RegisterBinding().
unsigned int StorageValueInformation::get_variable_index | ( | unsigned int | storage_value_index | ) | const |
Returns the index of the variable associated with the storage value in a given vertex.
Definition at line 127 of file storage_value_information.cpp.
References THROW_ASSERT, and variable_index_map.
Referenced by are_value_bitsize_compatible(), get_compatibility_weight(), reg_binding::get_vars(), and reg_binding::print_el().
void StorageValueInformation::Initialize | ( | ) |
Initialize the step (i.e., like a constructor)
initialize the vw2vertex relation
Definition at line 72 of file storage_value_information.cpp.
References FunctionBehavior::CGetOpGraph(), OpGraph::CGetOpNodeInfo(), tree_manager::CGetTreeNode(), counter, data, DEBUG_LEVEL_NONE, DEFINITION, FunctionBehavior::DFG, fu, function_id, GET_NAME, GET_TYPE, HLS_mgr, INDENT_DBG_MEX, tree_helper::is_parameter(), tree_helper::is_ssa_name(), tree_helper::is_virtual(), hls::Rfu, SCALAR, hls::storage_value_information, STR, THROW_UNREACHABLE, TYPE_ENTRY, and vw2vertex.
Referenced by storage_value_insertion::Initialize(), and values_scheme::Initialize().
|
pure virtual |
return true in case a storage value exist for the pair vertex variable
curr_vertex | is the vertex |
var_index | is the variable |
Implemented in StorageValueInformationFsm, and StorageValueInformationPipeline.
Referenced by mux_connection_binding::connect_to_registers(), mux_connection_binding::create_connections(), fsm_controller::create_state_machine(), estimate_muxes(), values_scheme::InternalExec(), and port_swapping::InternalExec().
|
pure virtual |
assign a storage value to a couple state-variable
curr_state | is the current state |
variable | is the assigned variable |
sv | is the assigned storage value |
Implemented in StorageValueInformationFsm, and StorageValueInformationPipeline.
Referenced by values_scheme::InternalExec().
|
friend |
Definition at line 59 of file storage_value_information.hpp.
|
protected |
operation graph used to compute the affinity between storage values
Definition at line 77 of file storage_value_information.hpp.
Referenced by get_compatibility_weight(), and Initialize().
|
protected |
functional unit assignments
Definition at line 80 of file storage_value_information.hpp.
Referenced by get_compatibility_weight(), and Initialize().
|
protected |
The index of the function.
Definition at line 74 of file storage_value_information.hpp.
Referenced by Initialize().
|
protected |
The HLS manager.
Definition at line 71 of file storage_value_information.hpp.
Referenced by are_value_bitsize_compatible(), get_compatibility_weight(), and Initialize().
|
protected |
current number of storage values
Definition at line 62 of file storage_value_information.hpp.
Referenced by get_number_of_storage_values(), and values_scheme::InternalExec().
|
protected |
put into relation storage value index with variables
Definition at line 65 of file storage_value_information.hpp.
Referenced by get_variable_index(), and values_scheme::InternalExec().
|
protected |
relation between var written and operations
Definition at line 68 of file storage_value_information.hpp.
Referenced by get_compatibility_weight(), and Initialize().