OpenASIP 2.2
Loading...
Searching...
No Matches
ASpaceSection.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 ASpaceSection.cc
26 *
27 * Definition of ASpaceSection class,
28 *
29 * @author Mikael Lepistö 2004 (tmlepist-no.spam-cs.tut.fi)
30 *
31 * @note rating: yellow
32 */
33
34#include "ASpaceSection.hh"
35
36namespace TPEF {
37
38using ReferenceManager::SafePointer;
39
40// registers section prototype to base class
41ASpaceSection ASpaceSection::proto_(true);
42
43/**
44 * Constructor.
45 *
46 * @param init true if registeration is wanted
47 */
49 Section(), undefinedElement_(&SafePointer::null) {
50
51 if (init) {
53 }
54
58}
59
60/**
61 * Destructor
62 */
65
66/**
67 * Returns sections type.
68 *
69 * @return type of section.
70 */
73 return ST_ADDRSP;
74}
75
76/**
77 * Creates an instance of class.
78 *
79 * @return Newly created section.
80 */
83 return new ASpaceSection(false);
84}
85
86/**
87 * Checks if the parameter, is undefined address space.
88 *
89 * @param aSpace Element to check.
90 * @return True, if parameter is the undefined address space.
91 */
92bool
98
99/**
100 * Set undefined address space.
101 *
102 * This method must be runned, before checking of undefined address
103 * space is allowed. If set is runned many times, it overrides earlier
104 * setings.
105 *
106 * @param aSpace Element to define as undefined address space.
107 */
108void
117
118/**
119 * Returns undefined address space element.
120 *
121 * @return Undefined address space element.
122 */
125 return dynamic_cast<ASpaceElement*>(
127}
128
129}
#define assert(condition)
Byte wordSize() const
Byte align() const
Byte MAU() const
virtual Section * clone() const
bool isUndefined(ASpaceElement *aSpace) const
ASpaceElement * undefinedASpace() const
virtual SectionType type() const
const ReferenceManager::SafePointer * undefinedElement_
Undefined address space. This element is not allowed to be removed from section is recognized as spec...
void setUndefinedASpace(ASpaceElement *aSpace)
static ASpaceSection proto_
Prototype instance.
SafePointable * pointer() const
static const SafePointer * replaceReference(const SafePointer *old, SafePointable *obj)
static const SafePointer null
The default SafePointer that is used in null references.
static void registerSection(const Section *section)
Definition Section.cc:114
@ ST_ADDRSP
Address space section.
Definition Section.hh:77
void setStartingAddress(AddressImage address)
void unsetFlagNoBits()
void unsetFlagVLen()
ASpaceElement * aSpace() const