OpenASIP 2.2
Loading...
Searching...
No Matches
MoveSlot.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2014 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 MoveSlot.hh
26 *
27 * Declaration of MoveSlot class.
28 *
29 * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30 * @author Pekka Jääskeläinen 2014
31 * @note rating: red
32 */
33
34#ifndef TTA_MOVE_SLOT_HH
35#define TTA_MOVE_SLOT_HH
36
37#include <set>
38
39#include "TCEString.hh"
40#include "InstructionField.hh"
41
42class GuardField;
43class SourceField;
45class ShortImmediateControlField;
46class BinaryEncoding;
47
48/**
49 * The MoveSlot class represents move slots, fields of the TTA instruction
50 * dedicated to program data transports.
51 *
52 * Move slots are subdivided into 2 or 3 fields: the guard (optional),
53 * source and destination fields. Each type of move slot field is
54 * modelled by a different class. MoveSlot has handles to the
55 * instances of these classes. A move slot is identified by the name
56 * of the transport bus it controls. MoveSlot instances cannot exist
57 * alone. They belong to a binary encoding and are always registered
58 * to a BinaryEncoding object.
59 */
60class MoveSlot : public InstructionField {
61public:
62 MoveSlot(const std::string& busName, BinaryEncoding& parent);
64 virtual ~MoveSlot();
65
66 BinaryEncoding* parent() const;
67
68 std::string name() const;
69 void setName(const std::string& name);
70
71 void setGuardField(GuardField& field);
72 void unsetGuardField();
73 bool hasGuardField() const;
74 GuardField& guardField() const;
75
76 void setSourceField(SourceField& field);
77 void unsetSourceField();
78 bool hasSourceField() const;
79 SourceField& sourceField() const;
80
83 bool hasDestinationField() const;
85
86 // virtual methods derived from InstructionField
87 virtual int childFieldCount() const;
88 virtual InstructionField& childField(int position) const;
89 virtual int width() const;
90
91 // methods inherited from Serializable interface
92 virtual void loadState(const ObjectState* state);
93 virtual ObjectState* saveState() const;
94
95 /// ObjectState name for move slot.
96 static const std::string OSNAME_MOVE_SLOT;
97 /// ObjectState attribute key for the name of the bus.
98 static const std::string OSKEY_BUS_NAME;
99
100private:
101 void deleteGuardField();
102 void deleteSourceField();
104
105 /// The bus name.
106 std::string name_;
107 /// The guard field.
109 /// The source field.
111 /// The destination field.
113};
114
115#endif
116
117
void deleteSourceField()
Definition MoveSlot.cc:505
BinaryEncoding * parent() const
Definition MoveSlot.cc:118
virtual ~MoveSlot()
Definition MoveSlot.cc:100
SourceField & sourceField() const
Definition MoveSlot.cc:277
virtual ObjectState * saveState() const
Definition MoveSlot.cc:469
void setName(const std::string &name)
Definition MoveSlot.cc:149
virtual InstructionField & childField(int position) const
Definition MoveSlot.cc:380
void deleteGuardField()
Definition MoveSlot.cc:493
static const std::string OSKEY_BUS_NAME
ObjectState attribute key for the name of the bus.
Definition MoveSlot.hh:98
void setSourceField(SourceField &field)
Definition MoveSlot.cc:233
void unsetSourceField()
Definition MoveSlot.cc:251
std::string name_
The bus name.
Definition MoveSlot.hh:106
void setGuardField(GuardField &field)
Definition MoveSlot.cc:171
DestinationField & destinationField() const
Definition MoveSlot.cc:341
virtual int width() const
Definition MoveSlot.cc:406
GuardField * guardField_
The guard field.
Definition MoveSlot.hh:108
std::string name() const
Definition MoveSlot.cc:136
GuardField & guardField() const
Definition MoveSlot.cc:215
void unsetDestinationField()
Definition MoveSlot.cc:314
DestinationField * destinationField_
The destination field.
Definition MoveSlot.hh:112
void deleteDestinationField()
Definition MoveSlot.cc:516
void setDestinationField(DestinationField &field)
Definition MoveSlot.cc:296
bool hasSourceField() const
Definition MoveSlot.cc:264
static const std::string OSNAME_MOVE_SLOT
ObjectState name for move slot.
Definition MoveSlot.hh:96
virtual void loadState(const ObjectState *state)
Definition MoveSlot.cc:432
void unsetGuardField()
Definition MoveSlot.cc:189
virtual int childFieldCount() const
Definition MoveSlot.cc:357
bool hasDestinationField() const
Definition MoveSlot.cc:327
bool hasGuardField() const
Definition MoveSlot.cc:202
SourceField * sourceField_
The source field.
Definition MoveSlot.hh:110