sdf3ctg.cc File Reference

#include "sdf3ctg.h"
#include "base/base.h"
Include dependency graph for sdf3ctg.cc:

Classes

class  Message
struct  _Edge
struct  _Node
struct  _ArchGraph
struct  _Settings

Typedefs

typedef unsigned int TTime
typedef list< Message * > Messages
typedef Messages::iterator MessagesIter
typedef Messages::const_iterator MessagesCIter
typedef struct _Edge Edge
typedef vector< Edge * > Edges
typedef Edges::iterator EdgesIter
typedef Edges::const_iterator EdgesCIter
typedef struct _Node Node
typedef vector< Node * > Nodes
typedef Nodes::iterator NodesIter
typedef Nodes::const_iterator NodesCIter
typedef struct _ArchGraph ArchGraph
typedef struct _Settings Settings

Functions

void helpMessage (ostream &out)
void parseCommandLine (int argc, char **argv)
CNodeloadArchitectureGraphFromFile (CString &file, CString &module)
void parseSettingsFile (CString module, CString type)
void setDefaults ()
bool initSettings (int argc, char **argv)
ArchGraphconstructArchitectureGraph (CNode *archNode)
uint ** computeReachabilityMatrix (ArchGraph *g)
void printPreamble (ostream &out)
void printPostamble (ostream &out)
ostream & printMessage (ArchGraph *archGraph, Message *m, ostream &out)
void generateStream (Messages &messages, const CId streamId, const CId srcNodeId, const CId dstNodeId)
CId selectDstNode (const CId srcNodeId, ArchGraph *archGraph, uint **distanceMatrix)
CId selectSrcNode (const CId dstNodeId, ArchGraph *archGraph, uint **distanceMatrix)
void generateMessagesHotspots (ArchGraph *archGraph, uint **distanceMatrix, Messages &messages)
void generateMessagesUniform (ArchGraph *archGraph, uint **distanceMatrix, Messages &messages)
void generateMessages (ostream &out)
int main (int argc, char **argv)

Variables

Settings settings
MTRand mtRand

Typedef Documentation

typedef struct _ArchGraph ArchGraph
typedef struct _Edge Edge
typedef vector<Edge*> Edges
typedef Edges::const_iterator EdgesCIter
typedef Edges::iterator EdgesIter
typedef list<Message*> Messages
typedef Messages::const_iterator MessagesCIter
typedef Messages::iterator MessagesIter
typedef struct _Node Node
typedef vector<Node*> Nodes
typedef Nodes::const_iterator NodesCIter
typedef Nodes::iterator NodesIter
typedef struct _Settings Settings
typedef unsigned int TTime

Function Documentation

uint** computeReachabilityMatrix ( ArchGraph g  ) 

computeReachabilityMatrix () The function computes the minimal length of the route (number of edges) between every pair of source and destination nodes in the architecture graph. If a node n is not reachable from a node m, the distance from m to n is INT_MAX - 1

References _Edge::dstNode, and _ArchGraph::nodes.

Referenced by generateMessages().

ArchGraph* constructArchitectureGraph ( CNode archNode  ) 

constructArchitectureGraph () The function constructs an architecture graph from the XML description.

References CGetAttribute(), CGetChildNode(), CNextNode(), _Edge::dstNode, _ArchGraph::edges, g, _Node::inEdges, _Edge::name, Node::name, _ArchGraph::nodes, _Node::outEdges, and _Edge::srcNode.

Referenced by generateMessages().

Here is the call graph for this function:

void generateMessages ( ostream &  out  ) 

generateMessages () Generate a set of messages organised in streams for the requested traffic pattern. Messages are outputted to the supplied output stream.

References archGraph, computeReachabilityMatrix(), constructArchitectureGraph(), generateMessagesHotspots(), generateMessagesUniform(), printMessage(), printPostamble(), printPreamble(), Settings::type, and Settings::xmlArchGraph.

Referenced by main().

Here is the call graph for this function:

void generateMessagesHotspots ( ArchGraph archGraph,
uint **  distanceMatrix,
Messages messages 
)

generateMessagesHotspots () Generate a set of messages with a hotspot traffic distribution.

References generateStream(), _ArchGraph::nodes, MTRand::rand(), MTRand::randInt(), selectDstNode(), and selectSrcNode().

Referenced by generateMessages().

