OpenASIP 2.2
Loading...
Searching...
No Matches
DataDefinition.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 DataDefinition.hh
26 *
27 * Declaration of DataDefinition class.
28 *
29 * @author Mikael Lepistö 2006 (mikael.lepisto-no.spam-tut.fi)
30 * @author Pekka Jääskeläinen 2006 (pekka.jaaskelainen-no.spam-tut.fi)
31 * @note rating: red
32 */
33
34#ifndef TTA_DATA_DEFINITION_HH
35#define TTA_DATA_DEFINITION_HH
36
37#include <vector>
38#include "BaseType.hh"
39#include "Exception.hh"
40#include "Address.hh"
41
42namespace TTAMachine {
43 class AddressSpace;
44}
45
46namespace TTAProgram {
47
48/**
49 * Describes characteristics of an initialized or uninitialized
50 * memory area.
51 */
53public:
55 Address start, int size, bool littleEndian,
56 MinimumAddressableUnit* initData = NULL, bool allZeros = false);
57
59 Address start, const std::vector<MinimumAddressableUnit>& initData,
60 bool littleEndian);
61
62 virtual ~DataDefinition();
63
64 virtual Address startAddress() const;
65 virtual void setStartAddress(Address start);
66
67 virtual bool isInitialized() const;
68 virtual MinimumAddressableUnit MAU(int index) const;
69 virtual int size() const;
70
71 virtual bool isAddress() const;
72 virtual bool isInstructionAddress() const;
73 virtual Address destinationAddress() const;
74 virtual void setDestinationAddress(Address dest);
75
76 virtual DataDefinition* copy() const;
77
78 bool isLittleEndian() const { return littleEndian_; }
79
80private:
81 /// Start address of definition.
83
84 /// Size of uninitialized data definition.
85 int size_;
86
87 /// Init data of definition.
88 std::vector<MinimumAddressableUnit>* data_;
89
90 /// Is all the data zeros? (In this case data_ is null)
92
94
95};
96
97}
98
99#endif
Word MinimumAddressableUnit
Type for storing a MAU (must be unsigned type!). This limits the maximum size of the simulated minimu...
Definition BaseType.hh:184
MinimumAddressableUnit MAU
virtual Address startAddress() const
Address start_
Start address of definition.
bool allZeros_
Is all the data zeros? (In this case data_ is null)
virtual bool isAddress() const
virtual bool isInitialized() const
virtual Address destinationAddress() const
virtual bool isInstructionAddress() const
virtual void setStartAddress(Address start)
virtual void setDestinationAddress(Address dest)
int size_
Size of uninitialized data definition.
virtual DataDefinition * copy() const
std::vector< MinimumAddressableUnit > * data_
Init data of definition.