OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
BFPushAntidepDown Class Reference

#include <BFPushAntidepDown.hh>

Inheritance diagram for BFPushAntidepDown:
Inheritance graph
Collaboration diagram for BFPushAntidepDown:
Collaboration graph

Public Member Functions

 BFPushAntidepDown (BF2Scheduler &sched, MoveNode &adepDest, int latency, int newLC)
 
bool operator() ()
 
- Public Member Functions inherited from BFRescheduleMove
 BFRescheduleMove (BF2Scheduler &sched, MoveNode &mn)
 
void undoOnlyMe ()
 
- Public Member Functions inherited from BFUnscheduleMove
 BFUnscheduleMove (BF2Scheduler &sched, MoveNode &mn)
 
void unscheduleOriginal ()
 
void undoOnlyMe ()
 
bool operator() ()
 
- Public Member Functions inherited from BFOptimization
 BFOptimization (BF2Scheduler &sched)
 
virtual bool isFinishFront ()
 
virtual void mightBeReady (MoveNode &mn)
 
- Public Member Functions inherited from Reversible
virtual void undo ()
 
virtual ~Reversible ()
 
void deleteChildren (std::stack< Reversible * > &children)
 
int id ()
 
 Reversible ()
 

Private Attributes

int lat_
 
int newLC_
 

Additional Inherited Members

- Static Public Member Functions inherited from BFOptimization
static void clearPrologMoves ()
 
static MoveNodegetSisterTrigger (const MoveNode &mn, const TTAMachine::Machine &mach)
 
- Protected Member Functions inherited from BFUnscheduleMove
void returnOriginal ()
 
- Protected Member Functions inherited from BFOptimization
DataDependenceGraphddg ()
 
DataDependenceGraphrootDDG ()
 
const DataDependenceGraphddg () const
 
DataDependenceGraphprologDDG ()
 
SimpleResourceManagerrm () const
 
SimpleResourceManagerprologRM () const
 
BUMoveNodeSelectorselector ()
 
const TTAMachine::MachinetargetMachine () const
 
unsigned int ii () const
 
MoveNodeDuplicatorduplicator () const
 
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)
 
virtual void unassign (MoveNode &mn, bool disposePrologCopy=true)
 
