2 * Copyright (c) 2012-2014, TU Delft
3 * Copyright (c) 2012-2014, TU Eindhoven
4 * Copyright (c) 2012-2014, TU Kaiserslautern
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of the copyright holder nor the names of its
19 * contributors may be used to endorse or promote products derived from
20 * this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
23 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
28 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 * Authors: Karthik Chandrasekar
38 #ifndef TOOLS_MEMORY_SPECIFICATION_H
39 #define TOOLS_MEMORY_SPECIFICATION_H
44 #include "MemArchitectureSpec.h"
45 #include "MemTimingSpec.h"
46 #include "MemPowerSpec.h"
47 #include "Parametrisable.h"
51 // Supported memory types
65 MemoryType(MemoryType_t _val
) :
71 val(MEMORY_TYPE_INVALID
)
75 MemoryType(const std::string
& _val
) :
76 val(MEMORY_TYPE_INVALID
)
80 } else if (_val
== "DDR3") {
82 } else if (_val
== "DDR4") {
84 } else if (_val
== "LPDDR") {
86 } else if (_val
== "LPDDR2") {
88 } else if (_val
== "LPDDR3") {
90 } else if (_val
== "WIDEIO_SDR") {
93 assert("Unknown memory type." && val
!= MEMORY_TYPE_INVALID
);
96 bool isLPDDRFamily() const
98 return val
== LPDDR
||
104 bool hasTwoVoltageDomains() const
106 return val
== LPDDR
||
112 bool isDDRFamily() const
114 return val
== DDR2
||
121 return val
== DDR2
||
126 bool hasTermination() const
128 return val
== DDR2
||
133 double getCapacitance() const
135 // LPDDR/2/3 and DDR memories only have IO Power (no ODT)
136 // Conservative estimates based on Micron Mobile LPDDR2 Power Calculator
137 // LPDDR/2/3 IO Capacitance in mF
140 } else if (val
== LPDDR2
) {
142 } else if (val
== LPDDR3
) {
149 double getIoPower() const
152 // Conservative estimates based on Micron DDR2 Power Calculator
154 } else if (val
== DDR3
) {
155 // Conservative estimates based on Micron DDR3 Power Calculator
157 } else if (val
== DDR4
) {
158 // Conservative estimates based on Micron DDR3 Power Calculator
159 // using available termination resistance values from Micron DDR4 Datasheets
166 double getWrOdtPower() const
169 // Conservative estimates based on Micron DDR2 Power Calculator
171 } else if (val
== DDR3
) {
172 // Conservative estimates based on Micron DDR3 Power Calculator
173 return 21.2; // in mW
174 } else if (val
== DDR4
) {
175 // Conservative estimates based on Micron DDR3 Power Calculator
176 // using available termination resistance values from Micron DDR4 Datasheets
177 return 17.0; // in mW
183 double getTermRdPower() const
186 // Conservative estimates based on Micron DDR2 Power Calculator
187 return 13.1; // in mW
188 } else if (val
== DDR3
) {
189 // Conservative estimates based on Micron DDR3 Power Calculator
190 return 15.5; // in mW
191 } else if (val
== DDR4
) {
192 // Conservative estimates based on Micron DDR3 Power Calculator
193 // using available termination resistance values from Micron DDR4 Datasheets
194 return 12.4; // in mW
200 double getTermWrPower() const
203 // Conservative estimates based on Micron DDR2 Power Calculator
204 return 14.6; // in mW
205 } else if (val
== DDR3
) {
206 // Conservative estimates based on Micron DDR3 Power Calculator
207 return 15.4; // in mW
208 } else if (val
== DDR4
) {
209 // Conservative estimates based on Micron DDR3 Power Calculator
210 // using available termination resistance values from Micron DDR4 Datasheets
211 return 12.3; // in mW
217 operator MemoryType_t() const {
225 class MemorySpecification
: public virtual Parametrisable
{
228 MemoryType memoryType
;
230 MemArchitectureSpec memArchSpec
;
231 MemTimingSpec memTimingSpec
;
232 MemPowerSpec memPowerSpec
;
234 void processParameters();
236 static MemorySpecification
getMemSpecFromXML(const std::string
& id
);
239 #endif // ifndef TOOLS_MEMORY_SPECIFICATION_H