OpenASIP 2.2
Loading...
Searching...
No Matches
Binary.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 Binary.hh
26 *
27 * Declaration of Binary class.
28 *
29 * @author Mikael Lepistö 2003 (tmlepist-no.spam-cs.tut.fi)
30 *
31 * @note rating: yellow
32 */
33
34#ifndef TTA_BINARY_HH
35#define TTA_BINARY_HH
36
37#include <list>
38#include <map>
39#include "SafePointer.hh"
40#include "Section.hh"
41#include "StringSection.hh"
42#include "TPEFHeaders.hh"
43
44namespace TPEF {
45
46/**
47 * Root class of tpef binary representation.
48 */
49class Binary {
50public:
51 /**
52 * Storing types of TTA code.
53 */
54 enum FileType {
55 FT_NULL = 0x00, ///< Illegal/undefined type.
56 FT_OBJSEQ = 0x04, ///< Sequential TTA object code.
57 FT_PURESEQ = 0x05, ///< Sequential TTA code, no unresolved symbols.
58 FT_LIBSEQ = 0x06, ///< Collection of sequential object code files
59 ///< for linkage.
60 FT_MIXED = 0x09, ///< Partly scheduled code.
61 FT_PARALLEL = 0x0D ///< Fully scheduled or mixed code.
62 };
63
64 /**
65 * Encodings of program sections.
66 */
68 FA_NOARCH = 0x00, ///< Illegal/undefined architecture.
69 FA_TTA_MOVE = 0x01, ///< Move design framework.
70 FA_TTA_TUT = 0x02, ///< New TTA template.
71 FA_TDS_TI = 0x03 ///< TTA Design Studio architecture.
72 };
73
74 Binary();
75 virtual ~Binary();
76
78
79 Section* section(Word index) const;
81
82 Word sectionCount() const;
84
86 void setStrings(StringSection* strTable);
88
91
92 FileType type() const;
94
97
98private:
99 Binary(const Binary&);
101
102 /// Reference to string table of binary.
104
105 /// Stores sections of binary.
106 std::vector<Section*> sections_;
107
108 /// Binary's file type. See enumerations for more info.
110 /// Binary's file architecture. See enumerations for more info.
112
113 /// Indicates TPEF format version used.
115};
116}
117
118#include "Binary.icc"
119
120#endif
virtual ~Binary()
Definition Binary.cc:60
TPEFHeaders::TPEFVersion tpefVersion_
Indicates TPEF format version used.
Definition Binary.hh:114
void addSection(Section *section)
Section * section(Section::SectionType type, Word number) const
Word sectionCount(Section::SectionType type) const
void setArch(FileArchitecture arch)
TPEFHeaders::TPEFVersion TPEFVersion() const
const ReferenceManager::SafePointer * strings_
Reference to string table of binary.
Definition Binary.hh:103
FileType fileType_
Binary's file type. See enumerations for more info.
Definition Binary.hh:109
@ FT_MIXED
Partly scheduled code.
Definition Binary.hh:60
@ FT_OBJSEQ
Sequential TTA object code.
Definition Binary.hh:56
@ FT_PARALLEL
Fully scheduled or mixed code.
Definition Binary.hh:61
@ FT_LIBSEQ
Collection of sequential object code files for linkage.
Definition Binary.hh:58
@ FT_PURESEQ
Sequential TTA code, no unresolved symbols.
Definition Binary.hh:57
@ FT_NULL
Illegal/undefined type.
Definition Binary.hh:55
@ FA_TDS_TI
TTA Design Studio architecture.
Definition Binary.hh:71
@ FA_TTA_TUT
New TTA template.
Definition Binary.hh:70
@ FA_TTA_MOVE
Move design framework.
Definition Binary.hh:69
@ FA_NOARCH
Illegal/undefined architecture.
Definition Binary.hh:68
std::vector< Section * > sections_
Stores sections of binary.
Definition Binary.hh:106
Word sectionCount() const
FileArchitecture fileArch_
Binary's file architecture. See enumerations for more info.
Definition Binary.hh:111
Section * section(Word index) const
Binary operator=(const Binary &)
Binary(const Binary &)
void setType(FileType type)
StringSection * strings() const
FileArchitecture arch() const
void setTPEFVersion(TPEFHeaders::TPEFVersion version)
void setStrings(StringSection *strTable)
FileType type() const
void setStrings(const ReferenceManager::SafePointer *strTable)