This class can be used as a lookup table between an instance id of a module or hierarchical channel and the instance tree. More...
#include <path_instance_mapper.h>
Public Types | |
typedef std::pair < InstanceTree, int > | PathWithID |
Public Member Functions | |
PathInstanceMapper () | |
This is the default constructor and need a design and a segment graph. The lookup table will be automatically created. | |
void | determine_lookup_table (InstanceTree root) |
This function traverses the design and pushes all modules and hierarchical channel instances into the path_to_id_mapping_ lookup table. The traversing is dependent on the declaration oder of the member variables. Also, it follows depth first search. CAUTION: The function Design::reset_instance_counter() must be used first! Otherwise wrong intance id's a generated! | |
void | print_mapping () |
The function prints the lookup table in the terminal. | |
int | get_id (InstanceTree tree) |
This function returns for a given tree the corresponding instance id. | |
InstanceTree | get_instance_tree (int id, std::list< InstanceTree > potential_instances) |
This function returns for a given id and potential mapping candidates the corresponding instance tree. | |
Public Attributes | |
std::vector< PathWithID > | path_to_id_mapping_ |
This is the lookup table from path to instance id. | |
int | max_instances_ |
This variable counts what is the max of instances. |
This class can be used as a lookup table between an instance id of a module or hierarchical channel and the instance tree.
typedef std::pair<InstanceTree, int> risc::PathInstanceMapper::PathWithID |
risc::PathInstanceMapper::PathInstanceMapper | ( | ) |
This is the default constructor and need a design and a segment graph. The lookup table will be automatically created.
void risc::PathInstanceMapper::determine_lookup_table | ( | InstanceTree | root | ) |
This function traverses the design and pushes all modules and hierarchical channel instances into the path_to_id_mapping_ lookup table. The traversing is dependent on the declaration oder of the member variables. Also, it follows depth first search. CAUTION: The function Design::reset_instance_counter() must be used first! Otherwise wrong intance id's a generated!
determine_lookup_table
int risc::PathInstanceMapper::get_id | ( | InstanceTree | tree | ) |
This function returns for a given tree the corresponding instance id.
get_id
risc::InstanceTree risc::PathInstanceMapper::get_instance_tree | ( | int | id, | |
std::list< InstanceTree > | potential_instances | |||
) |
This function returns for a given id and potential mapping candidates the corresponding instance tree.
get_instance_Tree
void risc::PathInstanceMapper::print_mapping | ( | ) |
The function prints the lookup table in the terminal.
print_mapping
This variable counts what is the max of instances.
std::vector<PathWithID> risc::PathInstanceMapper::path_to_id_mapping_ |
This is the lookup table from path to instance id.