virtual int rmEC (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 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 canAssign (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, bool ignoreGWN=false)
 
bool putAlsoToPrologEpilog (int cycle, MoveNode &mn)
 
void setPrologSrcFUAnno (MoveNode &prologMN, MoveNode &loopMN)
 
void setPrologDstFUAnno (MoveNode &prologMN, MoveNode &loopMN)
 
void setJumpGuard (MoveNode &mn)
 
void unsetJumpGuard (MoveNode &mn)
 
bool needJumpGuard (const MoveNode &mn, int cycle)
 
int jumpGuardAvailableCycle (const MoveNode &mn)
 
bool canBeSpeculated (const Operation &op)
 
bool canBeSpeculated (const MoveNode &mn)
 
bool usePrologMove (const MoveNode &mn)
 
bool canBeScheduled (const MoveNode &mn)
 
const TTAMachine::RegisterFileRFReadPortCountPreventsScheduling (const MoveNode &mn)
 
bool immCountPreventsScheduling (const MoveNode &mn)
 
- Protected Member Functions inherited from Reversible
bool runPreChild (Reversible *preChild)
 
bool runPostChild (Reversible *preChild)
 
bool runChild (std::stack< Reversible * > &children, Reversible *child)
 
bool runChild (Reversible *child, bool pre)
 
void undoAndRemovePreChildren ()
 
void undoAndRemovePostChildren ()
 
void undoAndRemoveChildren (std::stack< Reversible * > &children)
 
- Protected Attributes inherited from BFRescheduleMove
std::stack< Reversible * > midChildren_
 
- Protected Attributes inherited from BFUnscheduleMove
MoveNodemn_
 
int oldCycle_
 
const TTAMachine::BusoldBus_
 
const TTAMachine::BusprologBus_
 
int oldImmWriteCycle_
 
int prologImmWriteCycle_
 
const TTAMachine::FunctionUnitdstFU_
 
const TTAMachine::FunctionUnitsrcFU_
 
const TTAMachine::ImmediateUnitimmu_
 
int immRegIndex_
 
- Protected Attributes inherited from BFOptimization
BF2Schedulersched_
 
- Protected Attributes inherited from Reversible
std::stack< Reversible * > preChildren_
 
std::stack< Reversible * > postChildren_
 
- Static Protected Attributes inherited from BFUnscheduleMove
static int recurseCounter_ = 0
 
- Static Protected Attributes inherited from BFOptimization
static std::map< MoveNode *, MoveNode *, MoveNode::ComparatorprologMoves_
 

Detailed Description

Definition at line 48 of file BFPushAntidepDown.hh.

Constructor & Destructor Documentation

◆ BFPushAntidepDown()

BFPushAntidepDown::BFPushAntidepDown ( BF2Scheduler sched,
MoveNode adepDest,
int  latency,
int  newLC 
)
inline

Definition at line 50 of file BFPushAntidepDown.hh.

51  :
52  BFRescheduleMove(sched, adepDest),
53  lat_(latency), newLC_(newLC) {}

Member Function Documentation

◆ operator()()

bool BFPushAntidepDown::operator() ( )
virtual

This performs the operation. Returns true if success, false if fail.

Implements Reversible.

Definition at line 52 of file BFPushAntidepDown.cc.

52  {
53  if (mn_.move().isControlFlowMove()) {
54 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
55  std::cerr << "\t\t\tCannot reschedule control flow move!" << std::endl;
56 #endif
57  return false;
58  }
59 
60  if (&mn_ == sched_.guardWriteNode()) {
61 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
62  std::cerr << "\t\t|TCannot reschedule guard write move!" << std::endl;
63 #endif
64  return false;
65  }
66 
68 
69  int ddgLC = ddg().latestCycle(mn_);
70  int ddgEC = ddg().earliestCycle(mn_);
71 
72  // first try to schedule top-down close to the optimal as possible
73  int prefEc = newLC_ - lat_ +1;
74  if (ddgEC > prefEc) {
75  prefEc = ddgEC;
76  }
77 
78  int ec = rmEC(prefEc, mn_);
79  if (ec <= std::min(ddgLC,sched_.maximumAllowedCycle()) && ec != -1) {
80 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
81  std::cerr << "\t\t\t\t\ttopdown resched: " << ec << std::endl;
82 #endif
83  assign(ec, mn_);
84  return true;
85  } else {
86  // topdown failed, bottom-up then be it
87  int lc = rmLC(
88  (std::min(ddgLC, sched_.maximumAllowedCycle())),mn_);
89 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
90  std::cerr << "\t\t\t\tbottomup resched ddglc: " << ddgLC << " latest_: "
91  << sched_.maximumAllowedCycle() << " lc: " << lc << std::endl;
92 #endif
93  if (lc < ddgEC || lc == oldCycle_) {
94 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
95  std::cerr << "\t\tPushing down antidep dest: " << mn_.toString()
96  << " failed lc: "<< lc << " ddgEC: " << ddgEC << std::endl;
97  std::cerr << "\t\tPushAntidepsDown seting to old bus: "
98  << mn_.toString() << " to bus "
99  << oldBus_->name() << std::endl;
100 #endif
101 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
102  assert(canAssign(oldCycle_, mn_, oldBus_, NULL, NULL, prologBus_));
103 #endif
104  assign(oldCycle_, mn_, oldBus_, NULL, NULL, prologBus_,
106  return false;
107  }
108  assert(lc != -1);
109  assign(lc, mn_);
110 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
111  std::cerr << "\t\tPushed antidep down: " << mn_.toString() << " bus: "
112  << mn_.move().bus().name() << std::endl;
113 #endif
114  return true;
115  }
116  return false;
117 }

References assert, BFOptimization::assign(), TTAProgram::Move::bus(), BFOptimization::canAssign(), BFOptimization::ddg(), DataDependenceGraph::earliestCycle(), BF2Scheduler::guardWriteNode(), TTAProgram::Move::isControlFlowMove(), lat_, DataDependenceGraph::latestCycle(), BF2Scheduler::maximumAllowedCycle(), BFUnscheduleMove::mn_, MoveNode::move(), TTAMachine::Component::name(), newLC_, BFUnscheduleMove::oldBus_, BFUnscheduleMove::oldCycle_, BFUnscheduleMove::oldImmWriteCycle_, BFUnscheduleMove::prologBus_, BFUnscheduleMove::prologImmWriteCycle_, BFOptimization::rmEC(), BFOptimization::rmLC(), BFOptimization::sched_, MoveNode::toString(), and BFUnscheduleMove::unscheduleOriginal().

Here is the call graph for this function:

Member Data Documentation

◆ lat_

int BFPushAntidepDown::lat_
private

Definition at line 56 of file BFPushAntidepDown.hh.

Referenced by operator()().

◆ newLC_

int BFPushAntidepDown::newLC_
private

Definition at line 57 of file BFPushAntidepDown.hh.

Referenced by operator()().


The documentation for this class was generated from the following files:
BFPushAntidepDown::newLC_
int newLC_
Definition: BFPushAntidepDown.hh:57
BFOptimization::assign
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)
Definition: BFOptimization.cc:103
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
MoveNode::toString
std::string toString() const
Definition: MoveNode.cc:576
BFUnscheduleMove::oldBus_
const TTAMachine::Bus * oldBus_
Definition: BFUnscheduleMove.hh:63
TTAProgram::Move::bus
const TTAMachine::Bus & bus() const
Definition: Move.cc:373
BFOptimization::rmEC
virtual int rmEC(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)
Definition: BFOptimization.cc:213
BFUnscheduleMove::oldCycle_
int oldCycle_
Definition: BFUnscheduleMove.hh:62
BFOptimization::sched_
BF2Scheduler & sched_
Definition: BFOptimization.hh:103
BFUnscheduleMove::mn_
MoveNode & mn_
Definition: BFUnscheduleMove.hh:61
BFUnscheduleMove::oldImmWriteCycle_
int oldImmWriteCycle_
Definition: BFUnscheduleMove.hh:65
assert
#define assert(condition)
Definition: Application.hh:86
BFRescheduleMove::BFRescheduleMove
BFRescheduleMove(BF2Scheduler &sched, MoveNode &mn)
Definition: BFRescheduleMove.hh:50
TTAProgram::Move::isControlFlowMove
bool isControlFlowMove() const
Definition: Move.cc:233
BFPushAntidepDown::lat_
int lat_
Definition: BFPushAntidepDown.hh:56
BFOptimization::ddg
DataDependenceGraph & ddg()
Definition: BFOptimization.cc:70
DataDependenceGraph::earliestCycle
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
Definition: DataDependenceGraph.cc:388
BFUnscheduleMove::unscheduleOriginal
void unscheduleOriginal()
Definition: BFUnscheduleMove.cc:47
MoveNode::move
TTAProgram::Move & move()
BFUnscheduleMove::prologBus_
const TTAMachine::Bus * prologBus_
Definition: BFUnscheduleMove.hh:64
BFOptimization::rmLC
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)
Definition: BFOptimization.cc:363
BF2Scheduler::guardWriteNode
MoveNode * guardWriteNode()
Definition: BF2Scheduler.hh:191
BF2Scheduler::maximumAllowedCycle
int maximumAllowedCycle() const
Definition: BF2Scheduler.hh:186
BFOptimization::canAssign
virtual bool canAssign(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, bool ignoreGWN=false)
Definition: BFOptimization.cc:495
BFUnscheduleMove::prologImmWriteCycle_
int prologImmWriteCycle_
Definition: BFUnscheduleMove.hh:66
DataDependenceGraph::latestCycle
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
Definition: DataDependenceGraph.cc:543