OpenASIP 2.2
Loading...
Searching...
No Matches
SequentialScheduler.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file SequentialScheduler.hh
26 *
27 * Declaration of SequentialScheduler class.
28 *
29 * @author Heikki Kultala 2008 (hkultala-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_SEQUENTIAL_SCHEDULER_HH
34#define TTA_SEQUENTIAL_SCHEDULER_HH
35
36#include <vector>
37
38#include "BasicBlockPass.hh"
40#include "ProcedurePass.hh"
41#include "ProgramPass.hh"
42#include "RegisterCopyAdder.hh"
43
44class BasicBlockNode;
46class MoveNodeGroup;
48
49/**
50 * A class that implements the functionality of a basic block scheduler.
51 *
52 * Schedules the program one basic block at a time. Does not fill delay slots
53 * if they couldn't be filled with the basic block's contents itself (no
54 * instruction importing).
55 */
57 public BasicBlockPass,
59 public ProcedurePass,
60 public ProgramPass {
61public:
63 InterPassData& data);
64
65 virtual ~SequentialScheduler();
66
67 void handleProcedure(
68 TTAProgram::Procedure& procedure,
69 const TTAMachine::Machine& targetMachine);
70
71 virtual void handleBasicBlock(
72 TTAProgram::BasicBlock& bb, const TTAMachine::Machine& targetMachine,
74 BasicBlockNode* bbn = NULL);
75 virtual std::string shortDescription() const;
76 virtual std::string longDescription() const;
77
78private:
79 int scheduleOperation(MoveNodeGroup& moves, int earliestCycle);
80
82 int cycle, MoveNodeGroup& moves,
84
86 int triggerCycle, MoveNodeGroup& moves,
88
89 int scheduleRRMove(int cycle, MoveNode& moveNode);
90
92 int cycle, MoveNode& regToRegMove,
94
95 int scheduleMove(int earliestCycle, MoveNode& move);
96
98 int cycle, MoveNode& operandMove,
100
102 MoveNode& operandMove,
104
106 int cycle, MoveNode& resultMove,
108
111 std::vector<TTAProgram::BasicBlock*>& basicBlocks,
112 std::vector<int>& bbAddresses);
113
116 std::vector<TTAProgram::BasicBlock*>& basicBlocks,
117 std::vector<int>& bbAddresses);
118
119 void unschedule(MoveNode& moveNode);
120
121 /// The target machine we are scheduling the program against.
123 /// Resource Manager of the currently scheduled BB.
125
127};
128
129#endif
int scheduleInputOperandTempMoves(int cycle, MoveNode &operandMove, RegisterCopyAdder::AddedRegisterCopies &regCopies)
void createBasicBlocks(TTAProgram::Procedure &cs, std::vector< TTAProgram::BasicBlock * > &basicBlocks, std::vector< int > &bbAddresses)
void handleProcedure(TTAProgram::Procedure &procedure, const TTAMachine::Machine &targetMachine)
void unschedule(MoveNode &moveNode)
int scheduleMove(int earliestCycle, MoveNode &move)
SimpleResourceManager * rm_
Resource Manager of the currently scheduled BB.
int scheduleResultTempMoves(int cycle, MoveNode &resultMove, RegisterCopyAdder::AddedRegisterCopies &regCopies)
int scheduleRRMove(int cycle, MoveNode &moveNode)
int scheduleOperandWrites(int cycle, MoveNodeGroup &moves, RegisterCopyAdder::AddedRegisterCopies &regCopies)
int scheduleRRTempMoves(int cycle, MoveNode &regToRegMove, RegisterCopyAdder::AddedRegisterCopies &regCopies)
virtual void handleBasicBlock(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, BasicBlockNode *bbn=NULL)
virtual std::string shortDescription() const
int scheduleOperation(MoveNodeGroup &moves, int earliestCycle)
int scheduleResultReads(int triggerCycle, MoveNodeGroup &moves, RegisterCopyAdder::AddedRegisterCopies &regCopies)
virtual std::string longDescription() const
MoveNodeSelector * selector_
void copyBasicBlocksToProcedure(TTAProgram::Procedure &cs, std::vector< TTAProgram::BasicBlock * > &basicBlocks, std::vector< int > &bbAddresses)
void unscheduleInputOperandTempMoves(MoveNode &operandMove, RegisterCopyAdder::AddedRegisterCopies &regCopies)
const TTAMachine::Machine * targetMachine_
The target machine we are scheduling the program against.