The major method to generate an APEG is
virtual int createMe(Galaxy& galaxy, int selfLoopFlag);The first argument is the original SDF galaxy of which the pointer will be stored in a protected member
myGal.The second argument enforces to make arcs between invocations of the same star regardless of the dependency. The procedure of APEG generation is as follows.
5. Initialize the APEG graph.
virtual void initialize();Does nothing here, but will be redefined in the derived class if necessary.
6. Allocate all invocations (EGNodes) of the blocks in the original SDF graph. Keep the list of the first invocations of all blocks in the protected member
virtual EGNode *newNode(DataFlowStar* star, int invoc_index);Is used to create an invocation of a DataFlowStar given as the first argument. The second argument is the invocation number of the node. This method is virtual since the derived ExpandedGraph class may have derived classes from the EGNode class.
7. For each star in the original SDF graph,
(3-1) Make connections between invocations of the star if any one of the conditions is met:
selfLoopFlagis set in the second argument, the star has internal states, the star accesses past values on its portholes, or the star is a wormhole. The connection made in this stage does not indicate the flow path of samples, but the precedence relation of two EGNodes. Therefore, EGGates associated with this connection are not associated with portholes in the original SDF graph. If the connections are made, the
claimStickymethod of EGNode class is called for each invocation EGNode. If any such connection is made, the APEG is said not-parallelizable as a whole: A protected member,
parallelizable,is set FALSE.
(3-2) For each input porthole, get the far-side output porthole and make connections between invocations of two DataFlowStars. A connection in the original SDF graph may be mapped to several connections in the APEG since the APEG is homogeneous.
8. Find the root nodes in the APEG and stored in its protected member
void insertSource(EGNode* node);Inserts the argument EGNode into the source list,
sources,of the graph.
All protected members are explained above.
int numNodes();This method returns the number of total nodes in the APEG.
virtual StringList display();Displays all EGNodes by calling
printMemethod of EGNode class.
virtual void removeArcsWithDelay();This method hide all connections that have delays on them. When an APEG is created, the number of initial delays on an arc, if exists, is always greater than or equal to the sample rate of the arc. Therefore, this method is used to make the APEG actually acyclic.
masterslist of the graph. EGSourceIter returns the EGNodes in
sourceslist of the graph. Finally, EGIter returns all EGNodes of the ExpandedGraph.
EGMasterIter and EGSourceIter are derived from EGNodeListIter. EGIter, however, is not derived from any class. Instead, EGIter uses EGMasterIter to get the first invocation of each DataFlowStar in the original SDF graph and traverse the linked list of invocations. Thus invocations are traversed master by master.