CGRA-ME
Classes | Typedefs | Enumerations | Functions
Mapping.h File Reference
#include <vector>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <CGRA/CGRA.h>
#include <CGRA/ConfigStore.h>
#include <CGRA/MRRG.h>
#include <CGRA/OpGraph.h>

Go to the source code of this file.

Classes

class  Mapping
 
struct  MappingGraphNode
 
class  MappingGraph
 
struct  MappingGraph::NodeDescriptor
 
struct  MappingGraph::NodeDescriptorHash
 
struct  MappingGraph::VerifyMessage
 
struct  CreateMappingGraphResult
 

Typedefs

using MappingGraphCycleAssignment = std::unordered_map< MappingGraph::NodeDescriptor, int, MappingGraph::NodeDescriptorHash >
 

Enumerations

enum  MappingStatus : int { MappingStatus::success, MappingStatus::failure, MappingStatus::timeout }
 

Functions

std::ostream & operator<< (std::ostream &os, MappingStatus ms)
 
Mapping withRemappedOps (const Mapping &src, const std::unordered_map< OpGraph::NodeDescriptor, OpGraph::NodeDescriptor > &forward_mappings)
 
CreateMappingGraphResult createMappingGraph (const MRRG &mg, const Mapping &m)
 
MappingGraph removeIsolatedRoutingNodes (const MappingGraph &mapping, const MRRG &mrrg, const MappingGraph::ToMRRGVertexMap &toMRRG)
 
std::pair< bool, MappingGraphCycleAssignmentlatencyCheck (const MappingGraph &mapping, const MRRG &mrrg, const CreateMappingGraphResult::ToMRRG &toMRRG)
 

Typedef Documentation

◆ MappingGraphCycleAssignment

Definition at line 266 of file Mapping.h.

Enumeration Type Documentation

◆ MappingStatus

enum MappingStatus : int
strong
Enumerator
success 
failure 
timeout 

Definition at line 26 of file Mapping.h.

Function Documentation

◆ createMappingGraph()

CreateMappingGraphResult createMappingGraph ( const MRRG mg,
const Mapping m 
)

Generates a mapping graph and the mapping to and from mapping graph nodes to mrrg nodes.

Definition at line 468 of file Mapping.cpp.

◆ latencyCheck()

std::pair<bool, MappingGraphCycleAssignment> latencyCheck ( const MappingGraph mapping,
const MRRG mrrg,
const CreateMappingGraphResult::ToMRRG toMRRG 
)

Checks the mapping to make sure that the latencies are balanced.

Algorithm:

  1. Conduct BFS from unvisited nodes, moving in both directions, fanouts and fanins, tracking the latency needed to reach nodes.
  2. During BFS, if a search visits a node with t(n) + II = t(f) + latency, then it should be added to the set of nodes to check for cycles
  3. For the nodes to check for cycles: Conduct a BFS and ensure that a) we visit these nodes again to confirm cycle and b) the latency is t (n) + II.

Definition at line 582 of file Mapping.cpp.

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
MappingStatus  ms 
)

Definition at line 28 of file Mapping.cpp.

◆ removeIsolatedRoutingNodes()

MappingGraph removeIsolatedRoutingNodes ( const MappingGraph mapping,
const MRRG mrrg,
const MappingGraph::ToMRRGVertexMap toMRRG 
)

Fixes the mapping by removing clusters of nodes that do not contain functional units

Definition at line 504 of file Mapping.cpp.

◆ withRemappedOps()

Mapping withRemappedOps ( const Mapping src,
const std::unordered_map< OpGraph::NodeDescriptor, OpGraph::NodeDescriptor > &  forward_mappings 
)

Returns a near copy of src, but for each key-value of forward_mappings, the nodes that were mapped to key are now mapped to value, and key is not present.

Definition at line 288 of file Mapping.cpp.