Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

oagFpga::RtlGraph Class Reference

The intermediate data structure for storing the structural netlist with black boxes. More...

#include <oagFpgaRtlGraph.h>

List of all members.

Public Member Functions

 RtlGraph ()
 constructor & destructor
 ~RtlGraph ()
BBRef unaryOpt (RtlNode::OptType ot, BBRef driver)
 Single bit unary operation.
BBRef binaryOpt (RtlNode::OptType ot, BBRef in1, BBRef in2)
 Single bit binary operation.
BBRef unaryBusOpt (RtlNode::OptType ot, vector< BBRef > &ins)
 For *reduction* operations.
BBRef binaryBusOpt (RtlNode::OptType ot, vector< BBRef > &in1, vector< BBRef > &in2)
 For multiple bits binary operations.
void binaryBusInputOutputOpt (RtlNode::OptType ot, int numOutBits, vector< BBRef > &in1, vector< BBRef > &in2, vector< BBRef > &out)
 For binary operations with multiple input and output bits (eg, ADD).
void unaryBusInputOutputOpt (RtlNode::OptType ot, int numOutBits, vector< BBRef > &in1, vector< BBRef > &out)
 For unary operations with multiple input and output bits.
BBRef bitSeq (RtlNode::SeqType st, BBRef D)
BBRef bitSeq (RtlNode::SeqType st, BBRef D, BBRef clock, BBRef aLoad, BBRef aData)
 Setup an single-bit sequntial RtlNode.
BBRef bitMux (BBRef in1, BBRef in2, BBRef sel)
 routines for mux generation Setup a mux for two bits.
BBRef busMux (vector< BBRef > &in, vector< BBRef > &sel)
 Setup a mux for a multiple-input signal with select signal "sel".
void busMux (vector< BBRef > &in1, vector< BBRef > &in2, vector< BBRef > &sel, vector< BBRef > &outputs)
 Setup a mux for two buses.
void addNode (RtlNode *node)
 Add a black box element into the bb list.
void buildNetlist ()
void setExternalTerminalConnection (BBRef ref, void *connection)
RtlNodenewNode ()
BBRef newTerminal (BBRef driver)
BBRef getTerminalDriver (BBRef terminal)
BBRef getNextState (BBRef seq) const
int getNumOutputBits (BBRef x) const
int getPrimaryBBID (BBRef x) const
const list< BBRef > & getFanin (BBRef x)
const list< BBRef > & getFanout (BBRef x)
 Returns the fanin of a node.
bool hasFanout (BBRef x) const
 Returns the fanout of a node.
void removeFromFanout (BBRef x, BBRef fanout)
 Removes a reference from a fanout list.
void setTerminalDriver (BBRef terminal, BBRef driver)
 Sets the driver of a TERMINAL node.
RtlNodegetNode (BBRef ref) const
 utilities
RtlNode::FuncType getNodeType (BBRef ref) const
RtlNode::OptType getNodeOptType (BBRef ref) const
RtlNode::SeqType getNodeSeqType (BBRef ref) const
bool isTerminal (BBRef x) const
bool isFunctional (BBRef x) const
bool isSequential (BBRef x) const
void * getExternalTerminalConnection (BBRef terminal) const
unsigned int newTraversalID ()
 routines for advanced graph traversal Generates a unique ID for a new graph traversal.
void markVisited (BBRef x)
void unmarkVisited (BBRef x)
 Marks a node as having been visited in the current traversal.
bool isVisited (BBRef x) const
 Unmarks a node as having been visited in the current traversal.
bool hasCombinationalCycle ()
 Tests if there are any combinational cycles in the graph.
void getTransitiveFanin (BBRef x, list< BBRef > &transitiveFanin, bool includeRoots=true, bool crossSequential=false)
 Returns a list of all nodes in the transitive fan-in of a node.
void getTransitiveFanin (BBRef x, vector< BBRef > &transitiveFanin, bool includeRoots=true, bool crossSequential=false)
 Returns a vector of all nodes in the transitive fan-in.
void getTransitiveFanin (list< BBRef > x, list< BBRef > &transitiveFanin, bool includeRoots=true, bool crossSequential=false)
 Returns a list of all nodes in the transitive fan-in of several nodes.
void getTransitiveFanin (list< BBRef > x, vector< BBRef > &transitiveFanin, bool includeRoots=true, bool crossSequential=false)
 Returns a vector of all nodes in the transitive fan-in of several nodes.
void getTransitiveFanout (BBRef x, list< BBRef > &transitiveFanout, bool includeRoots=true, bool crossSequential=false)
 Returns a list of all nodes in the transitive fan-out.
void getTransitiveFanout (BBRef x, vector< BBRef > &transitiveFanout, bool includeRoots=true, bool crossSequential=false)
 Returns a vector of all nodes in the transitive fan-out.
void getTransitiveFanout (list< BBRef > x, list< BBRef > &transitiveFanout, bool includeRoots=true, bool crossSequential=false)
 Returns a list of all nodes in the transitive fan-out of several nodes.
void getTransitiveFanout (list< BBRef > x, vector< BBRef > &transitiveFanout, bool includeRoots=true, bool crossSequential=false)
 Returns a vector of all nodes in the transitive fan-out of several nodes.
void getTransitiveFanin_recursive (BBRef x, vector< BBRef > &transitiveFanin, bool includeRoots, bool crossSequential=false)
 Internal function.
void getTransitiveFanout_recursive (BBRef x, vector< BBRef > &transitiveFanout, bool includeRoots, bool crossSequential=false)
 Internal function.
void getTransitiveFanin_recursive (BBRef x, list< BBRef > &transitiveFanin, bool includeRoots, bool crossSequential=false)
 Internal function.
void getTransitiveFanout_recursive (BBRef x, list< BBRef > &transitiveFanout, bool includeRoots, bool crossSequential=false)
 Internal function.
bool hasCombinationalCycle_recursive (BBRef x, unsigned int startingTraversalID)
 Tests if there are any combinational cycles in the graph from a node.
BBRef getOutputBit (BBRef ref)
 Black box fanout operations.
int getBBNodeNum ()
BBRef constantZero () const
BBRef constantOne () const
void print (ostream &os)
 Print nodes and connections of this*.
void print (ostream &os, RtlNode *node)
 Print one RtlNode.

Static Public Member Functions

BBRef getNull ()
 functional operations
bool isNull (BBRef ref)

Protected Attributes

vector< RtlNode * > bbNodes
vector< RtlNode * > dataBBNodes
BBRef CONSTANT0_BBREF
BBRef CONSTANT1_BBREF
unsigned int currentTraversalID

Static Protected Attributes

const BBRef NULL_BBREF = 0

Friends

class Manager
class ModuleCompiler


Detailed Description

The intermediate data structure for storing the structural netlist with black boxes.

Definition at line 204 of file oagFpgaRtlGraph.h.


Constructor & Destructor Documentation

oagFpga::RtlGraph::RtlGraph  )  [inline]
 

constructor & destructor

Definition at line 212 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::aiRef, oagFpga::RtlNode::funcType, and oagFpga::RtlNode::self.

oagFpga::RtlGraph::~RtlGraph  )  [inline]
 

Definition at line 234 of file oagFpgaRtlGraph.h.


Member Function Documentation

void oagFpga::RtlGraph::addNode RtlNode node  ) 
 

Add a black box element into the bb list.

Add a black box element into the bb list, and add all ports of this element.

Definition at line 465 of file oagFpgaRtlGraph.cpp.

References bbNodes, and oagFpga::RtlNode::self.

Referenced by binaryBusInputOutputOpt(), binaryBusOpt(), binaryOpt(), bitMux(), bitSeq(), busMux(), newTerminal(), unaryBusInputOutputOpt(), unaryBusOpt(), and unaryOpt().

void oagFpga::RtlGraph::binaryBusInputOutputOpt RtlNode::OptType  ot,
int  numOutBits,
vector< BBRef > &  in1,
vector< BBRef > &  in2,
vector< BBRef > &  out
 

For binary operations with multiple input and output bits (eg, ADD).

Definition at line 161 of file oagFpgaRtlGraph.cpp.

References addNode(), bbNodes, oagFpga::BBRef, oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), newNode(), oagFpga::RtlNode::numOutputBits, oagFpga::RtlNode::optInfo, oagFpga::RtlNode::optType, and oagFpga::RtlNode::self.

Referenced by oagFpga::Synthesis::binaryBusInputOutputOpt().

BBRef oagFpga::RtlGraph::binaryBusOpt RtlNode::OptType  ot,
vector< BBRef > &  in1,
vector< BBRef > &  in2
 

For multiple bits binary operations.

Definition at line 120 of file oagFpgaRtlGraph.cpp.

References addNode(), oagFpga::BBRef, oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), newNode(), oagFpga::RtlNode::optInfo, oagFpga::RtlNode::optType, and oagFpga::RtlNode::self.

Referenced by oagFpga::Synthesis::binaryBusOpt().

BBRef oagFpga::RtlGraph::binaryOpt RtlNode::OptType  ot,
BBRef  in1,
BBRef  in2
 

Single bit binary operation.

Definition at line 59 of file oagFpgaRtlGraph.cpp.

References addNode(), oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), newNode(), oagFpga::RtlNode::optInfo, oagFpga::RtlNode::optType, and oagFpga::RtlNode::self.

Referenced by oagFpga::Synthesis::binaryOpt().

BBRef oagFpga::RtlGraph::bitMux BBRef  in1,
BBRef  in2,
BBRef  sel
 

routines for mux generation Setup a mux for two bits.

Set connection port of this RtlNode.

Definition at line 343 of file oagFpgaRtlGraph.cpp.

References addNode(), oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), oagFpga::RtlNode::muxInfo, newNode(), and oagFpga::RtlNode::self.

