OpenASIP 2.2
Loading...
Searching...
No Matches
TemplateSlot.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 TemplateSlot.hh
26 *
27 * Declaration of class TemplateSlot.
28 *
29 * @author Lasse Laasonen 2003 (lasse.laasonen-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_TEMPLATE_SLOT_HH
34#define TTA_TEMPLATE_SLOT_HH
35
36#include <string>
37#include <vector>
38#include <map>
39
40#include "Application.hh"
41
42class ObjectState;
43
44namespace TTAMachine {
45
46class ImmediateUnit;
47class InstructionTemplate;
48class ImmediateSlot;
49class Bus;
50
51/**
52 * Repsesents a bit field of the TTA instruction that is used to encode a
53 * piece of a long immediate for a given instruction template or a NOP move.
54 */
56public:
57
59 const Bus& slot,
60 int width,
63 const ImmediateSlot& slot,
64 int width,
66
67 TemplateSlot(const Bus& slot);
68
69 virtual ~TemplateSlot();
70
71 int width() const;
72 std::string slot() const;
74
75 ObjectState* saveState() const;
76
77 const Bus* bus() const;
78 /// ObjectState name for template slot.
79 static const std::string OSNAME_TEMPLATE_SLOT;
80 /// ObjectState attribute key for slot name.
81 static const std::string OSKEY_SLOT;
82 /// ObjectState attribute key for bit width.
83 static const std::string OSKEY_WIDTH;
84 /// ObjectState attribute key for destination.
85 static const std::string OSKEY_DESTINATION;
86 // ObjectState attribute key for RF read
87 static const std::string OSKEY_RF_READ;
88 // ObjectState attribute key for RF write
89 static const std::string OSKEY_RF_WRITE;
90 // ObjectState attribute key for FU read
91 static const std::string OSKEY_FU_READ;
92 // ObjectState attribute key for FU write
93 static const std::string OSKEY_FU_WRITE;
94
95
96private:
97
98 /// The bus which is programmed by the instruction bit
99 /// field of this template slot.
100 const Bus* bus_;
101
102 /// The immediate slot which is programmed by the instruction bit
103 /// field of this template slot.
105
106 /// The number of bits that can be encoded in this instruction field.
108
109 /// Destination unit.
111
112};
113}
114
115#include "TemplateSlot.icc"
116
117#endif
static const std::string OSNAME_TEMPLATE_SLOT
ObjectState name for template slot.
int width_
The number of bits that can be encoded in this instruction field.
const ImmediateSlot * immSlot_
The immediate slot which is programmed by the instruction bit field of this template slot.
static const std::string OSKEY_RF_READ
static const std::string OSKEY_FU_WRITE
std::string slot() const
ImmediateUnit * destination_
Destination unit.
const Bus * bus() const
static const std::string OSKEY_SLOT
ObjectState attribute key for slot name.
static const std::string OSKEY_RF_WRITE
const Bus * bus_
The bus which is programmed by the instruction bit field of this template slot.
static const std::string OSKEY_DESTINATION
ObjectState attribute key for destination.
ImmediateUnit * destination() const
static const std::string OSKEY_FU_READ
static const std::string OSKEY_WIDTH
ObjectState attribute key for bit width.
ObjectState * saveState() const