OpenASIP 2.2
Loading...
Searching...
No Matches
Procedure.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 Procedure.hh
26 *
27 * Declaration of Procedure class.
28 *
29 * @author Ari Metsähalme 2005 (ari.metsahalme-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_PROCEDURE_HH
34#define TTA_PROCEDURE_HH
35
36#include <vector>
37
38#include "TCEString.hh"
39#include "Exception.hh"
40#include "Address.hh"
41#include "CodeSnippet.hh"
42#include "Application.hh"
43
44class TCEString;
45
46namespace TTAProgram {
47
48class Instruction;
49class Program;
50
51
52/**
53 * Represents a TTA procedure.
54 */
55class Procedure : public CodeSnippet {
56public:
58 const TCEString& name,
59 const TTAMachine::AddressSpace& space);
61 const TCEString& name,
62 const TTAMachine::AddressSpace& space,
63 UIntWord startLocation);
64 virtual ~Procedure();
65
66 TCEString name() const { return name_; }
67
68 int alignment() const;
69
70 Address address(const Instruction& ins) const;
71
72 void
74 abortWithError("Not Implemented yet.");
75 }
76
77 void add(Instruction* ins);
78 void insertAfter(const Instruction& pos, Instruction* ins);
79 void insertBefore(const Instruction& pos, Instruction* ins);
80
81 void clear();
82
85
86 void remove(Instruction& ins);
87
88 CodeSnippet* copy() const;
89
90private:
91 /// Copying not allowed.
93 /// Assignment not allowed.
95
96 /// The name of the procedure.
98 /// The alignment of instructions.
100 /// The default alignment of instructions.
102};
103
104#include "Procedure.icc"
105
106}
107
108#endif
#define abortWithError(message)
Word UIntWord
Definition BaseType.hh:144
virtual void insertAfter(const Instruction &pos, Instruction *ins)
virtual void insertBefore(const Instruction &pos, Instruction *ins)
void add(Instruction *ins)
Definition Procedure.cc:160
int alignment() const
Definition Procedure.cc:89
void addFront(Instruction *)
Definition Procedure.hh:73
CodeSnippet * copy() const
Definition Procedure.cc:137
Address address(const Instruction &ins) const
Definition Procedure.cc:101
Procedure(const Procedure &)
Copying not allowed.
Procedure & operator=(const Procedure &)
Assignment not allowed.
TCEString name() const
Definition Procedure.hh:66
int alignment_
The alignment of instructions.
Definition Procedure.hh:99
void remove(Instruction &ins)
Definition Procedure.cc:297
const TCEString name_
The name of the procedure.
Definition Procedure.hh:97
void insertAfter(const Instruction &pos, Instruction *ins)
Definition Procedure.cc:193
void insertBefore(const Instruction &pos, Instruction *ins)
Definition Procedure.cc:242
static const int INSTRUCTION_INDEX_ALIGNMENT
The default alignment of instructions.
Definition Procedure.hh:101