OpenASIP  2.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BFShareOperandWithScheduled Class Reference

#include <BFShareOperandWithScheduled.hh>

Inheritance diagram for BFShareOperandWithScheduled:
Inheritance graph
Collaboration diagram for BFShareOperandWithScheduled:
Collaboration graph

Public Member Functions

 BFShareOperandWithScheduled (BF2Scheduler &sched, MoveNode &removed, MoveNode &scheduled)
 
virtual bool operator() ()
 
virtual ~BFShareOperandWithScheduled ()
 
- Public Member Functions inherited from BFShareOperand
 BFShareOperand (BF2Scheduler &sched, MoveNode &removed, MoveNode &shared)
 
virtual ~BFShareOperand ()
 
- 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 ()
 

Protected Member Functions

virtual void undoOnlyMe ()
 
- 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

int originalCycle_
 
const TTAMachine::BusoriginalRemovedBus_
 
const TTAMachine::BusprologBus_
 
int oldImmWriteCycle_
 
int prologImmWriteCycle_
 
const TTAMachine::ImmediateUnitimmu_
 
int immRegIndex_
 
- Protected Attributes inherited from BFShareOperand
MoveNoderemoved_
 
MoveNodeshared_
 
std::vector< ProgramOperationPtrops_
 
std::set< ProgramOperationPtrcreatedPrologPOs_
 
- Protected Attributes inherited from BFOptimization
BF2Schedulersched_
 
- Protected Attributes inherited from Reversible
std::stack< Reversible * > preChildren_
 
std::stack< Reversible * > postChildren_
 

Additional Inherited Members

- Static Public Member Functions inherited from BFOptimization
static void clearPrologMoves ()
 
static MoveNodegetSisterTrigger (const MoveNode &mn, const TTAMachine::Machine &mach)
 
- Static Protected Attributes inherited from BFOptimization
static std::map< MoveNode *, MoveNode *, MoveNode::ComparatorprologMoves_
 

Detailed Description

Definition at line 44 of file BFShareOperandWithScheduled.hh.

Constructor & Destructor Documentation

◆ BFShareOperandWithScheduled()

BFShareOperandWithScheduled::BFShareOperandWithScheduled ( BF2Scheduler sched,
MoveNode removed,
MoveNode scheduled 
)
inline

Definition at line 46 of file BFShareOperandWithScheduled.hh.

47  :
48  BFShareOperand(sched, removed, scheduled), originalCycle_(-1),
51  {}

◆ ~BFShareOperandWithScheduled()

virtual BFShareOperandWithScheduled::~BFShareOperandWithScheduled ( )
inlinevirtual

Definition at line 53 of file BFShareOperandWithScheduled.hh.

53 {}

Member Function Documentation

◆ operator()()

bool BFShareOperandWithScheduled::operator() ( )
virtual

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

Reimplemented from BFShareOperand.

Definition at line 48 of file BFShareOperandWithScheduled.cc.

48  {
51 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
52  std::cerr << "\t\t\t\t\tDestination operand index mismatch"
53  << std::endl;
54 #endif
55  return false;
56  }
57 
60 
65  }
66 
67  MoveNode* removedPrologMN = ii() ?
69  NULL;
70  if (removedPrologMN != NULL) {
71  prologBus_ = &removedPrologMN->move().bus();
72 
73  if (removedPrologMN->move().source().isImmediateRegister()) {
75  prologRM()->immediateWriteCycle(*removedPrologMN);
76  }
77 
78 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
79  std::cerr << "\t\t\t\tShareOpWithSched Saving prolog bus: "
80  << prologBus_->name() << std::endl;
81  std::cerr << "\t\t\t\t\tProlog move: " << removedPrologMN->toString()
82  << std::endl;
83 #endif
84  }
85 
86  unassign(removed_, false);
87  if (BFShareOperand::operator()()) {
90 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
91  std::cerr << "\t\t\t\t\tShared operand ok!" << std::endl;
92 #endif
93  return true;
94  } else {
98 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
99  std::cerr << "\t\t\t\t\tShare operand failed!" << std::endl;
100 #endif
101  return false;
102  }
103 }

