CGRA-ME
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
TMPack Class Reference

#include <ClusteredMapper.h>

Inheritance diagram for TMPack:
ClusteredMapperDriver

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_hashextended_sched_const
 

Static Public Attributes

static constexpr Latency kUndefLatency = -1
 

Private Attributes

bool l_reschedule = false
 
MRRGlocalMRRG
 
int l_II
 
int l_rows
 
int l_cols
 
bool l_isElastic
 
std::shared_ptr< OpGraphl_opgraph
 
const MRRGl_mrrg
 
std::set< OpsNotToClusterl_ops_not_clustered
 
std::map< std::string, MRRG * > l_subModule_MRRGs
 
std::unordered_set< OpGraphOpDescl_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
 
OpSchedulerl_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< CGRAcgra
 
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
 

Detailed Description

Definition at line 170 of file ClusteredMapper.h.

Member Typedef Documentation

◆ opPair

using TMPack::opPair = std::pair<OpGraphOp*, OpGraphOp*>

Definition at line 229 of file ClusteredMapper.h.

◆ OpsNotToCluster

Definition at line 180 of file ClusteredMapper.h.

Constructor & Destructor Documentation

◆ TMPack()

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.

Member Function Documentation

◆ addNextOps()

void TMPack::addNextOps ( std::vector< OpGraphOpDesc > *  next_ops,
OpGraphOpDesc  op 
)

Definition at line 579 of file TMPack.cpp.

◆ checkConnectedOperations()

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.

◆ checkIfAllOpsAreClustered()

void TMPack::checkIfAllOpsAreClustered ( )

Definition at line 804 of file TMPack.cpp.

◆ checkIfInputPortsNeeded()

bool TMPack::checkIfInputPortsNeeded ( OpGraphOpDesc  source_op,
std::vector< OpGraphOpDesc > &  ops 
)

Definition at line 257 of file TMPack.cpp.

◆ checkIfOutputPortsNeeded()

bool TMPack::checkIfOutputPortsNeeded ( OpGraphValDesc  val,
std::vector< OpGraphOpDesc > &  ops 
)

Definition at line 247 of file TMPack.cpp.

◆ checkPortConn()

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.

◆ checkPortsOfOperation()

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.

◆ checkReachbitlity()

bool TMPack::checkReachbitlity ( std::vector< OpGraphOpDesc > &  ops,
std::string  submodule 
)

Definition at line 454 of file TMPack.cpp.

◆ clusterMemoryOperations()

void TMPack::clusterMemoryOperations ( std::set< OpGraphOpDesc > *  visited)

Definition at line 103 of file TMPack.cpp.

◆ clusterPEs()

bool TMPack::clusterPEs ( bool  cluster)

Definition at line 683 of file TMPack.cpp.

◆ createSingleOpClusters()

void TMPack::createSingleOpClusters ( )

Definition at line 671 of file TMPack.cpp.

◆ getClusters()

std::vector<std::vector<OpGraphOpDesc> > TMPack::getClusters ( )
inline

Definition at line 223 of file ClusteredMapper.h.

◆ getFirstOps()

void TMPack::getFirstOps ( std::queue< OpGraphOpDesc > &  operations)

Definition at line 194 of file TMPack.cpp.

◆ getModulesToMapOp()

void TMPack::getModulesToMapOp ( OpGraphOpDesc  op,
std::map< std::string, MRRGNodeDesc > &  modules_could_map_op 
)

Definition at line 209 of file TMPack.cpp.

◆ getOpClusterIndex()

std::map<OpGraphOpDesc, int> TMPack::getOpClusterIndex ( )
inline

Definition at line 224 of file ClusteredMapper.h.

◆ getOpsNodeNames()

std::unordered_map<OpGraphOpDesc, std::vector<std::string> > TMPack::getOpsNodeNames ( )
inline

Definition at line 222 of file ClusteredMapper.h.

◆ isReachable()

bool TMPack::isReachable ( MRRGNodeDesc  source,
MRRGNodeDesc  sink,
std::string  submodule,
Latency  cycles = -1 
)

Definition at line 595 of file TMPack.cpp.

◆ opsCouldBeClustered()

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.

◆ printNodes()