Referenced by oagFpga::Synthesis::mux().

BBRef oagFpga::RtlGraph::bitSeq RtlNode::SeqType  st,
BBRef  D,
BBRef  clock,
BBRef  aLoad,
BBRef  aData
 

Setup an single-bit sequntial RtlNode.

Parameters:
st Sequential node type, can be LATCH or DFF
D Data port of a latch or dff
clock Clock port for DFF, or Enable port for a latch
aLoad Asynchronous load port for DFF only
aData Asynchornous data port for DFF only Set connection port of this RtlNode.

Definition at line 263 of file oagFpgaRtlGraph.cpp.

References addNode(), oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), getNull(), newNode(), oagFpga::RtlNode::self, oagFpga::RtlNode::seqInfo, and oagFpga::RtlNode::seqType.

BBRef oagFpga::RtlGraph::bitSeq RtlNode::SeqType  st,
BBRef  D
 

Definition at line 298 of file oagFpgaRtlGraph.cpp.

References getNull().

Referenced by oagFpga::Synthesis::latch(), and oagFpga::Synthesis::seq().

void oagFpga::RtlGraph::buildNetlist  )  [inline]
 

Definition at line 260 of file oagFpgaRtlGraph.h.

void oagFpga::RtlGraph::busMux vector< BBRef > &  in1,
vector< BBRef > &  in2,
vector< BBRef > &  sel,
vector< BBRef > &  outputs
 

Setup a mux for two buses.

Set connection port of this RtlNode.

Definition at line 416 of file oagFpgaRtlGraph.cpp.

References addNode(), bbNodes, oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), newNode(), oagFpga::RtlNode::numOutputBits, and oagFpga::RtlNode::self.

BBRef oagFpga::RtlGraph::busMux vector< BBRef > &  in,
vector< BBRef > &  sel
 

Setup a mux for a multiple-input signal with select signal "sel".

The encoding of the MUX is assumed from 000.. to 111..

Definition at line 376 of file oagFpgaRtlGraph.cpp.

References addNode(), oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), oagFpga::RtlNode::muxInfo, newNode(), and oagFpga::RtlNode::self.

Referenced by oagFpga::Synthesis::mux().

BBRef oagFpga::RtlGraph::constantOne  )  const [inline]
 

Definition at line 456 of file oagFpgaRtlGraph.h.

References oagFpga::BBRef.

Referenced by oagFpga::ModuleCompiler::compileBBNode(), oagFpga::Manager::create(), and getTransitiveFanin_recursive().

BBRef oagFpga::RtlGraph::constantZero  )  const [inline]
 

Definition at line 455 of file oagFpgaRtlGraph.h.

References oagFpga::BBRef.

Referenced by oagFpga::ModuleCompiler::compileBBNode(), oagFpga::Manager::create(), and getTransitiveFanin_recursive().

int oagFpga::RtlGraph::getBBNodeNum  )  [inline]
 

Definition at line 446 of file oagFpgaRtlGraph.h.

Referenced by oagFpga::Manager::isStructural().

void* oagFpga::RtlGraph::getExternalTerminalConnection BBRef  terminal  )  const [inline]
 

Definition at line 364 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::externalTerminalConnection, and oagFpga::RtlNode::funcType.

Referenced by oagFpga::Manager::getNetToAiConnection(), and oagFpga::Manager::getNetToBBConnection().

const list<BBRef>& oagFpga::RtlGraph::getFanin BBRef  x  )  [inline]
 

Parameters:
x 
Returns:
the fanin list

Definition at line 297 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::fanin.

const list<BBRef>& oagFpga::RtlGraph::getFanout BBRef  x  )  [inline]
 

Returns the fanin of a node.

Parameters:
x 
Returns:
the fanout list

Definition at line 305 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::fanout.

Referenced by getTransitiveFanout_recursive().

BBRef oagFpga::RtlGraph::getNextState BBRef  seq  )  const [inline]
 

Definition at line 281 of file oagFpgaRtlGraph.h.

References oagFpga::BBRef, oagFpga::RtlNode::funcType, and oagFpga::RtlNode::seqInfo.

RtlNode* oagFpga::RtlGraph::getNode BBRef  ref  )  const [inline]
 

utilities

Definition at line 327 of file oagFpgaRtlGraph.h.

Referenced by oagFpga::ModuleCompiler::BBRef2AiRef(), binaryBusInputOutputOpt(), binaryBusOpt(), binaryOpt(), bitMux(), bitSeq(), busMux(), oagFpga::ModuleCompiler::compileBBNode(), oagFpga::ModuleCompiler::compileFunctionalBBNode(), getTransitiveFanin_recursive(), hasCombinationalCycle_recursive(), newTerminal(), print(), removeFromFanout(), setTerminalDriver(), unaryBusInputOutputOpt(), unaryBusOpt(), and unaryOpt().

RtlNode::OptType oagFpga::RtlGraph::getNodeOptType BBRef  ref  )  const [inline]
 