References BFOptimization::assign(), TTAProgram::Move::bus(), MoveNode::cycle(), BFOptimization::ddg(), TTAProgram::Move::destination(), BoostGraph< GraphNode, GraphEdge >::dropNode(), BFOptimization::duplicator(), MoveNodeDuplicator::getMoveNode(), BFOptimization::ii(), TTAProgram::Terminal::immediateUnit(), SimpleResourceManager::immediateWriteCycle(), immRegIndex_, immu_, TTAProgram::Terminal::index(), TTAProgram::Terminal::isImmediateRegister(), MoveNode::move(), TTAMachine::Component::name(), BF2Scheduler::nodeAndCopyKilled(), BF2Scheduler::nodeResurrected(), oldImmWriteCycle_, TTAProgram::Terminal::operationIndex(), originalCycle_, originalRemovedBus_, prologBus_, prologImmWriteCycle_, BFOptimization::prologRM(), BFShareOperand::removed_, BoostGraph< GraphNode, GraphEdge >::restoreNodeFromParent(), BFOptimization::rm(), BFOptimization::sched_, BFShareOperand::shared_, TTAProgram::Move::source(), MoveNode::toString(), and BFOptimization::unassign().

Here is the call graph for this function:

◆ undoOnlyMe()

void BFShareOperandWithScheduled::undoOnlyMe ( )
protectedvirtual

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

Reimplemented from BFShareOperand.

Definition at line 105 of file BFShareOperandWithScheduled.cc.

105  {
106 #ifdef DEBUG_BUBBLEFISH_SCHEDULER
107  std::cerr << "\t\t\t\t\tUndoing operandshare: " << shared_.toString()
108  << std::endl;
109 #endif
115  immRegIndex_);
116 }

References BFOptimization::assign(), BFOptimization::ddg(), immRegIndex_, immu_, BF2Scheduler::nodeResurrected(), oldImmWriteCycle_, originalCycle_, originalRemovedBus_, prologBus_, prologImmWriteCycle_, BFShareOperand::removed_, BoostGraph< GraphNode, GraphEdge >::restoreNodeFromParent(), BFOptimization::sched_, BFShareOperand::shared_, MoveNode::toString(), and BFShareOperand::undoOnlyMe().

Here is the call graph for this function:

Member Data Documentation

◆ immRegIndex_

int BFShareOperandWithScheduled::immRegIndex_
protected

Definition at line 63 of file BFShareOperandWithScheduled.hh.

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

◆ immu_

const TTAMachine::ImmediateUnit* BFShareOperandWithScheduled::immu_
protected

Definition at line 62 of file BFShareOperandWithScheduled.hh.

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

◆ oldImmWriteCycle_

int BFShareOperandWithScheduled::oldImmWriteCycle_
protected

Definition at line 60 of file BFShareOperandWithScheduled.hh.

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

◆ originalCycle_

int BFShareOperandWithScheduled::originalCycle_
protected

Definition at line 56 of file BFShareOperandWithScheduled.hh.

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

◆ originalRemovedBus_

const TTAMachine::Bus* BFShareOperandWithScheduled::originalRemovedBus_
protected

Definition at line 57 of file BFShareOperandWithScheduled.hh.

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

◆ prologBus_

const TTAMachine::Bus* BFShareOperandWithScheduled::prologBus_
protected

Definition at line 58 of file BFShareOperandWithScheduled.hh.

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

◆ prologImmWriteCycle_

int BFShareOperandWithScheduled::prologImmWriteCycle_
protected

Definition at line 61 of file BFShareOperandWithScheduled.hh.

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


