OpenASIP  2.0
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 
42 namespace TTAMachine {
43  class AddressSpace;
44 }
45 
46 namespace TTAProgram {
47 
48 /**
49  * Describes characteristics of an initialized or uninitialized
50  * memory area.
51  */
53 public:
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 
80 private:
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)
91  bool allZeros_;
92 
94 
95 };
96 
97 }
98 
99 #endif
TTAProgram::DataDefinition::DataDefinition
DataDefinition(Address start, int size, bool littleEndian, MinimumAddressableUnit *initData=NULL, bool allZeros=false)
Definition: DataDefinition.cc:52
TTAProgram
Definition: Estimator.hh:65
TTAProgram::DataDefinition::size_
int size_
Size of uninitialized data definition.
Definition: DataDefinition.hh:85
BaseType.hh
TTAProgram::DataDefinition
Definition: DataDefinition.hh:52
TTAProgram::Address
Definition: Address.hh:51
TTAProgram::DataDefinition::startAddress
virtual Address startAddress() const
Definition: DataDefinition.cc:129
TTAProgram::DataDefinition::size
virtual int size() const
Definition: DataDefinition.cc:211
Exception.hh
TTAProgram::DataDefinition::isAddress
virtual bool isAddress() const
Definition: DataDefinition.cc:221
TTAProgram::DataDefinition::isLittleEndian
bool isLittleEndian() const
Definition: DataDefinition.hh:78
TTAProgram::DataDefinition::start_
Address start_
Start address of definition.
Definition: DataDefinition.hh:82
TTAProgram::DataDefinition::destinationAddress
virtual Address destinationAddress() const
Definition: DataDefinition.cc:241
MinimumAddressableUnit
Word MinimumAddressableUnit
Type for storing a MAU (must be unsigned type!). This limits the maximum size of the simulated minimu...
Definition: BaseType.hh:184
TTAProgram::DataDefinition::isInitialized
virtual bool isInitialized() const
Definition: DataDefinition.cc:144
TTAProgram::DataDefinition::allZeros_
bool allZeros_
Is all the data zeros? (In this case data_ is null)
Definition: DataDefinition.hh:91
TTAProgram::DataDefinition::setDestinationAddress
virtual void setDestinationAddress(Address dest)
Definition: DataDefinition.cc:251
Address.hh
TTAProgram::DataDefinition::~DataDefinition
virtual ~DataDefinition()
Definition: DataDefinition.cc:116
TTAMachine
Definition: Assembler.hh:48
TTAProgram::DataDefinition::littleEndian_
bool littleEndian_
Definition: DataDefinition.hh:93
TTAProgram::DataDefinition::copy
virtual DataDefinition * copy() const
Definition: DataDefinition.cc:262
TTAProgram::DataDefinition::isInstructionAddress
virtual bool isInstructionAddress() const
Definition: DataDefinition.cc:231
TTAProgram::DataDefinition::setStartAddress
virtual void setStartAddress(Address start)
Definition: DataDefinition.cc:134
TTAProgram::DataDefinition::data_
std::vector< MinimumAddressableUnit > * data_
Init data of definition.
Definition: DataDefinition.hh:88
TTAProgram::DataDefinition::MAU
virtual MinimumAddressableUnit MAU(int index) const
Definition: DataDefinition.cc:155