OpenASIP
2.0
|
#include <SequentialScheduler.hh>
Private Attributes | |
const TTAMachine::Machine * | targetMachine_ |
The target machine we are scheduling the program against. More... | |
SimpleResourceManager * | rm_ |
Resource Manager of the currently scheduled BB. More... | |
MoveNodeSelector * | selector_ |
Additional Inherited Members | |
Static Public Member Functions inherited from BasicBlockPass | |
static void | copyRMToBB (SimpleResourceManager &rm, TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, int lastCycle=-1) |
Static Public Member Functions inherited from ProcedurePass | |
static void | copyCfgToProcedure (TTAProgram::Procedure &procedure, ControlFlowGraph &cfg) |
static void | executeControlFlowGraphPass (TTAProgram::Procedure &procedure, const TTAMachine::Machine &targetmachine, ControlFlowGraphPass &cfgp) |
Static Public Member Functions inherited from ProgramPass | |
static void | executeProcedurePass (TTAProgram::Program &program, const TTAMachine::Machine &targetMachine, ProcedurePass &procedurePass) |
Protected Member Functions inherited from BasicBlockPass | |
void | ddgSnapshot (DataDependenceGraph *ddg, std::string &name, DataDependenceGraph::DumpFileFormat format, bool final) |
virtual DataDependenceGraph * | createDDGFromBB (TTAProgram::BasicBlock &bb, const TTAMachine::Machine &mach) |
A class that implements the functionality of a basic block scheduler.
Schedules the program one basic block at a time. Does not fill delay slots if they couldn't be filled with the basic block's contents itself (no instruction importing).
Definition at line 56 of file SequentialScheduler.hh.
SequentialScheduler::SequentialScheduler | ( | InterPassData & | data | ) |
Constructs the sequential scheduler.
data | Interpass data |
Definition at line 78 of file SequentialScheduler.cc.
|
virtual |
|
private |
Definition at line 701 of file SequentialScheduler.cc.
References TTAProgram::Procedure::clear(), TTAProgram::Instruction::copy(), TTAProgram::CodeSnippet::firstInstruction(), TTAProgram::InstructionReferenceManager::hasReference(), TTAProgram::CodeSnippet::instructionAt(), TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::CodeSnippet::instructionCount(), TTAProgram::Program::instructionReferenceManager(), TTAProgram::CodeSnippet::isInProgram(), TTAProgram::Program::lastProcedure(), TTAProgram::Program::moveProcedure(), TTAProgram::Program::nextProcedure(), TTAProgram::CodeSnippet::parent(), and TTAProgram::InstructionReferenceManager::replace().
Referenced by handleProcedure().
|
private |
Splits a procedure into basic blocks.
Definition at line 648 of file SequentialScheduler.cc.
References TTAProgram::CodeSnippet::add(), TTAProgram::Instruction::address(), assert, TTAProgram::Instruction::copy(), TTAProgram::Instruction::hasControlFlowMove(), TTAProgram::InstructionReferenceManager::hasReference(), TTAProgram::CodeSnippet::instructionAtIndex(), TTAProgram::CodeSnippet::instructionCount(), TTAProgram::Program::instructionReferenceManager(), TTAProgram::Address::location(), and TTAProgram::CodeSnippet::parent().
Referenced by handleProcedure().
|
virtual |
Schedules a single basic block.
bb | The basic block to schedule. |
targetMachine | The target machine. |
Exception | several TCE exceptions can be thrown in case of a scheduling error. |
Reimplemented from BasicBlockPass.
Definition at line 101 of file SequentialScheduler.cc.
References __func__, SequentialMoveNodeSelector::candidates(), BasicBlockPass::copyRMToBB(), SimpleResourceManager::createRM(), TTAProgram::Move::destination(), SimpleResourceManager::disposeRM(), TTAProgram::CodeSnippet::instructionCount(), MoveNode::isOperationMove(), TTAProgram::Terminal::isRA(), MoveNodeGroup::isScheduled(), MoveNode::move(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), SequentialMoveNodeSelector::notifyScheduled(), rm_, scheduleMove(), scheduleOperation(), scheduleRRMove(), selector_, targetMachine_, and MoveNode::toString().
Referenced by handleProcedure().
|
virtual |
Schedules a procedure.
The original procedure is modified during scheduling.
procedure | The procedure to schedule. |
targetMachine | The target machine. |
Exception | In case of an error during scheduling. The exception type can be any subtype of Exception. |
Reimplemented from ProcedurePass.
Definition at line 599 of file SequentialScheduler.cc.
References copyBasicBlocksToProcedure(), createBasicBlocks(), handleBasicBlock(), TTAProgram::Program::instructionReferenceManager(), and TTAProgram::CodeSnippet::parent().
|
virtual |
Optional longer description of the pass.
This description can include usage instructions, details of choice of algorithmic details, etc.
Reimplemented from SchedulerPass.
Definition at line 640 of file SequentialScheduler.cc.
|
private |
Schedules the (possible) temporary register copy moves (due to missing connectivity) preceeding the given input move.
operandMove | The move of which temp moves to schedule. |
regCopies | Temp register copy moves associated with operandMove |
Definition at line 479 of file SequentialScheduler.cc.
References MapTools::containsKey(), RegisterCopyAdder::AddedRegisterCopies::count_, RegisterCopyAdder::AddedRegisterCopies::operandCopies_, and scheduleMove().
Referenced by scheduleOperandWrites().
|
private |
Schedules a single move to the earliest possible cycle, taking in account the resource constraints, and latencies in producing source values.
This method assumes the move is possible to schedule with regards to connectivity and resources. Short immediates are converted to long immediates when needed.
move | The move to schedule. |
earliestCycle | The earliest cycle to try. |
Definition at line 342 of file SequentialScheduler.cc.
References __func__, MoveNodeSet::addMoveNode(), TTAProgram::ProgramAnnotation::ANN_REQUIRES_LIMM, TTAProgram::ProgramAnnotation::ANN_STACKFRAME_PROCEDURE_RETURN, SimpleResourceManager::assign(), SimpleResourceManager::canTransportImmediate(), TTAMachine::Machine::controlUnit(), SimpleResourceManager::earliestCycle(), TTAMachine::ControlUnit::globalGuardLatency(), TTAProgram::MoveGuard::guard(), TTAProgram::Move::guard(), TTAMachine::RegisterFile::guardLatency(), TTAProgram::AnnotatedInstructionElement::hasAnnotations(), MoveNode::isDestinationOperation(), TTAProgram::Move::isReturn(), MoveNode::isScheduled(), MoveNode::isSourceConstant(), TTAProgram::Move::isUnconditional(), SimpleResourceManager::largestCycle(), MoveNode::move(), TTAMachine::RegisterGuard::registerFile(), rm_, TTAProgram::AnnotatedInstructionElement::setAnnotation(), targetMachine_, and MoveNode::toString().
Referenced by handleBasicBlock(), scheduleInputOperandTempMoves(), scheduleOperandWrites(), scheduleResultReads(), scheduleResultTempMoves(), scheduleRRMove(), and scheduleRRTempMoves().
|
private |
Schedules operand moves of an operation execution.
Assumes the given MoveNodeGroup contains all moves in the operation execution. Also assumes that all inputs to the MoveNodeGroup have been scheduled. Exception to this are the possible temporary register copies inserted before the operand move due to missing connectivity. If found, the temp moves are scheduled atomically with the operand move. Assumes top-down scheduling.
cycle | Earliest cycle for starting scheduling of operands |
moves | Moves of the operation execution. |
Definition at line 223 of file SequentialScheduler.cc.
References assert, MoveNode::cycle(), TTAProgram::Move::destination(), MoveNode::destinationOperation(), ProgramOperation::inputMoveCount(), MoveNode::isDestinationOperation(), TTAProgram::Terminal::isFUPort(), MoveNode::isScheduled(), TTAProgram::Terminal::isTriggering(), MoveNode::move(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), scheduleInputOperandTempMoves(), scheduleMove(), unschedule(), and unscheduleInputOperandTempMoves().
Referenced by scheduleOperation().
|
private |
Schedules moves in a single operation execution.
Assumes the given MoveNodeGroup contains all moves in the operation execution. Also assumes that all inputs to the MoveNodeGroup have been scheduled.
moves | Moves of the operation execution. |
Definition at line 163 of file SequentialScheduler.cc.
References __func__, RegisterCopyAdder::addMinimumRegisterCopies(), MoveNodeSet::addMoveNode(), RegisterCopyAdder::AddedRegisterCopies::count_, MoveNode::destinationOperation(), SchedulerPass::interPassData(), MoveNode::isSourceOperation(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), rm_, scheduleOperandWrites(), scheduleResultReads(), selector_, MoveNode::sourceOperation(), targetMachine_, and MoveNodeGroup::toString().
Referenced by handleBasicBlock().
|
private |
Schedules the result read moves of an operation execution.
Assumes the given MoveNodeGroup contains all moves in the operation execution. Also assumes that all operand moves have been scheduled.
moves | Moves of the operation execution. |
Definition at line 278 of file SequentialScheduler.cc.
References __func__, MoveNode::earliestResultReadCycle(), MoveNode::isScheduled(), MoveNode::isSourceOperation(), MoveNodeGroup::node(), MoveNodeGroup::nodeCount(), scheduleMove(), scheduleResultTempMoves(), and MoveNode::toString().
Referenced by scheduleOperation().
|
private |
Schedules the (possible) temporary register copy moves (due to missing connectivity) succeeding the given result move.
operandMove | The move of which temp moves to schedule. |
cycle | of the last actual result move |
Definition at line 537 of file SequentialScheduler.cc.
References MapTools::containsKey(), RegisterCopyAdder::AddedRegisterCopies::count_, RegisterCopyAdder::AddedRegisterCopies::resultCopies_, and scheduleMove().
Referenced by scheduleResultReads().
|
private |
Schedules a RR move and its temp compies.
cycle | The earliest cycle to try. |
moveNode | R-R Move to schedule. |
Definition at line 315 of file SequentialScheduler.cc.
References RegisterCopyAdder::addRegisterCopiesToRRMove(), SchedulerPass::interPassData(), rm_, scheduleMove(), scheduleRRTempMoves(), and selector_.
Referenced by handleBasicBlock().
|
private |
Schedules the (possible) temporary register copy moves (due to missing connectivity) succeeding the given RR move.
The function recursively goes through all the temporary moves added to the given RR move.
cycle | Earliest cycle for starting scheduling |
regToRegMove | A temp move whose successor has to be scheduled. |
lastUse | Recursive function parameter, it should be set as 0 for the first function call. |
Definition at line 450 of file SequentialScheduler.cc.
References MapTools::containsKey(), RegisterCopyAdder::AddedRegisterCopies::count_, RegisterCopyAdder::AddedRegisterCopies::operandCopies_, and scheduleMove().
Referenced by scheduleRRMove().
|
virtual |
A short description of the pass, usually the optimization name, such as "basic block scheduler".
Implements SchedulerPass.
Definition at line 627 of file SequentialScheduler.cc.
|
private |
Unschedules the given move.
Also restores a possible short immediate source in case it was converted to a long immediate register read during scheduling.
moveNode | Move to unschedule. |
Definition at line 566 of file SequentialScheduler.cc.
References __func__, TTAProgram::ProgramAnnotation::ANN_REQUIRES_LIMM, TTAProgram::AnnotatedInstructionElement::hasAnnotations(), MoveNode::isPlaced(), MoveNode::isScheduled(), MoveNode::move(), TTAProgram::AnnotatedInstructionElement::removeAnnotations(), rm_, MoveNode::toString(), and SimpleResourceManager::unassign().
Referenced by scheduleOperandWrites(), and unscheduleInputOperandTempMoves().
|
private |
Unschedules the (possible) temporary register copy moves (due to missing connectivity) preceeding the given input move.
operandMove | Move to unschedule. |
regCopies | Temp register copy moves associated with operandMove |
Definition at line 511 of file SequentialScheduler.cc.
References MapTools::containsKey(), RegisterCopyAdder::AddedRegisterCopies::count_, RegisterCopyAdder::AddedRegisterCopies::operandCopies_, and unschedule().
Referenced by scheduleOperandWrites().
|
private |
Resource Manager of the currently scheduled BB.
Definition at line 124 of file SequentialScheduler.hh.
Referenced by handleBasicBlock(), scheduleMove(), scheduleOperation(), scheduleRRMove(), and unschedule().
|
private |
Definition at line 126 of file SequentialScheduler.hh.
Referenced by handleBasicBlock(), scheduleOperation(), and scheduleRRMove().
|
private |
The target machine we are scheduling the program against.
Definition at line 122 of file SequentialScheduler.hh.
Referenced by handleBasicBlock(), scheduleMove(), and scheduleOperation().