The documentation for this class was generated from the following files:
BFShareOperand::removed_
MoveNode & removed_
Definition: BFShareOperand.hh:52
SimpleResourceManager::immediateWriteCycle
virtual int immediateWriteCycle(const MoveNode &) const
Definition: SimpleResourceManager.cc:520
BFOptimization::unassign
virtual void unassign(MoveNode &mn, bool disposePrologCopy=true)
Definition: BFOptimization.cc:196
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
BFOptimization::duplicator
MoveNodeDuplicator & duplicator() const
Definition: BFOptimization.cc:87
MoveNode::toString
std::string toString() const
Definition: MoveNode.cc:576
TTAProgram::Terminal::index
virtual int index() const
Definition: Terminal.cc:274
BFOptimization::ii
unsigned int ii() const
Definition: BFOptimization.cc:85
TTAProgram::Move::destination
Terminal & destination() const
Definition: Move.cc:323
BFShareOperandWithScheduled::originalCycle_
int originalCycle_
Definition: BFShareOperandWithScheduled.hh:56
TTAProgram::Move::bus
const TTAMachine::Bus & bus() const
Definition: Move.cc:373
MoveNode
Definition: MoveNode.hh:65
BFShareOperandWithScheduled::oldImmWriteCycle_
int oldImmWriteCycle_
Definition: BFShareOperandWithScheduled.hh:60
BoostGraph::dropNode
virtual void dropNode(Node &node)
BFOptimization::sched_
BF2Scheduler & sched_
Definition: BFOptimization.hh:103
BFShareOperandWithScheduled::prologImmWriteCycle_
int prologImmWriteCycle_
Definition: BFShareOperandWithScheduled.hh:61
BFShareOperandWithScheduled::prologBus_
const TTAMachine::Bus * prologBus_
Definition: BFShareOperandWithScheduled.hh:58
TTAProgram::Terminal::isImmediateRegister
virtual bool isImmediateRegister() const
Definition: Terminal.cc:97
BFShareOperandWithScheduled::immRegIndex_
int immRegIndex_
Definition: BFShareOperandWithScheduled.hh:63
TTAProgram::Terminal::operationIndex
virtual int operationIndex() const
Definition: Terminal.cc:364
MoveNode::cycle
int cycle() const
Definition: MoveNode.cc:421
BFOptimization::prologRM
SimpleResourceManager * prologRM() const
Definition: BFOptimization.cc:77
BF2Scheduler::nodeAndCopyKilled
void nodeAndCopyKilled(MoveNode &mn)
Definition: BF2Scheduler.cc:803
BFShareOperand::BFShareOperand
BFShareOperand(BF2Scheduler &sched, MoveNode &removed, MoveNode &shared)
Definition: BFShareOperand.hh:45
TTAProgram::Terminal::immediateUnit
virtual const TTAMachine::ImmediateUnit & immediateUnit() const
Definition: Terminal.cc:240
BFOptimization::ddg
DataDependenceGraph & ddg()
Definition: BFOptimization.cc:70
BFShareOperandWithScheduled::originalRemovedBus_
const TTAMachine::Bus * originalRemovedBus_
Definition: BFShareOperandWithScheduled.hh:57
BFShareOperandWithScheduled::immu_
const TTAMachine::ImmediateUnit * immu_
Definition: BFShareOperandWithScheduled.hh:62
BFShareOperand::undoOnlyMe
virtual void undoOnlyMe()
Definition: BFShareOperand.cc:92
BFOptimization::rm
SimpleResourceManager & rm() const
Definition: BFOptimization.cc:76
BFShareOperand::shared_
MoveNode & shared_
Definition: BFShareOperand.hh:53
MoveNodeDuplicator::getMoveNode
MoveNode * getMoveNode(MoveNode &mn)
Definition: MoveNodeDuplicator.cc:85
MoveNode::move
TTAProgram::Move & move()
BF2Scheduler::nodeResurrected
void nodeResurrected(MoveNode &mn)
Definition: BF2Scheduler.cc:811
TTAProgram::Move::source
Terminal & source() const
Definition: Move.cc:302
BoostGraph::restoreNodeFromParent
void restoreNodeFromParent(GraphNode &node)