Here is the call graph for this function:

void generateMessagesUniform ( ArchGraph archGraph,
uint **  distanceMatrix,
Messages messages 
)

generateMessagesUniform () Generate a set of messages with a uniform traffic distribution.

References generateStream(), _ArchGraph::nodes, MTRand::randInt(), and selectDstNode().

Referenced by generateMessages().

Here is the call graph for this function:

void generateStream ( Messages messages,
const CId  streamId,
const CId  srcNodeId,
const CId  dstNodeId 
)

generateStream () Generate a stream of messages between the source and destination node.

References MTRand::randNorm(), Message::setDstNodeId(), Message::setDuration(), Message::setSeqNr(), Message::setSize(), Message::setSrcNodeId(), Message::setStartTime(), and Message::setStreamId().

Referenced by generateMessagesHotspots(), and generateMessagesUniform().

Here is the call graph for this function:

void helpMessage ( ostream &  out  ) 

helpMessage () Function prints help message for the tool.

References DOTTED_VERSION, and TOOL.

bool initSettings ( int  argc,
char **  argv 
)

initSettings () The function initializes the program settings.

References MODULE, parseCommandLine(), parseSettingsFile(), setDefaults(), and SETTINGS_TYPE.

Here is the call graph for this function:

CNode* loadArchitectureGraphFromFile ( CString file,
CString module 
)

loadArchitectureGraphFromFile () The function returns a pointer to an XML data structures contained in the supplied file that describes the platform.

References CGetAttribute(), CGetChildNode(), CGetRootNode(), and CParseFile().

Here is the call graph for this function:

int main ( int  argc,
char **  argv 
)

main () It does none of the hard work, but it is very needed...

References generateMessages(), initSettings(), MaxPlusAnalysis::out, and Settings::outputFile.

Here is the call graph for this function:

void parseCommandLine ( int  argc,
char **  argv 
)

parseCommandLine () The function parses the command line arguments and add info to the supplied settings structure.

References helpMessage(), Settings::outputFile, and Settings::settingsFile.

Here is the call graph for this function:

void parseSettingsFile ( CString  module,
CString  type 
)

parseSettingsFile () The function parses all settings from the settings file.

References CGetAttribute(), CGetChildNode(), CGetRootNode(), CHasAttribute(), CHasChildNode(), CNextNode(), CParseFile(), loadArchitectureGraphFromFile(), Settings::settingsFile, Settings::type, and Settings::xmlArchGraph.

Here is the call graph for this function:

ostream& printMessage ( ArchGraph archGraph,
Message m,
ostream &  out 
)

printMessage () The function outputs a message to the supplied output stream.

References Message::getDstNodeId(), Message::getDuration(), Message::getId(), Message::getSeqNr(), Message::getSize(), Message::getSrcNodeId(), Message::getStartTime(), Message::getStreamId(), and _ArchGraph::nodes.

Referenced by generateMessages().

Here is the call graph for this function:

void printPostamble ( ostream &  out  ) 

printPostamble () The function outputs a postamble to the supplied output stream closing the XML tags.

Referenced by generateMessages().

void printPreamble ( ostream &  out  ) 

printPreamble () The function outputs a preamble to the supplied output stream explaining the file format.

References Settings::outputFile, Settings::settingsFile, and Settings::type.

Referenced by generateMessages().

CId selectDstNode ( const CId  srcNodeId,
ArchGraph archGraph,
uint **  distanceMatrix 
)

selectDstNode () The function returns the id of a randomly choosen node which is at a randomly choosen distance from the given source node in the architecture graph.

References _ArchGraph::nodes, MTRand::randInt(), and MTRand::randNorm().

Referenced by generateMessagesHotspots(), and generateMessagesUniform().

Here is the call graph for this function:

CId selectSrcNode ( const CId  dstNodeId,
ArchGraph archGraph,
uint **  distanceMatrix 
)

selectSrcNode () The function returns the id of a randomly choosen node which is at a randomly choosen distance from the given destination node in the architecture graph.

References _ArchGraph::nodes, MTRand::randInt(), and MTRand::randNorm().

Referenced by generateMessagesHotspots().

Here is the call graph for this function:

void setDefaults (  ) 

setDefaults () Set all settings at their default value.

References Settings::outputFile, Settings::settingsFile, and Settings::type.


Variable Documentation