49#ifdef DEBUG_BUBBLEFISH_SCHEDULER
50 static int dotCount = 0;
56 std::cerr <<
"incoming lc -1 on pushmoveup!" << std::endl;
60#ifdef DEBUG_BUBBLEFISH_SCHEDULER
61 std::cerr <<
"\t\t|TCannot reschedule control flow move!" << std::endl;
67#ifdef DEBUG_BUBBLEFISH_SCHEDULER
68 std::cerr <<
"\t\t|TCannot reschedule guard write move!" << std::endl;
73#ifdef DEBUG_BUBBLEFISH_SCHEDULER
79 std::cerr <<
"\t\tPushing move up: " <<
mn_.
toString() <<
" to cycle: "
103#ifdef DEBUG_BUBBLEFISH_SCHEDULER
104 std::cerr <<
"ddg latest cycle -1 in pushmoveup of:"
110#ifdef DEBUG_BUBBLEFISH_SCHEDULER
114 std::cerr <<
"\t\tPushing move: " <<
mn_.
toString()
115 <<
" up, ddgLC now: " << ddgLC << std::endl;
117 int lc = std::min(
lc_, ddgLC);
121#ifdef DEBUG_BUBBLEFISH_SCHEDULER
125 std::cerr <<
"\t\tMay need to push predecessors.." << std::endl;
132 std::cerr <<
"\t\tDDG earliest cycle still too early: "
133 << ddgEC << std::endl;
137#ifdef DEBUG_BUBBLEFISH_SCHEDULER
141 std::cerr <<
"\t\tPredecessors pushed ok!" << std::endl;
145#ifdef DEBUG_BUBBLEFISH_SCHEDULER
150 std::cerr <<
"\t\tDDG ec too late, Need to recursively push more,"
151 <<
" which failed" << std::endl;
156#ifdef DEBUG_BUBBLEFISH_SCHEDULER
163#ifdef DEBUG_BUBBLEFISH_SCHEDULER
168 <<
" after pushing preds: " << ddgLC << std::endl;
172 if (rmlc == -1 || rmlc < ddgEC) {
174#ifdef DEBUG_BUBBLEFISH_SCHEDULER
175 std::cerr <<
"\t\tlc too small, cannot push again" << std::endl;
180#ifdef DEBUG_BUBBLEFISH_SCHEDULER
185#ifdef DEBUG_BUBBLEFISH_SCHEDULER
189 std::cerr <<
"\t\trmlc problem: " <<rmlc
190 <<
"ddgec: " << ddgEC << std::endl;
192 dotName <<
mn_.
nodeID() <<
"_" <<
ii() <<
"_" << dotCount++ <<
".dot";
193 std::cerr <<
"Writing dot: " << dotName << std::endl;
199 std::cerr <<
"\t\tRM lc -1 when pushing move up, failing:"
205 std::cerr <<
"\t\tddgLC is: " << ddgLC << std::endl;
208 std::cerr <<
"Trying to push preds one more up." << std::endl;
218 std::cerr <<
"\t\tDDG earliest cycle STILL too early: "
219 << ddgEC << std::endl;
225 if (rmlc == -1 || rmlc < ddgEC) {
226#ifdef DEBUG_BUBBLEFISH_SCHEDULER
227 std::cerr <<
"still failing, now giving up" << std::endl;
239#ifdef DEBUG_BUBBLEFISH_SCHEDULER
240 std::cerr <<
"\t\tUndoing recursive pushs of predecessors"
245#ifdef DEBUG_BUBBLEFISH_SCHEDULER
249 std::cerr <<
"\t\tReturning the original" << std::endl;
253#ifdef DEBUG_BUBBLEFISH_SCHEDULER
258 std::cerr <<
"\t\treturned original: "<<
mn_.
toString()
267#ifdef DEBUG_BUBBLEFISH_SCHEDULER
271 std::cerr <<
"\tPushed move successfully: " <<
mn_.
toString()
#define assert(condition)
MoveNode * guardWriteNode()
DataDependenceGraph & ddg()
virtual int rmLC(int cycle, MoveNode &mn, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1)
virtual bool assign(int cycle, MoveNode &, const TTAMachine::Bus *bus=nullptr, const TTAMachine::FunctionUnit *srcFU_=nullptr, const TTAMachine::FunctionUnit *dstFU=nullptr, const TTAMachine::Bus *prologBus=nullptr, int immWriteCycle=-1, int prologImmWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1, bool ignoreGuardWriteCycle=false)
std::stack< Reversible * > midChildren_
static int recurseCounter_
void unscheduleOriginal()
int latestCycle(const MoveNode &moveNode, unsigned int ii=UINT_MAX, bool ignoreRegAntideps=false, bool ignoreUnscheduledSuccessors=true, bool ignoreGuards=false, bool ignoreFUDeps=false, bool ignoreSameOperationEdges=false) const
int earliestCycle(const MoveNode &moveNode, unsigned int ii=UINT_MAX, bool ignoreRegWaRs=false, bool ignoreRegWaWs=false, bool ignoreGuards=false, bool ignoreFUDeps=false, bool ignoreSameOperationEdges=false, bool assumeBypassing=false) const
virtual void writeToDotFile(const TCEString &fileName) const
bool isDestinationOperation() const
std::string toString() const
TTAProgram::Move & move()
ProgramOperation & destinationOperation(unsigned int index=0) const
int inputMoveCount() const
MoveNode & inputMove(int index) const
std::stack< Reversible * > preChildren_
void undoAndRemoveChildren(std::stack< Reversible * > &children)
bool runPreChild(Reversible *preChild)
bool isControlFlowMove() const
Terminal & destination() const
virtual bool isTriggering() const