OpenASIP  2.0
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 
36 #include "HWBlockArchitecture.hh"
37 #include "Exception.hh"
38 
39 namespace TTAMachine {
40  class BaseRegisterFile;
41  class RegisterFile;
42  class ImmediateUnit;
43 }
44 
45 namespace HDB {
46 
47 /**
48  * Represents the architecture of an RF in HDB.
49  */
51 public:
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 
91  void setZeroRegister(bool zeroRegister);
92  bool zeroRegister() const;
93 
94  int guardLatency() const;
95 
96  bool operator==(const RFArchitecture& rightHand) const;
97 
98 private:
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.
111  int latency_;
112  /// The guard support.
114  /// Width of the register file.
115  int width_;
116  /// Size of the register file.
117  int size_;
118  /// Guard latency.
120  /// Zero register
122 
123 };
124 }
125 
126 #endif
HDB::RFArchitecture::bidirPorts_
int bidirPorts_
Number of bidir ports.
Definition: RFArchitecture.hh:104
HDB::RFArchitecture::setReadPortCount
void setReadPortCount(int portCount)
Definition: RFArchitecture.cc:359
HDB::RFArchitecture::maxReads
int maxReads() const
Definition: RFArchitecture.cc:447
HDB::RFArchitecture::RFArchitecture
RFArchitecture(int readPorts, int writePorts, int bidirPorts, int maxReads, int maxWrites, int latency, bool guardSupport, int guardLatency=0, bool zeroRegister=false)
Definition: RFArchitecture.cc:63
HDB
Definition: CostDatabase.hh:49
HDB::RFArchitecture::setLatency
void setLatency(int latency)
Definition: RFArchitecture.cc:484
Exception.hh
HWBlockArchitecture
Definition: HWBlockArchitecture.hh:42
HDB::RFArchitecture::latency
int latency() const
Definition: RFArchitecture.cc:497
HDB::RFArchitecture::readPorts_
int readPorts_
Number of read ports.
Definition: RFArchitecture.hh:100
HDB::RFArchitecture::~RFArchitecture
virtual ~RFArchitecture()
Definition: RFArchitecture.cc:261
HDB::RFArchitecture::size_
int size_
Size of the register file.
Definition: RFArchitecture.hh:117
HDB::RFArchitecture::zeroRegister
bool zeroRegister() const
Definition: RFArchitecture.cc:541
HDB::RFArchitecture::setMaxWrites
void setMaxWrites(int maxWrites)
Definition: RFArchitecture.cc:459
HDB::RFArchitecture::setZeroRegister
void setZeroRegister(bool zeroRegister)
Definition: RFArchitecture.cc:530
HDB::RFArchitecture::hasParameterizedSize
bool hasParameterizedSize() const
Definition: RFArchitecture.cc:282
HDB::RFArchitecture::setBidirPortCount
void setBidirPortCount(int portCount)
Definition: RFArchitecture.cc:409
HDB::RFArchitecture::width_
int width_
Width of the register file.
Definition: RFArchitecture.hh:115
HDB::RFArchitecture::guardSupport_
bool guardSupport_
The guard support.
Definition: RFArchitecture.hh:113
HDB::RFArchitecture::width
int width() const
Definition: RFArchitecture.cc:343
TTAMachine::BaseRegisterFile
Definition: BaseRegisterFile.hh:48
HDB::RFArchitecture::writePorts_
int writePorts_
Number of write ports.
Definition: RFArchitecture.hh:102
HDB::RFArchitecture::maxWrites
int maxWrites() const
Definition: RFArchitecture.cc:472
HWBlockArchitecture.hh
HDB::RFArchitecture::hasParameterizedWidth
bool hasParameterizedWidth() const
Definition: RFArchitecture.cc:271
HDB::RFArchitecture::maxWrites_
int maxWrites_
Maximum number of ports that can read a register in the same cycle in which another port writes the s...
Definition: RFArchitecture.hh:109
HDB::RFArchitecture::setWidth
void setWidth(int width)
Definition: RFArchitecture.cc:294
HDB::RFArchitecture::guardLatency
int guardLatency() const
Definition: RFArchitecture.cc:551
HDB::RFArchitecture::guardLatency_
int guardLatency_
Guard latency.
Definition: RFArchitecture.hh:119
HDB::RFArchitecture::hasGuardSupport
bool hasGuardSupport() const
Definition: RFArchitecture.cc:519
HDB::RFArchitecture
Definition: RFArchitecture.hh:50
HDB::RFArchitecture::maxReads_
int maxReads_
Maximum number of simultaneous reads.
Definition: RFArchitecture.hh:106
HDB::RFArchitecture::latency_
int latency_
The latency.
Definition: RFArchitecture.hh:111
HDB::RFArchitecture::readPortCount
int readPortCount() const
Definition: RFArchitecture.cc:372
HDB::RFArchitecture::zeroRegister_
bool zeroRegister_
Zero register.
Definition: RFArchitecture.hh:121
HDB::RFArchitecture::size
int size() const
Definition: RFArchitecture.cc:326
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
HDB::RFArchitecture::operator==
bool operator==(const RFArchitecture &rightHand) const
Definition: RFArchitecture.cc:564
HDB::RFArchitecture::bidirPortCount
int bidirPortCount() const
Definition: RFArchitecture.cc:422
TTAMachine
Definition: Assembler.hh:48
HDB::RFArchitecture::setMaxReads
void setMaxReads(int maxReads)
Definition: RFArchitecture.cc:434
HDB::RFArchitecture::setSize
void setSize(int size)
Definition: RFArchitecture.cc:310
HDB::RFArchitecture::writePortCount
int writePortCount() const
Definition: RFArchitecture.cc:397
HDB::RFArchitecture::setGuardSupport
void setGuardSupport(bool supported)
Definition: RFArchitecture.cc:508
HDB::RFArchitecture::setWritePortCount
void setWritePortCount(int portCount)
Definition: RFArchitecture.cc:384
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50