OpenASIP  2.0
BasicBlockPass.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 BasicBlockPass.hh
26  *
27  * Declaration of BasicBlockPass interface.
28  *
29  * @author Pekka Jääskeläinen 2007 (pjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_BB_PASS_HH
34 #define TTA_BB_PASS_HH
35 
36 #include "Exception.hh"
37 #include "SchedulerPass.hh"
39 
40 class BasicBlockNode;
41 class DDGPass;
44 
45 namespace TTAProgram {
46  class BasicBlock;
47 }
48 
49 namespace TTAMachine {
50  class Machine;
51 }
52 
53 namespace TTAProgram {
54  class InstructionReferenceManager;
55 }
56 
57 /**
58  * Interface for scheduler passes that handle basic blocks.
59  */
60 class BasicBlockPass : public SchedulerPass {
61 public:
63  virtual ~BasicBlockPass();
64 
65  virtual void handleBasicBlock(
66  TTAProgram::BasicBlock& basicBlock,
67  const TTAMachine::Machine& targetMachine,
69  BasicBlockNode* bbn = NULL);
70 
71  virtual void executeDDGPass(
72  TTAProgram::BasicBlock& bb, const TTAMachine::Machine& targetMachine,
74  std::vector<DDGPass*> ddgPasses, BasicBlockNode* bbn = NULL);
75 
76  virtual bool executeLoopPass(
77  TTAProgram::BasicBlock& bb, const TTAMachine::Machine& targetMachine,
79  std::vector<DDGPass*> ddgPasses, BasicBlockNode* bbn = NULL);
80 
81  static void copyRMToBB(
83  const TTAMachine::Machine& targetMachine,
84  TTAProgram::InstructionReferenceManager& irm, int lastCycle = -1);
85 
87 
88 protected:
89  void ddgSnapshot(
91  std::string& name,
93  bool final);
94 
95 
98 
99 private:
101 };
102 #endif
TTAProgram
Definition: Estimator.hh:65
SchedulerPass
Definition: SchedulerPass.hh:43
Exception.hh
BasicBlockPass::ddgBuilder_
DataDependenceGraphBuilder ddgBuilder_
Definition: BasicBlockPass.hh:100
SchedulerPass.hh
BasicBlockPass::ddgBuilder
virtual DataDependenceGraphBuilder & ddgBuilder()
Definition: BasicBlockPass.hh:86
BasicBlockPass::executeLoopPass
virtual bool executeLoopPass(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, std::vector< DDGPass * > ddgPasses, BasicBlockNode *bbn=NULL)
Definition: BasicBlockPass.cc:152
BasicBlockPass::~BasicBlockPass
virtual ~BasicBlockPass()
Definition: BasicBlockPass.cc:58
BasicBlockPass
Definition: BasicBlockPass.hh:60
DataDependenceGraphBuilder.hh
BasicBlockPass::handleBasicBlock
virtual void handleBasicBlock(TTAProgram::BasicBlock &basicBlock, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, BasicBlockNode *bbn=NULL)
Definition: BasicBlockPass.cc:79
BasicBlockPass::executeDDGPass
virtual void executeDDGPass(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, std::vector< DDGPass * > ddgPasses, BasicBlockNode *bbn=NULL)
Definition: BasicBlockPass.cc:101
BasicBlockNode
Definition: BasicBlockNode.hh:64
InterPassData
Definition: InterPassData.hh:48
BasicBlockPass::BasicBlockPass
BasicBlockPass(InterPassData &data)
Definition: BasicBlockPass.cc:51
BasicBlockPass::copyRMToBB
static void copyRMToBB(SimpleResourceManager &rm, TTAProgram::BasicBlock &bb, const TTAMachine::Machine &targetMachine, TTAProgram::InstructionReferenceManager &irm, int lastCycle=-1)
Definition: BasicBlockPass.cc:213
TTAProgram::BasicBlock
Definition: BasicBlock.hh:85
DDGPass
Definition: DDGPass.hh:51
TTAProgram::InstructionReferenceManager
Definition: InstructionReferenceManager.hh:82
DataDependenceGraphBuilder
Definition: DataDependenceGraphBuilder.hh:70
DataDependenceGraph
Definition: DataDependenceGraph.hh:67
SimpleResourceManager
Definition: SimpleResourceManager.hh:58
BasicBlockPass::ddgSnapshot
void ddgSnapshot(DataDependenceGraph *ddg, std::string &name, DataDependenceGraph::DumpFileFormat format, bool final)
Definition: BasicBlockPass.cc:172
DataDependenceGraph::DumpFileFormat
DumpFileFormat
Definition: DataDependenceGraph.hh:85
TTAMachine
Definition: Assembler.hh:48
BasicBlockPass::createDDGFromBB
virtual DataDependenceGraph * createDDGFromBB(TTAProgram::BasicBlock &bb, const TTAMachine::Machine &mach)
Definition: BasicBlockPass.cc:302
TTAMachine::Machine
Definition: Machine.hh:73