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

#include <BFRescheduleResultClose.hh>

Inheritance diagram for BFRescheduleResultClose:
Inheritance graph
Collaboration diagram for BFRescheduleResultClose:
Collaboration graph

Public Member Functions

 BFRescheduleResultClose (BF2Scheduler &sched, MoveNode &result, int ec)
 
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

MoveNoderesult_
 
int ec_
 

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)
 
virtual void undoOnlyMe ()
 
- 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 44 of file BFRescheduleResultClose.hh.

Constructor & Destructor Documentation

◆ BFRescheduleResultClose()

BFRescheduleResultClose::BFRescheduleResultClose ( BF2Scheduler sched,
MoveNode result,
int  ec 
)
inline

Definition at line 47 of file BFRescheduleResultClose.hh.

48  :
49  BFOptimization(sched), result_(result), ec_(ec) {}

Member Function Documentation

◆ operator()()

bool BFRescheduleResultClose::operator() ( )
virtual

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

Implements Reversible.

Definition at line 42 of file BFRescheduleResultClose.cc.

42  {
43  if (result_.move().isControlFlowMove()) {
44  return false;
45  }
46  int originalCycle = result_.cycle();
47 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
48  std::cerr << "\tPushing result close: " << result_.toString() << std::endl;
49 #endif
51  if (!(runPreChild(unsched))) {
52  return false;
53  }
54 
55  BFScheduleTD* td = new BFScheduleTD(sched_, result_, ec_, false);
56  if ((!runPreChild(td)) || result_.cycle() == originalCycle) {
57  undo();
58  return false;
59  }
60 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
61  std::cerr << "\tPushed result close: " << result_.toString() << std::endl;
62 #endif
63  auto succs = new BFRescheduleSuccessorsClose(sched_, result_);
64  runPostChild(succs);
65  return true;
66 }

References MoveNode::cycle(), ec_, TTAProgram::Move::isControlFlowMove(), MoveNode::move(), result_, Reversible::runPostChild(), Reversible::runPreChild(), BFOptimization::sched_, MoveNode::toString(), and Reversible::undo().

Here is the call graph for this function:

Member Data Documentation

◆ ec_

int BFRescheduleResultClose::ec_
private

Definition at line 54 of file BFRescheduleResultClose.hh.

Referenced by operator()().

◆ result_

MoveNode& BFRescheduleResultClose::result_
private

Definition at line 53 of file BFRescheduleResultClose.hh.

Referenced by operator()().


The documentation for this class was generated from the following files:
MoveNode::toString
std::string toString() const
Definition: MoveNode.cc:576
BFOptimization::sched_
BF2Scheduler & sched_
Definition: BFOptimization.hh:103
MoveNode::cycle
int cycle() const
Definition: MoveNode.cc:421
TTAProgram::Move::isControlFlowMove
bool isControlFlowMove() const
Definition: Move.cc:233
Reversible::undo
virtual void undo()
Definition: Reversible.cc:69
BFOptimization::BFOptimization
BFOptimization(BF2Scheduler &sched)
Definition: BFOptimization.hh:75
MoveNode::move
TTAProgram::Move & move()
BFScheduleTD
Definition: BFScheduleTD.hh:43
Reversible::runPreChild
bool runPreChild(Reversible *preChild)
Definition: Reversible.cc:127
BFUnscheduleMove
Definition: BFUnscheduleMove.hh:48
Reversible::runPostChild
bool runPostChild(Reversible *preChild)
Definition: Reversible.cc:139
BFRescheduleSuccessorsClose
Definition: BFRescheduleSuccessorsClose.hh:47
BFRescheduleResultClose::result_
MoveNode & result_
Definition: BFRescheduleResultClose.hh:53
BFRescheduleResultClose::ec_
int ec_
Definition: BFRescheduleResultClose.hh:54