OpenASIP 2.2
Loading...
Searching...
No Matches
DataInstructionAddressDef.cc
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 DataInstructionAddressDef.cc
26 *
27 * Implementation of DataInstructionAddressDef class.
28 *
29 * @author Mikael Lepistö 2006 (mikael.lepisto-no.spam-tut.fi)
30 * @note rating: red
31 */
32
35#include "Instruction.hh"
36#include "Address.hh"
37
38namespace TTAProgram {
39
40/**
41 * Creates data area definition containing reference to an instruction.
42 *
43 * @param start Starting address of definition.
44 * @param size Number of MAUs that area represents.
45 * @param dest Instruction which is referred by the data definition.
46 */
48 Address start, int size, InstructionReference& dest, bool littleEndian) :
49 DataDefinition(start, size, littleEndian), dest_(dest) {
50}
51
52/**
53 * Nothing to free.
54 */
57
58/**
59 * Returns true, class defines always initialized data area.
60 *
61 * @return Always true.
62 */
63bool
65 return true;
66}
67
68/**
69 * Returns true, class contains always address reference.
70 *
71 * @return Always true.
72 */
73bool
75 return true;
76}
77
78/**
79 * Returns true if init data of definition contains an instruction address.
80 *
81 * @return True if init data of definition contains an instruction address.
82 */
83bool
87
88/**
89 * Returns destination address, where to intialization value refers.
90 *
91 * @return Destination address of initialized data area.
92 */
97
98/**
99 * Copying of this class is *not* allowed.
100
101 * This class can't be copied, because InstructionReferece cannot
102 * be copied correctly.
103 *
104 * @return Throws always an exception.
105 */
108 throw WrongSubclass(
109 __FILE__, __LINE__, __func__,
110 "DataInstructionAddress definition cannot be copied.");
111}
112
113}
#define __func__
DataInstructionAddressDef(Address start, int size, InstructionReference &dest, bool littleEndian)
InstructionReference dest_
Destination instruction of data area.
Address address() const