void TMPack::printNodes ( std::vector< MRRGNodeDesc > &  mrrg_nodes)

Definition at line 826 of file TMPack.cpp.

◆ printOps()

void TMPack::printOps ( std::vector< OpGraphOpDesc > &  ops)

Definition at line 819 of file TMPack.cpp.

◆ resolveReachability()

void TMPack::resolveReachability ( OpGraphOpDesc  source,
OpGraphOpDesc  sink,
OpGraphVal val 
)

Definition at line 553 of file TMPack.cpp.

◆ setPortsForSubmodule()

void TMPack::setPortsForSubmodule ( std::string  submodule)

Definition at line 166 of file TMPack.cpp.

◆ setReachesInputPorts()

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.

◆ setReachesOutputPorts()

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.

◆ setSchedule()

void TMPack::setSchedule ( std::unordered_map< OpGraphOpDesc, int >  s)
inline

Definition at line 227 of file ClusteredMapper.h.

◆ setSourceOpNodes()

void TMPack::setSourceOpNodes ( std::vector< MRRGNodeDesc > &  source_op_nodes,
OpGraphOpDesc  source_op,
std::string  submodule 
)

Definition at line 267 of file TMPack.cpp.

◆ unsetReschedule()

void TMPack::unsetReschedule ( )
inline

Definition at line 228 of file ClusteredMapper.h.

Member Data Documentation

◆ extended_sched_const

std::unordered_map<opPair , int, pair_hash> TMPack::extended_sched_const

Definition at line 230 of file ClusteredMapper.h.

◆ kUndefLatency

constexpr Latency TMPack::kUndefLatency = -1
staticconstexpr

Definition at line 172 of file ClusteredMapper.h.

◆ l_clustered_ops

std::unordered_set<OpGraphOpDesc> TMPack::l_clustered_ops
private

Definition at line 243 of file ClusteredMapper.h.

◆ l_cols

int TMPack::l_cols
private

Definition at line 237 of file ClusteredMapper.h.

◆ l_function_nodes

std::map<std::string, std::vector<MRRGNodeDesc> > TMPack::l_function_nodes
private

Definition at line 244 of file ClusteredMapper.h.

◆ l_II

int TMPack::l_II
private

Definition at line 235 of file ClusteredMapper.h.

◆ l_isElastic

bool TMPack::l_isElastic
private

Definition at line 238 of file ClusteredMapper.h.

◆ l_mem_name_ops

std::map<std::string, std::vector<std::vector<OpGraphOpDesc> > > TMPack::l_mem_name_ops
private

Definition at line 248 of file ClusteredMapper.h.

◆ l_mrrg

const MRRG& TMPack::l_mrrg
private

Definition at line 240 of file ClusteredMapper.h.

◆ l_opgraph

std::shared_ptr<OpGraph> TMPack::l_opgraph
private

Definition at line 239 of file ClusteredMapper.h.

◆ l_ops_not_clustered

std::set<OpsNotToCluster> TMPack::l_ops_not_clustered
private

Definition at line 241 of file ClusteredMapper.h.

◆ l_reschedule

bool TMPack::l_reschedule = false
private

Definition at line 233 of file ClusteredMapper.h.

◆ l_routing_nodes

std::map<std::string, std::vector<MRRGNodeDesc> > TMPack::l_routing_nodes
private

Definition at line 245 of file ClusteredMapper.h.

◆ l_rows

int TMPack::l_rows
private

Definition at line 236 of file ClusteredMapper.h.

◆ l_submodule_input_ports

std::map<std::string, std::set<MRRGNodeDesc> > TMPack::l_submodule_input_ports
private

Definition at line 246 of file ClusteredMapper.h.

◆ l_subModule_MRRGs

std::map<std::string, MRRG*> TMPack::l_subModule_MRRGs
private

Definition at line 242 of file ClusteredMapper.h.

◆ l_submodule_output_ports

std::map<std::string, std::set<MRRGNodeDesc> > TMPack::l_submodule_output_ports
private

Definition at line 247 of file ClusteredMapper.h.

◆ localMRRG

MRRG* TMPack::localMRRG
private

Definition at line 234 of file ClusteredMapper.h.


The documentation for this class was generated from the following files: