CGRA-ME
|
#include <ClusteredMapper.h>
Public Types | |
using | OpsNotToCluster = std::pair< OpGraphOpDesc, OpGraphOpDesc > |
using | opPair = std::pair< OpGraphOp *, OpGraphOp * > |
Public Member Functions | |
TMPack (ClusteredMapperDriver &driver, Module *topLevelModule, std::shared_ptr< OpGraph > opgraph, const MRRG &mrrg, int rows, int cols, int II, bool isElastic=false) | |
void | clusterMemoryOperations (std::set< OpGraphOpDesc > *) |
void | getFirstOps (std::queue< OpGraphOpDesc > &operations) |
bool | clusterPEs (bool cluster) |
void | createSingleOpClusters () |
bool | checkIfOutputPortsNeeded (OpGraphValDesc val, std::vector< OpGraphOpDesc > &ops) |
bool | checkIfInputPortsNeeded (OpGraphOpDesc source_op, std::vector< OpGraphOpDesc > &ops) |
bool | checkPortConn (std::vector< std::pair< OpGraphOpDesc, OpGraphOpDesc >> &global_port_connection, int i, std::set< MRRGNodeDesc > ports_used, std::set< OpGraphOpDesc > out_port_found, std::map< OpGraphOpDesc, std::set< MRRGNodeDesc >> &op_to_port_nodes, std::string submodule, bool isInput) |
bool | checkPortsOfOperation (std::vector< std::pair< OpGraphOpDesc, OpGraphOpDesc >> global_port_connection, std::map< OpGraphOpDesc, std::vector< MRRGNodeDesc >> &ops_mrrg_nodes, std::set< OpGraphOpDesc > exlusive_port_operation, std::string submodule, bool isInput) |
bool | checkConnectedOperations (std::pair< OpGraphOpDesc, OpGraphOpDesc >, std::map< OpGraphOpDesc, std::vector< MRRGNodeDesc >> &ops_mrrg_nodes, std::string submodule) |
void | setSourceOpNodes (std::vector< MRRGNodeDesc > &source_op_nodes, OpGraphOpDesc source_op, std::string submodule) |
void | checkIfAllOpsAreClustered () |
void | getModulesToMapOp (OpGraphOpDesc op, std::map< std::string, MRRGNodeDesc > &modules_could_map_op) |
void | setReachesOutputPorts (std::map< MRRGNodeDesc, std::set< MRRGNodeDesc >> &connected_nodes, std::vector< MRRGNodeDesc > &op_mrrg_nodes, std::string submodule) |
void | setReachesInputPorts (std::map< MRRGNodeDesc, std::set< MRRGNodeDesc >> &connected_nodes, std::vector< MRRGNodeDesc > &op_mrrg_nodes, std::string submodule) |
void | addNextOps (std::vector< OpGraphOpDesc > *next_ops, OpGraphOpDesc op) |
bool | checkReachbitlity (std::vector< OpGraphOpDesc > &, std::string) |
void | setPortsForSubmodule (std::string) |
bool | isReachable (MRRGNodeDesc source, MRRGNodeDesc sink, std::string, Latency cycles=-1) |
void | resolveReachability (OpGraphOpDesc source, OpGraphOpDesc sink, OpGraphVal *val) |
void | opsCouldBeClustered (std::vector< OpGraphOpDesc > nextOps, std::vector< MRRGNodeDesc > &used_nodes, std::vector< OpGraphOpDesc > &used_ops, std::set< OpGraphOpDesc > &visitedOps, std::string subModule) |
std::unordered_map< OpGraphOpDesc, std::vector< std::string > > | getOpsNodeNames () |
std::vector< std::vector< OpGraphOpDesc > > | getClusters () |
std::map< OpGraphOpDesc, int > | getOpClusterIndex () |
void | printOps (std::vector< OpGraphOpDesc > &ops) |
void | printNodes (std::vector< MRRGNodeDesc > &mrrg_nodes) |
void | setSchedule (std::unordered_map< OpGraphOpDesc, int > s) |
void | unsetReschedule () |
Public Attributes | |
std::unordered_map< opPair, int, pair_hash > | extended_sched_const |
Static Public Attributes | |
static constexpr Latency | kUndefLatency = -1 |
Private Attributes | |
bool | l_reschedule = false |
MRRG * | localMRRG |
int | l_II |
int | l_rows |
int | l_cols |
bool | l_isElastic |
std::shared_ptr< OpGraph > | l_opgraph |
const MRRG & | l_mrrg |
std::set< OpsNotToCluster > | l_ops_not_clustered |
std::map< std::string, MRRG * > | l_subModule_MRRGs |
std::unordered_set< OpGraphOpDesc > | l_clustered_ops |
std::map< std::string, std::vector< MRRGNodeDesc > > | l_function_nodes |
std::map< std::string, std::vector< MRRGNodeDesc > > | l_routing_nodes |
std::map< std::string, std::set< MRRGNodeDesc > > | l_submodule_input_ports |
std::map< std::string, std::set< MRRGNodeDesc > > | l_submodule_output_ports |
std::map< std::string, std::vector< std::vector< OpGraphOpDesc > > > | l_mem_name_ops |
Private Attributes inherited from ClusteredMapperDriver | |
const int | l_print |
const int | l_rand_seed |
const double | l_p_factor_factor |
const double | l_initial_pfactor |
const double | l_initial_hfactor |
const double | l_h_factor_factor |
const int | l_swap_factor |
const int | l_fanout_threshold |
const int | l_ram_ports |
const int | l_verbosity |
const bool | l_cluster |
bool | l_isElastic |
int | l_iteration_interval |
const std::string | l_arch_name |
const ConfigStore | l_mapper_args |
const int | l_cost_func |
OpScheduler * | l_op_sched |
std::vector< std::vector< OpGraphOpDesc > > | l_clusters |
std::map< OpGraphOpDesc, int > | l_op_cluster_index |
std::unordered_map< OpGraphOpDesc, std::vector< std::string > > | l_ops_to_node_names |
std::unordered_map< OpGraphOpDesc, int > | l_schedule |
Mapping | l_empty_mapping_result |
Private Attributes inherited from Mapper | |
std::shared_ptr< CGRA > | cgra |
int | timelimit |
Additional Inherited Members | |
Private Member Functions inherited from ClusteredMapperDriver | |
ClusteredMapperDriver (std::shared_ptr< CGRA > cgra, int timelimit, const ConfigStore &args) | |
Mapping | mapOpGraph (std::shared_ptr< OpGraph > opgraph, const int II, const MRRG &mrrg, std::unordered_map< std::string, std::string > fix_port) override |
main function to map the OpGraph to the device description More... | |
Mapping | mapStatic (std::shared_ptr< OpGraph > opgraph, const int II, const MRRG &mrrg, std::unordered_map< std::string, std::string > fix_port, PrintOnDestructionChronoSequence &timing_seq) |
Mapping | mapElastic (std::shared_ptr< OpGraph > opgraph, const int II, const MRRG &mrrg, std::unordered_map< std::string, std::string > fix_port, PrintOnDestructionChronoSequence timing_seq) |
const Latency | getCyclesToSink (OpGraphOpDesc source, OpGraphOpDesc sink) |
bool | isAllOpsSupported (const OpGraph &opgraph, const MRRG &mrrg) |
void | printPlacementNeato (int i, const OpGraph &opgraph, Mapping placed, std::unordered_map< OpGraphOpDesc, int > sched) |
Private Member Functions inherited from Mapper | |
virtual | ~Mapper () |
Mapper (std::shared_ptr< CGRA > cgra, int timelimit) | |
Static Private Attributes inherited from ClusteredMapperDriver | |
static constexpr Latency | kUndefLatency = -1 |
Definition at line 170 of file ClusteredMapper.h.
using TMPack::opPair = std::pair<OpGraphOp*, OpGraphOp*> |
Definition at line 229 of file ClusteredMapper.h.
using TMPack::OpsNotToCluster = std::pair<OpGraphOpDesc, OpGraphOpDesc> |
Definition at line 180 of file ClusteredMapper.h.
TMPack::TMPack | ( | ClusteredMapperDriver & | driver, |
Module * | topLevelModule, | ||
std::shared_ptr< OpGraph > | opgraph, | ||
const MRRG & | mrrg, | ||
int | rows, | ||
int | cols, | ||
int | II, | ||
bool | isElastic = false |
||
) |
Definition at line 26 of file TMPack.cpp.
void TMPack::addNextOps | ( | std::vector< OpGraphOpDesc > * | next_ops, |
OpGraphOpDesc | op | ||
) |
Definition at line 579 of file TMPack.cpp.
bool TMPack::checkConnectedOperations | ( | std::pair< OpGraphOpDesc, OpGraphOpDesc > | op_pair, |
std::map< OpGraphOpDesc, std::vector< MRRGNodeDesc >> & | ops_mrrg_nodes, | ||
std::string | submodule | ||
) |
Definition at line 426 of file TMPack.cpp.
void TMPack::checkIfAllOpsAreClustered | ( | ) |
Definition at line 804 of file TMPack.cpp.
bool TMPack::checkIfInputPortsNeeded | ( | OpGraphOpDesc | source_op, |
std::vector< OpGraphOpDesc > & | ops | ||
) |
Definition at line 257 of file TMPack.cpp.
bool TMPack::checkIfOutputPortsNeeded | ( | OpGraphValDesc | val, |
std::vector< OpGraphOpDesc > & | ops | ||
) |
Definition at line 247 of file TMPack.cpp.
bool TMPack::checkPortConn | ( | std::vector< std::pair< OpGraphOpDesc, OpGraphOpDesc >> & | global_port_connection, |
int | i, | ||
std::set< MRRGNodeDesc > | ports_used, | ||
std::set< OpGraphOpDesc > | out_port_found, | ||
std::map< OpGraphOpDesc, std::set< MRRGNodeDesc >> & | op_to_port_nodes, | ||
std::string | submodule, | ||
bool | isInput | ||
) |
Definition at line 310 of file TMPack.cpp.
bool TMPack::checkPortsOfOperation | ( | std::vector< std::pair< OpGraphOpDesc, OpGraphOpDesc >> | global_port_connection, |
std::map< OpGraphOpDesc, std::vector< MRRGNodeDesc >> & | ops_mrrg_nodes, | ||
std::set< OpGraphOpDesc > | exlusive_port_operation, | ||
std::string | submodule, | ||
bool | isInput | ||
) |
Definition at line 341 of file TMPack.cpp.
bool TMPack::checkReachbitlity | ( | std::vector< OpGraphOpDesc > & | ops, |
std::string | submodule | ||
) |
Definition at line 454 of file TMPack.cpp.
void TMPack::clusterMemoryOperations | ( | std::set< OpGraphOpDesc > * | visited | ) |
Definition at line 103 of file TMPack.cpp.
bool TMPack::clusterPEs | ( | bool | cluster | ) |
Definition at line 683 of file TMPack.cpp.
void TMPack::createSingleOpClusters | ( | ) |
Definition at line 671 of file TMPack.cpp.
|
inline |
Definition at line 223 of file ClusteredMapper.h.
void TMPack::getFirstOps | ( | std::queue< OpGraphOpDesc > & | operations | ) |
Definition at line 194 of file TMPack.cpp.
void TMPack::getModulesToMapOp | ( | OpGraphOpDesc | op, |
std::map< std::string, MRRGNodeDesc > & | modules_could_map_op | ||
) |
Definition at line 209 of file TMPack.cpp.
|
inline |
Definition at line 224 of file ClusteredMapper.h.
|
inline |
Definition at line 222 of file ClusteredMapper.h.
bool TMPack::isReachable | ( | MRRGNodeDesc | source, |
MRRGNodeDesc | sink, | ||
std::string | submodule, | ||
Latency | cycles = -1 |
||
) |
Definition at line 595 of file TMPack.cpp.
void TMPack::opsCouldBeClustered | ( | std::vector< OpGraphOpDesc > | nextOps, |
std::vector< MRRGNodeDesc > & | used_nodes, | ||
std::vector< OpGraphOpDesc > & | used_ops, | ||
std::set< OpGraphOpDesc > & | visitedOps, | ||
std::string | subModule | ||
) |
Definition at line 221 of file TMPack.cpp.
void TMPack::printNodes | ( | std::vector< MRRGNodeDesc > & | mrrg_nodes | ) |
Definition at line 826 of file TMPack.cpp.
void TMPack::printOps | ( | std::vector< OpGraphOpDesc > & | ops | ) |
Definition at line 819 of file TMPack.cpp.
void TMPack::resolveReachability | ( | OpGraphOpDesc | source, |
OpGraphOpDesc | sink, | ||
OpGraphVal * | val | ||
) |
Definition at line 553 of file TMPack.cpp.
void TMPack::setPortsForSubmodule | ( | std::string | submodule | ) |
Definition at line 166 of file TMPack.cpp.
void TMPack::setReachesInputPorts | ( | std::map< MRRGNodeDesc, std::set< MRRGNodeDesc >> & | connected_nodes, |
std::vector< MRRGNodeDesc > & | op_mrrg_nodes, | ||
std::string | submodule | ||
) |
Definition at line 296 of file TMPack.cpp.
void TMPack::setReachesOutputPorts | ( | std::map< MRRGNodeDesc, std::set< MRRGNodeDesc >> & | connected_nodes, |
std::vector< MRRGNodeDesc > & | op_mrrg_nodes, | ||
std::string | submodule | ||
) |
Definition at line 278 of file TMPack.cpp.
|
inline |
Definition at line 227 of file ClusteredMapper.h.
void TMPack::setSourceOpNodes | ( | std::vector< MRRGNodeDesc > & | source_op_nodes, |
OpGraphOpDesc | source_op, | ||
std::string | submodule | ||
) |
Definition at line 267 of file TMPack.cpp.
|
inline |
Definition at line 228 of file ClusteredMapper.h.
Definition at line 230 of file ClusteredMapper.h.
|
staticconstexpr |
Definition at line 172 of file ClusteredMapper.h.
|
private |
Definition at line 243 of file ClusteredMapper.h.
|
private |
Definition at line 237 of file ClusteredMapper.h.
|
private |
Definition at line 244 of file ClusteredMapper.h.
|
private |
Definition at line 235 of file ClusteredMapper.h.
|
private |
Definition at line 238 of file ClusteredMapper.h.
|
private |
Definition at line 248 of file ClusteredMapper.h.
|
private |
Definition at line 240 of file ClusteredMapper.h.
|
private |
Definition at line 239 of file ClusteredMapper.h.
|
private |
Definition at line 241 of file ClusteredMapper.h.
|
private |
Definition at line 233 of file ClusteredMapper.h.
|
private |
Definition at line 245 of file ClusteredMapper.h.
|
private |
Definition at line 236 of file ClusteredMapper.h.
|
private |
Definition at line 246 of file ClusteredMapper.h.
|
private |
Definition at line 242 of file ClusteredMapper.h.
|
private |
Definition at line 247 of file ClusteredMapper.h.
|
private |
Definition at line 234 of file ClusteredMapper.h.