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

#include <MRRG.h>

Classes

struct  VerifyMessage
 

Public Types

using NodeDescriptor = const MRRGNode *
 

Public Member Functions

 MRRG (int II)
 
 MRRG (const MRRG &src)
 
 MRRG (MRRG &&)=default
 
MRRGoperator= (const MRRG &rhs)
 
MRRGoperator= (MRRG &&)=default
 
std::pair< NodeDescriptor, bool > insert (MRRGNode node)
 
std::pair< NodeDescriptor, bool > insert (NodeDescriptor fanin, MRRGNode node)
 
template<typename NodeDescList = std::vector<NodeDescriptor>>
std::pair< NodeDescriptor, bool > insertMultiFanin (NodeDescList fanins, MRRGNode node)
 
void link (MRRG::NodeDescriptor driver, MRRG::NodeDescriptor fanout)
 
void unlink (MRRG::NodeDescriptor driver, MRRG::NodeDescriptor fanout)
 
void erase (MRRG::NodeDescriptor n)
 
NodeDescriptor getNode (int cycle, const std::string &name) const
 
NodeDescriptor getNodeByPropertiesOf (const MRRGNode &node) const
 
MRRGNodegetNodeRef (NodeDescriptor ndesc)
 
const MRRGNodegetNodeRef (NodeDescriptor ndesc) const
 
MRRGNodegetNodeRef (int cycle, const std::string &name)
 
const MRRGNodegetNodeRef (int cycle, const std::string &name) const
 
MRRGNodegetNodeRefByPropertiesOf (const MRRGNode &node)
 
const MRRGNodegetNodeRefByPropertiesOf (const MRRGNode &node) const
 
auto & fanout (NodeDescriptor ndesc) const
 
auto & fanin (NodeDescriptor ndesc) const
 
std::vector< VerifyMessageverify (const ConfigStore &options={}) const
 
void printDot (std::ostream &os, Module *, const ConfigStore &archAttrs) const
 
void printSubmoduleDot (std::ostream &os, Module *) const
 
void printDot (std::ostream &os) const
 
void printDotClustered (std::ostream &os) const
 
void printSupportedOps (std::ostream &os) const
 
void printBasicStats (std::ostream &os) const
 
int initiationInterval () const
 
std::ptrdiff_t size () const
 
const auto & allNodesByCycle () const
 
void renameNode (NodeDescriptor ndesc, std::string new_name)
 

Private Attributes

std::vector< std::map< std::string, std::unique_ptr< MRRGNode > > > nodes
 
std::map< std::string, std::unique_ptr< MRRG > > subMRRGs
 
friend Module
 

Detailed Description

Definition at line 216 of file MRRG.h.

Member Typedef Documentation

◆ NodeDescriptor

Definition at line 219 of file MRRG.h.

Constructor & Destructor Documentation

◆ MRRG() [1/3]

MRRG::MRRG ( int  II)
inline

Definition at line 221 of file MRRG.h.

◆ MRRG() [2/3]

MRRG::MRRG ( const MRRG src)
inline

Definition at line 225 of file MRRG.h.

◆ MRRG() [3/3]

MRRG::MRRG ( MRRG &&  )
default

Member Function Documentation

◆ allNodesByCycle()

const auto& MRRG::allNodesByCycle ( ) const
inline

Direct (const) access to the graph. Likely to be phased out eventually. Use getNode* instead.

Definition at line 357 of file MRRG.h.

◆ erase()

void MRRG::erase ( MRRG::NodeDescriptor  n)

Remove the node from the graph. Disconnects all fanout & fanin

Definition at line 109 of file MRRG.cpp.

◆ fanin()

auto& MRRG::fanin ( NodeDescriptor  ndesc) const
inline

Gives a list of elements that fan-in to the given descriptor.

Definition at line 293 of file MRRG.h.

◆ fanout()

auto& MRRG::fanout ( NodeDescriptor  ndesc) const
inline

Gives a list of elements that fan-out from the given descriptor. Allows a MRRG to be used with most graph algorithms.

Definition at line 288 of file MRRG.h.

◆ getNode()

MRRG::NodeDescriptor MRRG::getNode ( int  cycle,
const std::string &  name 
) const

Get a node descriptor.

Definition at line 142 of file MRRG.cpp.

◆ getNodeByPropertiesOf()

NodeDescriptor MRRG::getNodeByPropertiesOf ( const MRRGNode node) const
inline

Definition at line 266 of file MRRG.h.

◆ getNodeRef() [1/4]

MRRGNode& MRRG::getNodeRef ( int  cycle,
const std::string &  name 
)
inline

Node getters that include the step of getting a reference, for making code simpler

Definition at line 279 of file MRRG.h.

◆ getNodeRef() [2/4]

const MRRGNode& MRRG::getNodeRef ( int  cycle,
const std::string &  name 
) const
inline

Definition at line 280 of file MRRG.h.

◆ getNodeRef() [3/4]

MRRGNode& MRRG::getNodeRef ( NodeDescriptor  ndesc)
inline