Definition at line 335 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::optType.

RtlNode::SeqType oagFpga::RtlGraph::getNodeSeqType BBRef  ref  )  const [inline]
 

Definition at line 340 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::seqType.

RtlNode::FuncType oagFpga::RtlGraph::getNodeType BBRef  ref  )  const [inline]
 

Definition at line 331 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::funcType.

Referenced by oagFpga::Manager::getNetToBBConnection(), getTransitiveFanout_recursive(), and oagFpga::Manager::setNetToBBConnection().

BBRef oagFpga::RtlGraph::getNull  )  [inline, static]
 

functional operations

Definition at line 452 of file oagFpgaRtlGraph.h.

References oagFpga::BBRef.

Referenced by bitSeq(), oagFpga::Synthesis::createBusNet(), oagFpga::Synthesis::createScalarNet(), oagFpga::Manager::getNetToAiConnection(), oagFpga::Manager::getNetToBBConnection(), oagFpga::Synthesis::latch(), oagFpga::Manager::prepareNetToBBConnection(), and oagFpga::Synthesis::seq().

int oagFpga::RtlGraph::getNumOutputBits BBRef  x  )  const [inline]
 

Definition at line 289 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::numOutputBits.

BBRef oagFpga::RtlGraph::getOutputBit BBRef  ref  )  [inline]
 

Black box fanout operations.

Fanout model of black box node:

  • for single-bit output node, its BBRef (self) denotes its output
  • for multiple-bit output node (such as an adder), say N-bit, it takes continueous N slots in bbNodes array, this->self is

Definition at line 439 of file oagFpgaRtlGraph.h.

References oagFpga::BBRef, and oagFpga::RtlNode::self.

Referenced by oagFpga::ModuleCompiler::BBRef2AiRef(), and oagFpga::ModuleCompiler::compileBBNode().

int oagFpga::RtlGraph::getPrimaryBBID BBRef  x  )  const [inline]
 

Definition at line 293 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::self.

BBRef oagFpga::RtlGraph::getTerminalDriver BBRef  terminal  )  [inline]
 

Definition at line 273 of file oagFpgaRtlGraph.h.

References oagFpga::BBRef, oagFpga::RtlNode::fanin, and oagFpga::RtlNode::funcType.

Referenced by oagFpga::Synthesis::assignMultiRef(), oagFpga::ModuleCompiler::compileBBNode(), oagFpga::OccGraph::getTerminalDriver(), getTransitiveFanin_recursive(), and hasCombinationalCycle_recursive().

void oagFpga::RtlGraph::getTransitiveFanin list< BBRef x,
vector< BBRef > &  transitiveFanin,
bool  includeRoots = true,
bool  crossSequential = false
 

Returns a vector of all nodes in the transitive fan-in of several nodes.

The nodes in the transitive fan-in are appended to the provided list in forward topological order.

The initial nodes will not be included unless they themselves lie in the fan-in of another initial node.

The backward traversal will terminate at terminal nodes that point to a null reference, the constant zero node, and sequential nodes (if the parameter crossSequential is false). If the parameter includeRoots is true, these root nodes will be included in the result.

If the initial reference is to a sequential node, the transitive fan-in of its nextState input and annotated asynchronous signals will be returned.

This function will modify traversal IDs.

Cycles are permitted.

Parameters:
x the vertices of the fan-in cone
transitiveFanin the vector onto which to append the results
includeRoots true if root nodes should be included
crossSequential true if the traversal should cross sequential nodes

Definition at line 815 of file oagFpgaRtlGraph.cpp.

References getTransitiveFanin_recursive(), and newTraversalID().

void oagFpga::RtlGraph::getTransitiveFanin list< BBRef x,
list< BBRef > &  transitiveFanin,
bool  includeRoots = true,
bool  crossSequential = false
 

Returns a list of all nodes in the transitive fan-in of several nodes.

The nodes in the transitive fan-in are appended to the provided list in forward topological order. The initial node is not included.

The backward traversal will terminate at terminal nodes that point to a null reference, the constant zero node, and sequential nodes (if the parameter crossSequential is false). If the parameter includeRoots is true, these root nodes will be included in the result.

If the initial reference is to a sequential node, the transitive fan-in of its nextState input will be returned.

This function will modify traversal IDs.

Cycles are permitted.

Parameters:
x the vertex of the fan-in cone
transitiveFanin the list onto which to append the results
includeRoots true if root nodes should be included
crossSequential true if the traversal should cross sequential nodes

Definition at line 967 of file oagFpgaRtlGraph.cpp.

References getTransitiveFanin_recursive(), and newTraversalID().

void oagFpga::RtlGraph::getTransitiveFanin BBRef  x,
vector< BBRef > &  transitiveFanin,
bool  includeRoots = true,
bool  crossSequential = false
 

Returns a vector of all nodes in the transitive fan-in.

The nodes in the transitive fan-in are appended to the provided list in forward topological order. The initial node is not included.

The backward traversal will terminate at terminal nodes that point to a null reference, the constant zero node, and sequential nodes (if the parameter crossSequential is false). If the parameter includeRoots is true, these root nodes will be included in the result.

If the initial reference is to a sequential node, the transitive fan-in of its nextState input and annotated asynchronous signals will be returned.

This function will modify traversal IDs.

Cycles are permitted.

Parameters:
x the vertex of the fan-in cone
transitiveFanin the vector onto which to append the results
includeRoots true if root nodes should be included
crossSequential true if the traversal should cross sequential nodes

Definition at line 776 of file oagFpgaRtlGraph.cpp.

References getTransitiveFanin_recursive(), and newTraversalID().

void oagFpga::RtlGraph::getTransitiveFanin BBRef  x,
list< BBRef > &  transitiveFanin,
bool  includeRoots = true,
bool  crossSequential = false
 

Returns a list of all nodes in the transitive fan-in of a node.

The nodes in the transitive fan-in are appended to the provided list in forward topological order. The initial node is not included.

The backward traversal will terminate at terminal nodes that point to a null reference, the constant zero node, and sequential nodes (if the parameter crossSequential is false). If the parameter includeRoots is true, these root nodes will be included in the result.

If the initial reference is to a sequential node, the transitive fan-in of its nextState input will be returned.

This function will modify traversal IDs.

Cycles are permitted.

Parameters:
x the vertex of the fan-in cone
transitiveFanin the list onto which to append the results
includeRoots true if root nodes should be included
crossSequential true if the traversal should cross sequential nodes

Definition at line 931 of file oagFpgaRtlGraph.cpp.

References getTransitiveFanin_recursive(), and newTraversalID().

Referenced by oagFpga::OccGraph::getTransitiveFanin(), and oagFpga::ModGraph::getTransitiveFanin().

void oagFpga::RtlGraph::getTransitiveFanin_recursive BBRef  x,
list< BBRef > &  transitiveFanin,
bool  includeRoots,
bool  crossSequential = false
 

Internal function.

The ordering of the result is in NORMAL forward topological order.

Definition at line 990 of file oagFpgaRtlGraph.cpp.

References oagFpga::BBRef, constantOne(), constantZero(), oagFpga::RtlNode::fanin, oagFpga::RtlNode::funcType, getNode(), getTerminalDriver(), getTransitiveFanin_recursive(), isNull(), isSequential(), isTerminal(), isVisited(), and markVisited().

void oagFpga::RtlGraph::getTransitiveFanin_recursive BBRef  x,
vector< BBRef > &  transitiveFanin,
bool  includeRoots,
bool  crossSequential = false
 

Internal function.

The result is returend in NORMAL forward topological order.

Definition at line 839 of file oagFpgaRtlGraph.cpp.

References oagFpga::BBRef, constantOne(), constantZero(), oagFpga::RtlNode::fanin, oagFpga::RtlNode::funcType, getNode(), getTerminalDriver(), isNull(), isSequential(), isTerminal(), isVisited(), and markVisited().

Referenced by getTransitiveFanin(), and getTransitiveFanin_recursive().

void oagFpga::RtlGraph::getTransitiveFanout list< BBRef x,
vector< BBRef > &  transitiveFanout,
bool  includeRoots = true,
bool  crossSequential = false
 

Returns a vector of all nodes in the transitive fan-out of several nodes.

The nodes in the transitive fan-in are appended to the provided vector in forward topological order.

The initial nodes will not be included unless they themselves lie in the fan-in of another initial node.

The forward traversal will terminate at sequential nodes (if the crossSequential parameter is false) and nodes that do not have any fan-out. If includesRoots is false, the root nodes will not be included in the result.

If the initial reference is to a sequential node, the traversal will continue along its fanout and not terminate immediately.

If fan-out is not being maintained, the function returns immediately without modifying the list.

This function will modify traversal IDs.

Cycles are permitted.

Parameters:
x the vertex of the fan-out cone
transitiveFanout the vector onto which to append the results
includeRoots true if root nodes should be included
crossSequential true if the traversal should cross sequential nodes

Definition at line 1135 of file oagFpgaRtlGraph.cpp.

References getTransitiveFanout_recursive(), and newTraversalID().

void oagFpga::RtlGraph::getTransitiveFanout list< BBRef x,
list< BBRef > &  transitiveFanout,
bool  includeRoots = true,
bool  crossSequential = false
 

Returns a list of all nodes in the transitive fan-out of several nodes.

The nodes in the transitive fan-out are appended to the provided list in forward topological order. The initial node is not included.

The forward traversal will terminate at sequential nodes (if the crossSequential parameter is false) and nodes that do not have any fan-out. If includesRoots is false, the root nodes will not be included in the result.

If the initial reference is to a sequential node, the traversal will continue along its fanout and not terminate immediately.

If fan-out is not being maintained, the function returns immediately without modifying the list.

This function will modify traversal IDs.

Cycles are permitted.

Parameters:
x the vertex of the fan-in cone
transitiveFanout the list onto which to append the results
includeRoots true if root nodes should be included
crossSequential true if the traversal should cross sequential nodes

Definition at line 1239 of file oagFpgaRtlGraph.cpp.

References getTransitiveFanout_recursive(), and newTraversalID().

void oagFpga::RtlGraph::getTransitiveFanout BBRef  x,
vector< BBRef > &  transitiveFanout,
bool  includeRoots = true,
bool  crossSequential = false
 

Returns a vector of all nodes in the transitive fan-out.

The nodes in the transitive fan-out are appended to the provided vector in forward topological order. The initial node is not included.

The forward traversal will terminate at sequential nodes (if the crossSequential parameter is false) and nodes that do not have any fan-out. If includesRoots is false, the root nodes will not be included in the result.

If the initial reference is to a sequential node, the traversal will continue along its fanout and not terminate immediately.

If fan-out is not being maintained, the function returns immediately without modifying the list.

This function will modify traversal IDs.

Cycles are permitted.

Parameters:
x the vertex of the fan-out cone
transitiveFanout the vector onto which to append the results
includeRoots true if root nodes should be included
crossSequential true if the traversal should cross sequential nodes

Definition at line 1085 of file oagFpgaRtlGraph.cpp.

References getTransitiveFanout_recursive(), and newTraversalID().

void oagFpga::RtlGraph::getTransitiveFanout BBRef  x,
list< BBRef > &  transitiveFanout,
bool  includeRoots = true,
bool  crossSequential = false
 

Returns a list of all nodes in the transitive fan-out.

The nodes in the transitive fan-in are appended to the provided list in forward topological order. The initial node is not included.

The forward traversal will terminate at sequential nodes (if the crossSequential parameter is false) and nodes that do not have any fan-out. If includesRoots is false, the root nodes will not be included in the result.

If the initial reference is to a sequential node, the traversal will continue along its fanout and not terminate immediately.

If fan-out is not being maintained, the function returns immediately without modifying the list.

This function will modify traversal IDs.

Cycles are permitted.

Parameters:
x the vertex of the fan-out cone
transitiveFanout the list onto which to append the results
includeRoots true if root nodes should be included
crossSequential true if the traversal should cross sequential nodes

Definition at line 1287 of file oagFpgaRtlGraph.cpp.

References getTransitiveFanout_recursive(), and newTraversalID().

Referenced by oagFpga::OccGraph::getTransitiveFanout(), and oagFpga::ModGraph::getTransitiveFanout().

void oagFpga::RtlGraph::getTransitiveFanout_recursive BBRef  x,
list< BBRef > &  transitiveFanout,
bool  includeRoots,
bool  crossSequential = false
 

Internal function.

The ordering of the result is in NORMAL forward topological order.

Definition at line 1309 of file oagFpgaRtlGraph.cpp.

References oagFpga::BBRef, getFanout(), getNodeType(), getTransitiveFanout_recursive(), hasFanout(), isNull(), isVisited(), and markVisited().

void oagFpga::RtlGraph::getTransitiveFanout_recursive BBRef  x,
vector< BBRef > &  transitiveFanout,
bool  includeRoots,
bool  crossSequential = false
 

Internal function.

NOTE: Because the result is returned in a vector and the efficiencies of adding to the front and back are not symmetrical, the ordering of the result is in REVERSE forward topological order.

Definition at line 1169 of file oagFpgaRtlGraph.cpp.

References oagFpga::BBRef, getFanout(), getNodeType(), hasFanout(), isNull(), isVisited(), and markVisited().

Referenced by getTransitiveFanout(), and getTransitiveFanout_recursive().

bool oagFpga::RtlGraph::hasCombinationalCycle  ) 
 

Tests if there are any combinational cycles in the graph.

A combinational cycle is any cycle in the graph of CONTROL, OPERATOR and TERMINAL nodes.

This function will modify traversal IDs.

Returns:
true, if one or more combinational cycles exist

Definition at line 681 of file oagFpgaRtlGraph.cpp.

References oagFpga::BBRef, dataBBNodes, DEBUG_PRINTLN, hasCombinationalCycle_recursive(), newTraversalID(), and oagFpga::RtlNode::self.

Referenced by oagFpga::ModGraph::hasCombinationalCycle().

bool oagFpga::RtlGraph::hasCombinationalCycle_recursive BBRef  x,
unsigned int  startingTravID
 

Tests if there are any combinational cycles in the graph from a node.

Returns:
true, if one or more combinational cycles exist

Definition at line 708 of file oagFpgaRtlGraph.cpp.

References oagFpga::RtlNode::fanin, oagFpga::RtlNode::funcType, getNode(), getTerminalDriver(), isNull(), and oagFpga::RtlNode::traversalID.

Referenced by hasCombinationalCycle().

bool oagFpga::RtlGraph::hasFanout BBRef  x  )  const [inline]
 

Returns the fanout of a node.

Parameters:
x 
Returns:
true, if the node has any fanout, false otherwise

Definition at line 313 of file oagFpgaRtlGraph.h.

Referenced by getTransitiveFanout_recursive().

bool oagFpga::RtlGraph::isFunctional BBRef  x  )  const [inline]
 

Definition at line 351 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::funcType.

Referenced by oagFpga::ModuleCompiler::compileBBNode().

bool oagFpga::RtlGraph::isNull BBRef  ref  )  [inline, static]
 

Definition at line 453 of file oagFpgaRtlGraph.h.

Referenced by oagFpga::Synthesis::assignMultiRef(), oagFpga::ModuleCompiler::compileBBNode(), oagFpga::Manager::getNetToBBConnection(), getTransitiveFanin_recursive(), getTransitiveFanout_recursive(), hasCombinationalCycle_recursive(), oagFpga::Manager::print(), and removeFromFanout().

bool oagFpga::RtlGraph::isSequential BBRef  x  )  const [inline]
 

Definition at line 358 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::funcType.

Referenced by oagFpga::ModuleCompiler::compileBBNode(), and getTransitiveFanin_recursive().

bool oagFpga::RtlGraph::isTerminal BBRef  x  )  const [inline]
 

Definition at line 345 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::funcType.

Referenced by oagFpga::ModuleCompiler::compileBBNode(), oagFpga::Manager::getNetToBBConnection(), getTransitiveFanin_recursive(), and oagFpga::Manager::prepareNetToBBConnection().

bool oagFpga::RtlGraph::isVisited BBRef  x  )  const [inline]
 

Unmarks a node as having been visited in the current traversal.

Tests if a node has been visited in the current

Parameters:
x 
Returns:
true, if node has been visited

Definition at line 386 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::traversalID.

Referenced by getTransitiveFanin_recursive(), and getTransitiveFanout_recursive().

void oagFpga::RtlGraph::markVisited BBRef  x  )  [inline]
 

Parameters:
x 

Definition at line 374 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::traversalID.

Referenced by getTransitiveFanin_recursive(), and getTransitiveFanout_recursive().

RtlNode * oagFpga::RtlGraph::newNode  ) 
 

Definition at line 473 of file oagFpgaRtlGraph.cpp.

References oagFpga::BBRef, dataBBNodes, oagFpga::RtlNode::funcType, and oagFpga::RtlNode::self.

Referenced by binaryBusInputOutputOpt(), binaryBusOpt(), binaryOpt(), bitMux(), bitSeq(), busMux(), newTerminal(), unaryBusInputOutputOpt(), unaryBusOpt(), and unaryOpt().

BBRef oagFpga::RtlGraph::newTerminal BBRef  driver  ) 
 

Definition at line 482 of file oagFpgaRtlGraph.cpp.

References addNode(), DEBUG_PRINTLN, oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), newNode(), and oagFpga::RtlNode::self.

Referenced by oagFpga::Synthesis::createBusNet(), oagFpga::Synthesis::createScalarNet(), oagFpga::Manager::prepareNetToAiConnection(), and oagFpga::Manager::prepareNetToBBConnection().

unsigned int oagFpga::RtlGraph::newTraversalID  ) 
 

routines for advanced graph traversal Generates a unique ID for a new graph traversal.

Traversal IDs can be used to selectively mark nodes during a graph traversal operation. A node is considered "marked" if its traversal ID is the same as the current glocal traversal ID; if its traversal ID is out of date or cleared, then it is considered "unmarked".

The IDs are disposable in that no explicit unmarking is necessary; once a new ID is generated, any nodes marked with old IDs are implicitly moved to unmarked status.

The main advantage of this approach is to avoid clearing "traversalID" for all RtlNode every single tme. Instead, the clearing is needed only when currentTraversalID is out of bound of "unsigned int". Note that a valid value of currentTraversalID can never be 0.

Returns:
the value of the new traversal ID

Definition at line 652 of file oagFpgaRtlGraph.cpp.

References currentTraversalID, dataBBNodes, and oagFpga::RtlNode::traversalID.

Referenced by getTransitiveFanin(), getTransitiveFanout(), and hasCombinationalCycle().

void oagFpga::RtlGraph::print ostream &  os,
RtlNode node
 

Print one RtlNode.

Definition at line 571 of file oagFpgaRtlGraph.cpp.

References oagFpga::RtlNode::funcType, oagFpga::RtlNode::optType, oagFpga::RtlNode::self, and oagFpga::RtlNode::seqType.

void oagFpga::RtlGraph::print ostream &  os  ) 
 

Print nodes and connections of this*.

Definition at line 587 of file oagFpgaRtlGraph.cpp.

References bbNodes, dataBBNodes, oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, getNode(), and oagFpga::RtlNode::self.

Referenced by oagFpga::Manager::print(), and oagFpga::Manager::setNetToAiConnection().

void oagFpga::RtlGraph::removeFromFanout BBRef  x,
BBRef  fanout
 

