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

#include <BFSchedulePreLoopShared.hh>

Inheritance diagram for BFSchedulePreLoopShared:
Inheritance graph
Collaboration diagram for BFSchedulePreLoopShared:
Collaboration graph

Public Member Functions

 BFSchedulePreLoopShared (BF2Scheduler &sched, MoveNode &originalMN)
 
bool operator() ()
 
void undoOnlyMe ()
 
- 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

MoveNodeoriginalMN_
 
MoveNodeprologMN_
 

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 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 38 of file BFSchedulePreLoopShared.hh.

Constructor & Destructor Documentation

◆ BFSchedulePreLoopShared()

BFSchedulePreLoopShared::BFSchedulePreLoopShared ( BF2Scheduler sched,
MoveNode originalMN 
)
inline

Definition at line 40 of file BFSchedulePreLoopShared.hh.

Member Function Documentation

◆ operator()()

bool BFSchedulePreLoopShared::operator() ( )
virtual

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

Implements Reversible.

Definition at line 43 of file BFSchedulePreLoopShared.cc.

43 {
44#ifdef DEBUG_BUBBLEFISH_SCHEDULER
45 std::cerr << "\tScheduling pre-loop-shared operand: "
47 << std::endl;
48#endif
49 auto a = duplicator().duplicateMoveNode(originalMN_, true, true);
50 prologMN_ = a.first;
51
52 // These should always be unconditional. Operand moves have
53 // no side effects, and nobody else uses the FU,
54 // and the value of the guard might change between the iterations
55 if (!prologMN_->move().isUnconditional()) {
56 prologMN_->move().setGuard(NULL);
57 }
58 if (prologMN_ == NULL) {
59#ifdef DEBUG_BUBBLEFISH_SCHEDULER
60 std::cerr << "\t\tMissing prolog MN for the move. " << std::endl;
61#endif
62 return false;
63 }
64 int ddgLC = prologDDG()->latestCycle(*prologMN_);
65#ifdef DEBUG_BUBBLEFISH_SCHEDULER
66 std::cerr << "\tddg lc: " << ddgLC << std::endl;
67#endif
68 if (ddgLC < 0) {
70 return false;
71 }
72 int lastCycleOfProlog = rm().initiationInterval()-1+
74 int rmlc = prologRM()->latestCycle(
75 std::min(ddgLC, lastCycleOfProlog), *prologMN_);
76#ifdef DEBUG_BUBBLEFISH_SCHEDULER
77 std::cerr << "\trmlc: " << rmlc << std::endl;
78#endif
79 if (rmlc < 0) {
81 return false;
82 }
83 prologRM()->assign(rmlc, *prologMN_);
84#ifdef DEBUG_BUBBLEFISH_SCHEDULER
85 std::cerr << "scheduling of pre-loop opshare ok!"
86 << prologMN_->toString() << std::endl;
87#endif
88 return true;
89}
static const int PROLOG_CYCLE_BIAS
DataDependenceGraph * prologDDG()
SimpleResourceManager * prologRM() const
MoveNodeDuplicator & duplicator() const
SimpleResourceManager & rm() const
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
void disposeMoveNode(MoveNode *newMN)
std::pair< MoveNode *, bool > duplicateMoveNode(MoveNode &mn, bool addToDDG, bool ignoreSameBBBackEdges)
std::string toString() const
Definition MoveNode.cc:576
TTAProgram::Move & move()
virtual void assign(int cycle, MoveNode &node, const TTAMachine::Bus *bus=NULL, const TTAMachine::FunctionUnit *srcFU=NULL, const TTAMachine::FunctionUnit *dstFU=NULL, int immWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) override
virtual unsigned initiationInterval() const
virtual int latestCycle(MoveNode &node, const TTAMachine::Bus *bus=NULL, const TTAMachine::FunctionUnit *srcFU=NULL, const TTAMachine::FunctionUnit *dstFU=NULL, int immWriteCycle=-1, const TTAMachine::ImmediateUnit *immu=nullptr, int immRegIndex=-1) const override
bool isUnconditional() const
Definition Move.cc:154
void setGuard(MoveGuard *guard)
Definition Move.cc:360

References SimpleResourceManager::assign(), MoveNodeDuplicator::disposeMoveNode(), MoveNodeDuplicator::duplicateMoveNode(), BFOptimization::duplicator(), SimpleResourceManager::initiationInterval(), TTAProgram::Move::isUnconditional(), DataDependenceGraph::latestCycle(), SimpleResourceManager::latestCycle(), MoveNode::move(), originalMN_, BF2Scheduler::PROLOG_CYCLE_BIAS, BFOptimization::prologDDG(), prologMN_, BFOptimization::prologRM(), BFOptimization::rm(), TTAProgram::Move::setGuard(), and MoveNode::toString().

Here is the call graph for this function:

◆ undoOnlyMe()

void BFSchedulePreLoopShared::undoOnlyMe ( )
virtual

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

Reimplemented from Reversible.

Definition at line 91 of file BFSchedulePreLoopShared.cc.

91 {
92#ifdef DEBUG_BUBBLEFISH_SCHEDULER
93 std::cerr << "undoing scheudle of pre-loop opschare: "
94 << prologMN_->toString() << std::endl;
95#endif
97#ifdef DEBUG_BUBBLEFISH_SCHEDULER
98 std::cerr << "unassigned scheudle of pre-loop opschare: "
99 << prologMN_->toString() << std::endl;
100#endif
101
103}
virtual void unassign(MoveNode &node) override

References MoveNodeDuplicator::disposeMoveNode(), BFOptimization::duplicator(), prologMN_, BFOptimization::prologRM(), MoveNode::toString(), and SimpleResourceManager::unassign().

Here is the call graph for this function:

Member Data Documentation

◆ originalMN_

MoveNode& BFSchedulePreLoopShared::originalMN_
private

Definition at line 45 of file BFSchedulePreLoopShared.hh.

Referenced by operator()().

◆ prologMN_

MoveNode* BFSchedulePreLoopShared::prologMN_
private

Definition at line 46 of file BFSchedulePreLoopShared.hh.

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


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