Get an actual node object from your descriptor. Useful for "laundering" your const pointer if you have a non-const MRRG. Undefined Behaviour if this node is not in this MRRG.

Definition at line 273 of file MRRG.h.

◆ getNodeRef() [4/4]

const MRRGNode& MRRG::getNodeRef ( NodeDescriptor  ndesc) const
inline

Definition at line 274 of file MRRG.h.

◆ getNodeRefByPropertiesOf() [1/2]

MRRGNode& MRRG::getNodeRefByPropertiesOf ( const MRRGNode node)
inline

Definition at line 281 of file MRRG.h.

◆ getNodeRefByPropertiesOf() [2/2]

const MRRGNode& MRRG::getNodeRefByPropertiesOf ( const MRRGNode node) const
inline

Definition at line 282 of file MRRG.h.

◆ initiationInterval()

int MRRG::initiationInterval ( ) const
inline

The initiation interval this MRRG is supporting

Definition at line 346 of file MRRG.h.

◆ insert() [1/2]

std::pair< MRRG::NodeDescriptor, bool > MRRG::insert ( MRRGNode  node)

Add node to this MRRG by std::moveing it to the heap. Overloads with fanin or fanins arguments add the given node and also add link(s) from the node(s) in that argument.

Definition at line 91 of file MRRG.cpp.

◆ insert() [2/2]

std::pair<NodeDescriptor,bool> MRRG::insert ( NodeDescriptor  fanin,
MRRGNode  node 
)
inline

Definition at line 239 of file MRRG.h.

◆ insertMultiFanin()

template<typename NodeDescList = std::vector<NodeDescriptor>>
std::pair<NodeDescriptor,bool> MRRG::insertMultiFanin ( NodeDescList  fanins,
MRRGNode  node 
)
inline

Definition at line 242 of file MRRG.h.

◆ link()

void MRRG::link ( MRRG::NodeDescriptor  driver,
MRRG::NodeDescriptor  fanout 
)

For creating and destroying edges between nodes in an MRRG All may perform some checks (especially when unlinking) on the validity of the graph, throwing if something is wrong. Overall, better than manipulating the fanout & fanin lists directly.

Definition at line 849 of file MRRG.cpp.

◆ operator=() [1/2]

MRRG & MRRG::operator= ( const MRRG rhs)

Definition at line 68 of file MRRG.cpp.

◆ operator=() [2/2]

MRRG& MRRG::operator= ( MRRG &&  )
default

◆ printBasicStats()

void MRRG::printBasicStats ( std::ostream &  os) const

Print some basic info like no. nodes, no. edges, no. unique modules.

Definition at line 541 of file MRRG.cpp.

◆ printDot() [1/2]

void MRRG::printDot ( std::ostream &  os) const

Print a machine readable text form of this graph. Uses the classic .dot format, openable with xdot and other programs.

Definition at line 394 of file MRRG.cpp.

◆ printDot() [2/2]

void MRRG::printDot ( std::ostream &  os,
Module topModule,
const ConfigStore archAttrs 
) const

Print a machine readable text form of this graph. Uses the classic .dot format, openable with xdot and other programs.

Definition at line 151 of file MRRG.cpp.

◆ printDotClustered()

void MRRG::printDotClustered ( std::ostream &  os) const

Same as above, but clustered by module

Definition at line 505 of file MRRG.cpp.

◆ printSubmoduleDot()

void MRRG::printSubmoduleDot ( std::ostream &  os,
Module submodule 
) const

Print a machine readable text form of this graph. Uses the classic .dot format, openable with xdot and other programs.

Definition at line 292 of file MRRG.cpp.

◆ printSupportedOps()

void MRRG::printSupportedOps ( std::ostream &  os) const

Print the supported ops by this architecture

Definition at line 369 of file MRRG.cpp.

◆ renameNode()

void MRRG::renameNode ( NodeDescriptor  ndesc,
std::string  new_name 
)

Changes the name of node corresponding to ndesc, and updates any internal structures.

Definition at line 799 of file MRRG.cpp.

◆ size()

std::ptrdiff_t MRRG::size ( ) const

The number of nodes. No guarantee on time complexity.

Definition at line 558 of file MRRG.cpp.

◆ unlink()

void MRRG::unlink ( MRRG::NodeDescriptor  driver,
MRRG::NodeDescriptor  fanout 
)

Definition at line 850 of file MRRG.cpp.

◆ verify()

std::vector< MRRG::VerifyMessage > MRRG::verify ( const ConfigStore options = {}) const

Definition at line 632 of file MRRG.cpp.

Member Data Documentation

◆ Module

friend MRRG::Module
private

Definition at line 369 of file MRRG.h.

◆ nodes

std::vector<std::map<std::string, std::unique_ptr<MRRGNode> > > MRRG::nodes
private

Definition at line 365 of file MRRG.h.

◆ subMRRGs

std::map<std::string, std::unique_ptr<MRRG> > MRRG::subMRRGs
private

Definition at line 366 of file MRRG.h.


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