Removes a reference from a fanout list.

Either the reference will be removed from the fanout list, if present. If it appears more than once in the list, only one copy is removed.

Parameters:
x the node whose fanout list onto which a reference is appended
fanout the reference to append

Definition at line 511 of file oagFpgaRtlGraph.cpp.

References oagFpga::BBRef, oagFpga::RtlNode::fanout, getNode(), and isNull().

Referenced by setTerminalDriver().

void oagFpga::RtlGraph::setExternalTerminalConnection BBRef  ref,
void *  connection
[inline]
 

Definition at line 262 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::externalTerminalConnection, and oagFpga::RtlNode::funcType.

Referenced by oagFpga::Manager::removeNetToAiConnection(), oagFpga::Manager::setNetToAiConnection(), and oagFpga::Manager::setNetToBBConnection().

void oagFpga::RtlGraph::setTerminalDriver BBRef  terminal,
BBRef  driver
 

Sets the driver of a TERMINAL node.

The graph is marked as dirty.

Parameters:
terminal an reference to the TERMINAL node
driver a reference to new driver of the terminal

Definition at line 544 of file oagFpgaRtlGraph.cpp.

References oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), and removeFromFanout().

Referenced by oagFpga::Synthesis::assignMultiRef(), oagFpga::Manager::create(), and oagFpga::ModGraph::setTerminalDriver().

void oagFpga::RtlGraph::unaryBusInputOutputOpt RtlNode::OptType  ot,
int  numOutBits,
vector< BBRef > &  in1,
vector< BBRef > &  out
 

For unary operations with multiple input and output bits.

Definition at line 215 of file oagFpgaRtlGraph.cpp.

References addNode(), bbNodes, oagFpga::BBRef, oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), newNode(), oagFpga::RtlNode::numOutputBits, oagFpga::RtlNode::optInfo, oagFpga::RtlNode::optType, and oagFpga::RtlNode::self.

Referenced by oagFpga::Synthesis::unaryBusInputOutputOpt().

BBRef oagFpga::RtlGraph::unaryBusOpt RtlNode::OptType  ot,
vector< BBRef > &  ins
 

For *reduction* operations.

Definition at line 89 of file oagFpgaRtlGraph.cpp.

References addNode(), oagFpga::BBRef, oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), newNode(), oagFpga::RtlNode::optInfo, oagFpga::RtlNode::optType, and oagFpga::RtlNode::self.

Referenced by oagFpga::Synthesis::unaryBusOpt().

BBRef oagFpga::RtlGraph::unaryOpt RtlNode::OptType  ot,
BBRef  driver
 

Single bit unary operation.

Definition at line 32 of file oagFpgaRtlGraph.cpp.

References addNode(), oagFpga::RtlNode::fanin, oagFpga::RtlNode::fanout, oagFpga::RtlNode::funcType, getNode(), newNode(), oagFpga::RtlNode::optInfo, oagFpga::RtlNode::optType, and oagFpga::RtlNode::self.

Referenced by oagFpga::Synthesis::notOf().

void oagFpga::RtlGraph::unmarkVisited BBRef  x  )  [inline]
 

Marks a node as having been visited in the current traversal.

Parameters:
x 

Definition at line 380 of file oagFpgaRtlGraph.h.

References oagFpga::RtlNode::traversalID.


Friends And Related Function Documentation

friend class Manager [friend]
 

Definition at line 205 of file oagFpgaRtlGraph.h.

friend class ModuleCompiler [friend]
 

Definition at line 206 of file oagFpgaRtlGraph.h.


Member Data Documentation

vector<RtlNode*> oagFpga::RtlGraph::bbNodes [protected]
 

Definition at line 465 of file oagFpgaRtlGraph.h.

Referenced by addNode(), binaryBusInputOutputOpt(), busMux(), print(), and unaryBusInputOutputOpt().

BBRef oagFpga::RtlGraph::CONSTANT0_BBREF [protected]
 

Definition at line 471 of file oagFpgaRtlGraph.h.

BBRef oagFpga::RtlGraph::CONSTANT1_BBREF [protected]
 

Definition at line 472 of file oagFpgaRtlGraph.h.

unsigned int oagFpga::RtlGraph::currentTraversalID [protected]
 

Definition at line 475 of file oagFpgaRtlGraph.h.

Referenced by newTraversalID().

vector<RtlNode*> oagFpga::RtlGraph::dataBBNodes [protected]
 

Definition at line 468 of file oagFpgaRtlGraph.h.

Referenced by oagFpga::ModuleCompiler::compileModules(), hasCombinationalCycle(), newNode(), newTraversalID(), and print().

const BBRef oagFpga::RtlGraph::NULL_BBREF = 0 [static, protected]
 

Definition at line 470 of file oagFpgaRtlGraph.h.


The documentation for this class was generated from the following files:
Generated on Mon Jul 9 14:17:23 2007 for OA Gear Fpga by  doxygen 1.3.9.1