OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
BFScheduleTD Class Reference

#include <BFScheduleTD.hh>

Inheritance diagram for BFScheduleTD:
Inheritance graph
Collaboration diagram for BFScheduleTD:
Collaboration graph

Public Member Functions

 BFScheduleTD (BF2Scheduler &sched, MoveNode &mn, int ec, bool allowLateBypass)
 
virtual bool operator() ()
 
virtual void undoOnlyMe ()
 
- Public Member Functions inherited from BFScheduleMove
 BFScheduleMove (BF2Scheduler &sched, MoveNode &mn)
 
- 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 ec_
 
bool allowLateBypass_
 
bool createdCopy_
 

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 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 BFScheduleMove
MoveNodemn_
 
bool createdPrologMove_
 
- Protected Attributes inherited from BFOptimization
BF2Schedulersched_
 
- Protected Attributes inherited from Reversible
std::stack< Reversible * > preChildren_
 
std::stack< Reversible * > postChildren_
 
- Static Protected Attributes inherited from BFOptimization
static std::map< MoveNode *, MoveNode *, MoveNode::ComparatorprologMoves_
 

Detailed Description

Definition at line 43 of file BFScheduleTD.hh.

Constructor & Destructor Documentation

◆ BFScheduleTD()

BFScheduleTD::BFScheduleTD ( BF2Scheduler sched,
MoveNode mn,
int  ec,
bool  allowLateBypass 
)
inline

Definition at line 46 of file BFScheduleTD.hh.

48 :
49 BFScheduleMove(sched, mn), ec_(ec),
50 allowLateBypass_(allowLateBypass),
51 createdCopy_(false) {}
bool allowLateBypass_

Member Function Documentation

◆ operator()()

bool BFScheduleTD::operator() ( )
virtual

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

Implements Reversible.

Definition at line 56 of file BFScheduleTD.cc.

56 {
57#ifdef DEBUG_BUBBLEFISH_SCHEDULER
58 std::cerr << "\tPerforming BFSchduleTD for: " << mn_.toString() <<
59 " ec limit: " << ec_ << std::endl;
60#endif
63 mn_.move().setBus(UniversalMachine::instance().universalBus());
64 }
65
68 if (runPreChild(lbp)) {
69 if (lbp->removedSource()) {
70 return true;
71 }
72 }
73 }
74
75
76 BFRegCopy* regCopyBefore = NULL;
77 BFRegCopy* regCopyAfter = NULL;
78 if (!canBeScheduled(mn_)) {
79 if (/*isRegCopyAfter_ || */ mn_.isSourceOperation()) {
80 regCopyAfter = new BFRegCopyAfter(sched_,mn_, INT_MAX);
81 } else {
82 regCopyBefore = new BFRegCopyBefore(sched_,mn_, INT_MAX);
83 if (!runPreChild(regCopyBefore)) {
84 return false;
85 }
86 }
87 }
88
89 int ddglc = std::min(sched_.maximumAllowedCycle(),
90 ddg().latestCycle(mn_, ii(), false, false));
91 int ddgec = std::max(ec_,
92 ddg().earliestCycle(mn_, ii(), false, false));
93 int rmec = rmEC(ddgec, mn_);
94#ifdef DEBUG_BUBBLEFISH_SCHEDULER
95 std::cerr << "\t\tDDG lc: " << ddglc << std::endl;
96 std::cerr << "\t\tDDG ec: " << ddgec << std::endl;
97 std::cerr << "\t\tRM ec: " << rmec << std::endl;
98#endif
99 if (rmec != -1 && ddglc >= rmec) {
100 createdCopy_ = assign(rmec, mn_);
101 if (regCopyAfter != NULL) {
102 if (!runPostChild(regCopyAfter)) {
104 return false;
105 }
106 }
107#ifdef DEBUG_BUBBLEFISH_SCHEDULER
108 std::cerr << "\t\tTD Assigned ok:" << mn_.toString()
109 << " bus: " << mn_.move().bus().name() << std::endl;
110#endif
111 return true;
112 } else {
114 return false;
115 }
116}
#define assert(condition)
int maximumAllowedCycle() const
unsigned int ii() const
BF2Scheduler & sched_
DataDependenceGraph & ddg()
bool canBeScheduled(const MoveNode &mn)
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 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::string toString() const
Definition MoveNode.cc:576
TTAProgram::Move & move()
bool isSourceOperation() const
Definition MoveNode.cc:168
bool isScheduled() const
Definition MoveNode.cc:409
bool isDestinationVariable() const
Definition MoveNode.cc:264
bool runPostChild(Reversible *preChild)
void undoAndRemovePreChildren()
Definition Reversible.cc:80
bool runPreChild(Reversible *preChild)
virtual TCEString name() const
void setBus(const TTAMachine::Bus &bus)
Definition Move.cc:383
const TTAMachine::Bus & bus() const
Definition Move.cc:373
static UniversalMachine & instance()
TTAMachine::Bus & universalBus() const

References allowLateBypass_, assert, BFOptimization::assign(), TTAProgram::Move::bus(), BFOptimization::canBeScheduled(), createdCopy_, BFOptimization::ddg(), ec_, BFOptimization::ii(), UniversalMachine::instance(), MoveNode::isDestinationVariable(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), BF2Scheduler::maximumAllowedCycle(), BFScheduleMove::mn_, MoveNode::move(), TTAMachine::Component::name(), BFLateBypasses::removedSource(), BFOptimization::rmEC(), Reversible::runPostChild(), Reversible::runPreChild(), BFOptimization::sched_, TTAProgram::Move::setBus(), MoveNode::toString(), Reversible::undoAndRemovePreChildren(), and UniversalMachine::universalBus().

Here is the call graph for this function:

◆ undoOnlyMe()

void BFScheduleTD::undoOnlyMe ( )
virtual

Undoes the operations done by this class but not children. This method should be overloaded by most derived classes.

Reimplemented from BFScheduleMove.

Definition at line 119 of file BFScheduleTD.cc.

119 {
120#ifdef DEBUG_BUBBLEFISH_SCHEDULER
121 std::cerr << "unassign td: " << mn_.toString() << std::endl;
122#endif
123 if (mn_.isScheduled()) {
125 }
127 mn_.move().setBus(UniversalMachine::instance().universalBus());
128 }
129}
virtual void unassign(MoveNode &mn, bool disposePrologCopy=true)

References TTAProgram::Move::bus(), createdCopy_, UniversalMachine::instance(), MoveNode::isScheduled(), BFScheduleMove::mn_, MoveNode::move(), TTAProgram::Move::setBus(), MoveNode::toString(), BFOptimization::unassign(), and UniversalMachine::universalBus().

Here is the call graph for this function:

Member Data Documentation

◆ allowLateBypass_

bool BFScheduleTD::allowLateBypass_
private

Definition at line 57 of file BFScheduleTD.hh.

Referenced by operator()().

◆ createdCopy_

bool BFScheduleTD::createdCopy_
private

Definition at line 58 of file BFScheduleTD.hh.

Referenced by operator()(), and undoOnlyMe().

◆ ec_

int BFScheduleTD::ec_
private

Definition at line 56 of file BFScheduleTD.hh.

Referenced by operator()().


The documentation for this class was generated from the following files: