OpenASIP 2.2
Loading...
Searching...
No Matches
DataSection.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 DataSection.hh
26 *
27 * Declaration of DataSection class.
28 *
29 * @author Mikael Lepistö 2003 (tmlepist-no.spam-cs.tut.fi)
30 *
31 * @note rating: yellow
32 */
33
34#ifndef TTA_DATA_SECTION_HH
35#define TTA_DATA_SECTION_HH
36
37#include <vector>
38
39#include "UDataSection.hh"
40#include "Section.hh"
41#include "TPEFBaseType.hh"
42#include "Exception.hh"
43
44namespace TPEF {
45
46/**
47 * Data section for initialized data.
48 *
49 * Derives from uninitialized data section so, this is extension
50 * of UDataSection.
51 */
52class DataSection : public UDataSection {
53public:
54 virtual ~DataSection();
55
56 virtual SectionType type() const;
57
58 virtual Byte byte(const Chunk* chunk) const;
59 virtual Byte byte(Word offset) const;
60 virtual void addByte(Byte aByte);
61
62 virtual MinimumAddressableUnit MAU(Word index) const;
63 virtual void addMAU(MinimumAddressableUnit aMAU);
64
65 virtual void writeValue(Word index, Word numOfMAUs, unsigned long value);
66 virtual void writeValue(Word index, Word numOfMAUs, signed long value);
67
68 virtual Word length() const;
69 virtual void setDataLength(Word length);
70
71 virtual bool isDataSection() const override { return true; }
72protected:
73 DataSection(bool init);
74 virtual Section* clone() const;
75
76 virtual void setByte(Word offset, Byte aByte);
77
78private:
79 /// Prototype instance of section.
81
82 /// Contains the data of data section.
83 std::vector<Byte> data_;
84};
85}
86
87#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
unsigned char Byte
Definition BaseType.hh:116
MinimumAddressableUnit MAU
virtual bool isDataSection() const override
virtual void addMAU(MinimumAddressableUnit aMAU)
virtual Section * clone() const
virtual Word length() const
virtual void writeValue(Word index, Word numOfMAUs, unsigned long value)
virtual void setByte(Word offset, Byte aByte)
static DataSection proto_
Prototype instance of section.
virtual Byte byte(const Chunk *chunk) const
virtual SectionType type() const
virtual void addByte(Byte aByte)
virtual void setDataLength(Word length)
virtual ~DataSection()
std::vector< Byte > data_
Contains the data of data section.
virtual Chunk * chunk(SectionOffset offset) const
Definition Section.cc:212