OpenASIP 2.2
Loading...
Searching...
No Matches
ResourceElement.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 ResourceElement.hh
26 *
27 * Declaration of ResourceElement class.
28 *
29 * @author Mikael Lepistö 2003 (tmlepist-no.spam-cs.tut.fi)
30 *
31 * @note rating: yellow
32 */
33
34#ifndef TTA_RESOURCE_ELEMENT_HH
35#define TTA_RESOURCE_ELEMENT_HH
36
37#include "TPEFBaseType.hh"
38#include "SectionElement.hh"
39#include "SafePointer.hh"
40#include "Chunk.hh"
41
42namespace TPEF {
43
44/**
45 * Resource table element.
46 */
48public:
49
50 /// Resource types
52 MRT_NULL = 0x00, ///< Illegal undefined machine resource.
53 MRT_BUS = 0x01, ///< Transport bus.
54 MRT_UNIT = 0x02, ///< Function unit.
55 MRT_RF = 0x03, ///< Register file.
56 MRT_OP = 0x04, ///< Operation operand or function unit register.
57 MRT_IMM = 0x05, ///< Immediate unit.
58 MRT_SR = 0x06, ///< Special register.
59 MRT_PORT = 0x07 ///< Function unit port.
60 };
61
62 /// Resource Id numbers that are reserved for some particular use.
64 UNIVERSAL_BUS = 0x00, ///< Universal bus.
65 UNIVERSAL_FU = 0x00, ///< Universal function unit.
66 ILLEGAL_RF = 0x00, ///< Illegal register file.
67 INT_RF = 0x80, ///< Universal integer register file.
68 BOOL_RF = 0x81, ///< Universal boolean register file.
69 FP_RF = 0x82, ///< Universal floating point register file.
70 UNIVERSAL_RF_MASK = 0x80, ///< Bit to check if registerfile is real or
71 ///< universal.
72 INLINE_IMM = 0x00 ///< Inline immediate unit id.
73 };
74
75 /// Reserved string of return address special register
76 static const std::string RETURN_ADDRESS_NAME;
77
79 virtual ~ResourceElement();
80
81 HalfWord id() const;
82 void setId(HalfWord aId);
83
85 void setType(ResourceType aType);
86
87 Word info() const;
88 void setInfo(Word aInfo);
89
90 Chunk* name() const;
92 void setName(Chunk* aName);
93
94private:
95 /// Unique id number that is used to refer resource.
96 HalfWord id_;
97 /// Type.
99 /// Name.
101 /// Additional info.
102 Word info_;
103};
104}
105
106#include "ResourceElement.icc"
107
108#endif
void setId(HalfWord aId)
Word info_
Additional info.
ResourceType type() const
static const std::string RETURN_ADDRESS_NAME
Reserved string of return address special register.
void setName(ReferenceManager::SafePointer *aName)
HalfWord id() const
ResourceType
Resource types.
@ MRT_BUS
Transport bus.
@ MRT_IMM
Immediate unit.
@ MRT_SR
Special register.
@ MRT_UNIT
Function unit.
@ MRT_PORT
Function unit port.
@ MRT_NULL
Illegal undefined machine resource.
@ MRT_OP
Operation operand or function unit register.
void setName(Chunk *aName)
HalfWord id_
Unique id number that is used to refer resource.
const ReferenceManager::SafePointer * name_
Name.
void setInfo(Word aInfo)
ReservedResourceIDs
Resource Id numbers that are reserved for some particular use.
@ UNIVERSAL_BUS
Universal bus.
@ UNIVERSAL_FU
Universal function unit.
@ INT_RF
Universal integer register file.
@ UNIVERSAL_RF_MASK
Bit to check if registerfile is real or universal.
@ ILLEGAL_RF
Illegal register file.
@ BOOL_RF
Universal boolean register file.
@ FP_RF
Universal floating point register file.
@ INLINE_IMM
Inline immediate unit id.
Chunk * name() const
ResourceType type_
Type.
void setType(ResourceType aType)