OpenASIP 2.2
Loading...
Searching...
No Matches
FUPort.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 FUPort.hh
26 *
27 * Declaration of FUPort class.
28 *
29 * @author Lasse Laasonen 2003 (lasse.laasonen-no.spam-tut.fi)
30 * @note reviewed 14 Jun 2004 by am, tr, ao, ll
31 * @note rating: red
32 */
33
34#ifndef TTA_FU_PORT_HH
35#define TTA_FU_PORT_HH
36
37#include <string>
38
39#include "BaseFUPort.hh"
40
41namespace TTAMachine {
42
43/**
44 * Represens an operand, trigger or result port of a function unit.
45 */
46class FUPort : public BaseFUPort {
47public:
48 FUPort(
49 const std::string& name, int width, FunctionUnit& parent, bool triggers,
50 bool setsOpcode, bool noRegister = false);
51 FUPort(const ObjectState* state, Unit& parent);
52 virtual ~FUPort();
53
54 virtual bool isTriggering() const;
55 virtual bool isOpcodeSetting() const;
56
57 void setTriggering(bool triggers);
58
59 virtual ObjectState* saveState() const;
60 virtual void loadState(const ObjectState* state);
61
62 std::string bindingString() const;
63 void updateBindingString() const;
64
65 bool isArchitectureEqual(FUPort* port);
66
67 bool noRegister() const;
68 void setNoRegister(bool noRegister);
69
70 /// ObjectState name for FUPort.
71 static const std::string OSNAME_FUPORT;
72 /// ObjectState attribute key for triggering feature.
73 static const std::string OSKEY_TRIGGERING;
74 /// ObjectState attribute key for operand code setting feature.
75 static const std::string OSKEY_OPCODE_SETTING;
76 /// ObjectState attribute key for noRegister setting feature.
77 static const std::string OSKEY_NO_REGISTER;
78
79protected:
80 // this is for UniversalFUPort class
81 FUPort(
82 const std::string& name, int width, FunctionUnit& parent, bool triggers,
83 bool setsOpcode, bool noRegister, bool dummy);
84
85private:
86 void cleanupGuards() const;
87 void cleanupOperandBindings() const;
88 void loadStateWithoutReferences(const ObjectState* state);
89
90 /// Specifies whether this is a triggering port.
92 /// Specifies whether this is an operation selecting port.
94 /// Binding string describes the operation bindings of
95 /// of the port to allow fast binding comparison.
96 mutable std::string bindingString_;
97 // Indicated that port do not have internal register for storing value.
99};
100}
101
102#endif
SimValue dummy(32)
a dummy simvalue which is given for operands that are not bound
virtual int width() const
void cleanupOperandBindings() const
Definition FUPort.cc:388
void loadStateWithoutReferences(const ObjectState *state)
Definition FUPort.cc:416
void setNoRegister(bool noRegister)
Definition FUPort.cc:479
virtual bool isTriggering() const
Definition FUPort.cc:182
void setTriggering(bool triggers)
Definition FUPort.cc:212
virtual bool isOpcodeSetting() const
Definition FUPort.cc:195
static const std::string OSNAME_FUPORT
ObjectState name for FUPort.
Definition FUPort.hh:71
static const std::string OSKEY_OPCODE_SETTING
ObjectState attribute key for operand code setting feature.
Definition FUPort.hh:75
std::string bindingString_
Binding string describes the operation bindings of of the port to allow fast binding comparison.
Definition FUPort.hh:96
void updateBindingString() const
Definition FUPort.cc:294
bool triggers_
Specifies whether this is a triggering port.
Definition FUPort.hh:91
static const std::string OSKEY_NO_REGISTER
ObjectState attribute key for noRegister setting feature.
Definition FUPort.hh:77
std::string bindingString() const
Definition FUPort.cc:280
virtual ~FUPort()
Definition FUPort.cc:168
virtual ObjectState * saveState() const
Definition FUPort.cc:239
static const std::string OSKEY_TRIGGERING
ObjectState attribute key for triggering feature.
Definition FUPort.hh:73
bool noRegister() const
Definition FUPort.cc:469
void cleanupGuards() const
Definition FUPort.cc:354
virtual void loadState(const ObjectState *state)
Definition FUPort.cc:257
bool setsOpcode_
Specifies whether this is an operation selecting port.
Definition FUPort.hh:93
bool isArchitectureEqual(FUPort *port)
Definition FUPort.cc:332
virtual std::string name() const
Definition Port.cc:141