OpenASIP 2.2
Loading...
Searching...
No Matches
RFArchitecture.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 RFArchitecture.hh
26 *
27 * Declaration of RFArchitecture class.
28 *
29 * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_RF_ARCHITECTURE_HH
34#define TTA_RF_ARCHITECTURE_HH
35
37#include "Exception.hh"
38
39namespace TTAMachine {
40 class BaseRegisterFile;
41 class RegisterFile;
42 class ImmediateUnit;
43}
44
45namespace HDB {
46
47/**
48 * Represents the architecture of an RF in HDB.
49 */
51public:
53 int readPorts, int writePorts, int bidirPorts, int maxReads,
54 int maxWrites, int latency, bool guardSupport, int guardLatency = 0,
55 bool zeroRegister = false);
59 virtual ~RFArchitecture();
60
61 bool hasParameterizedWidth() const;
62 bool hasParameterizedSize() const;
63
64 void setWidth(int width);
65 void setSize(int size);
66
67 int size() const;
68 int width() const;
69
70 void setReadPortCount(int portCount);
71 int readPortCount() const;
72
73 void setWritePortCount(int portCount);
74 int writePortCount() const;
75
76 void setBidirPortCount(int portCount);
77 int bidirPortCount() const;
78
79 void setMaxReads(int maxReads);
80 int maxReads() const;
81
82 void setMaxWrites(int maxWrites);
83 int maxWrites() const;
84
85 void setLatency(int latency);
86 int latency() const;
87
88 void setGuardSupport(bool supported);
89 bool hasGuardSupport() const;
90
92 bool zeroRegister() const;
93
94 int guardLatency() const;
95
96 bool operator==(const RFArchitecture& rightHand) const;
97
98private:
99 /// Number of read ports.
101 /// Number of write ports.
103 /// Number of bidir ports.
105 /// Maximum number of simultaneous reads.
107 /// Maximum number of ports that can read a register in the same cycle
108 /// in which another port writes the same register.
110 /// The latency.
112 /// The guard support.
114 /// Width of the register file.
116 /// Size of the register file.
117 int size_;
118 /// Guard latency.
120 /// Zero register
122
123};
124}
125
126#endif
void setGuardSupport(bool supported)
void setZeroRegister(bool zeroRegister)
bool hasGuardSupport() const
int bidirPorts_
Number of bidir ports.
bool hasParameterizedWidth() const
int maxWrites_
Maximum number of ports that can read a register in the same cycle in which another port writes the s...
void setWritePortCount(int portCount)
int writePorts_
Number of write ports.
bool operator==(const RFArchitecture &rightHand) const
void setBidirPortCount(int portCount)
void setSize(int size)
bool zeroRegister() const
int size_
Size of the register file.
int width_
Width of the register file.
void setReadPortCount(int portCount)
void setWidth(int width)
int guardLatency_
Guard latency.
void setMaxWrites(int maxWrites)
void setMaxReads(int maxReads)
bool guardSupport_
The guard support.
void setLatency(int latency)
bool hasParameterizedSize() const
int readPorts_
Number of read ports.
bool zeroRegister_
Zero register.
int maxReads_
Maximum number of simultaneous reads.
int latency_
The latency.