mem-cache: Use the compression factor to co-allocate
[gem5.git] / src / mem / DRAMInterface.py
1 # Copyright (c) 2012-2020 ARM Limited
2 # All rights reserved.
3 #
4 # The license below extends only to copyright in the software and shall
5 # not be construed as granting a license to any other intellectual
6 # property including but not limited to intellectual property relating
7 # to a hardware implementation of the functionality of the software
8 # licensed hereunder. You may use the software subject to the license
9 # terms below provided that you ensure that this notice is replicated
10 # unmodified and in its entirety in all distributions of the software,
11 # modified or unmodified, in source code or in binary form.
12 #
13 # Copyright (c) 2013 Amin Farmahini-Farahani
14 # Copyright (c) 2015 University of Kaiserslautern
15 # Copyright (c) 2015 The University of Bologna
16 # All rights reserved.
17 #
18 # Redistribution and use in source and binary forms, with or without
19 # modification, are permitted provided that the following conditions are
20 # met: redistributions of source code must retain the above copyright
21 # notice, this list of conditions and the following disclaimer;
22 # redistributions in binary form must reproduce the above copyright
23 # notice, this list of conditions and the following disclaimer in the
24 # documentation and/or other materials provided with the distribution;
25 # neither the name of the copyright holders nor the names of its
26 # contributors may be used to endorse or promote products derived from
27 # this software without specific prior written permission.
28 #
29 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
41 from m5.objects.MemInterface import *
42
43 # Enum for the page policy, either open, open_adaptive, close, or
44 # close_adaptive.
45 class PageManage(Enum): vals = ['open', 'open_adaptive', 'close',
46 'close_adaptive']
47
48 class DRAMInterface(MemInterface):
49 type = 'DRAMInterface'
50 cxx_header = "mem/mem_interface.hh"
51
52 # scheduler page policy
53 page_policy = Param.PageManage('open_adaptive', "Page management policy")
54
55 # enforce a limit on the number of accesses per row
56 max_accesses_per_row = Param.Unsigned(16, "Max accesses per row before "
57 "closing");
58
59 # default to 0 bank groups per rank, indicating bank group architecture
60 # is not used
61 # update per memory class when bank group architecture is supported
62 bank_groups_per_rank = Param.Unsigned(0, "Number of bank groups per rank")
63
64 # Enable DRAM powerdown states if True. This is False by default due to
65 # performance being lower when enabled
66 enable_dram_powerdown = Param.Bool(False, "Enable powerdown states")
67
68 # For power modelling we need to know if the DRAM has a DLL or not
69 dll = Param.Bool(True, "DRAM has DLL or not")
70
71 # DRAMPower provides in addition to the core power, the possibility to
72 # include RD/WR termination and IO power. This calculation assumes some
73 # default values. The integration of DRAMPower with gem5 does not include
74 # IO and RD/WR termination power by default. This might be added as an
75 # additional feature in the future.
76
77 # timing behaviour and constraints - all in nanoseconds
78
79 # the amount of time in nanoseconds from issuing an activate command
80 # to the data being available in the row buffer for a read/write
81 tRCD = Param.Latency("RAS to CAS delay")
82
83 # the time from issuing a read/write command to seeing the actual data
84 tCL = Param.Latency("CAS latency")
85
86 # minimum time between a precharge and subsequent activate
87 tRP = Param.Latency("Row precharge time")
88
89 # minimum time between an activate and a precharge to the same row
90 tRAS = Param.Latency("ACT to PRE delay")
91
92 # minimum time between a write data transfer and a precharge
93 tWR = Param.Latency("Write recovery time")
94
95 # minimum time between a read and precharge command
96 tRTP = Param.Latency("Read to precharge")
97
98 # tBURST_MAX is the column array cycle delay required before next access,
99 # which could be greater than tBURST when the memory access time is greater
100 # than tBURST
101 tBURST_MAX = Param.Latency(Self.tBURST, "Column access delay")
102
103 # tBURST_MIN is the minimum delay between bursts, which could be less than
104 # tBURST when interleaving is supported
105 tBURST_MIN = Param.Latency(Self.tBURST, "Minimim delay between bursts")
106
107 # CAS-to-CAS delay for bursts to the same bank group
108 # only utilized with bank group architectures; set to 0 for default case
109 # tBURST is equivalent to tCCD_S; no explicit parameter required
110 # for CAS-to-CAS delay for bursts to different bank groups
111 tCCD_L = Param.Latency("0ns", "Same bank group CAS to CAS delay")
112
113 # Write-to-Write delay for bursts to the same bank group
114 # only utilized with bank group architectures; set to 0 for default case
115 # This will be used to enable different same bank group delays
116 # for writes versus reads
117 tCCD_L_WR = Param.Latency(Self.tCCD_L,
118 "Same bank group Write to Write delay")
119
120 # time taken to complete one refresh cycle (N rows in all banks)
121 tRFC = Param.Latency("Refresh cycle time")
122
123 # refresh command interval, how often a "ref" command needs
124 # to be sent. It is 7.8 us for a 64ms refresh requirement
125 tREFI = Param.Latency("Refresh command interval")
126
127 # write-to-read, same rank turnaround penalty for same bank group
128 tWTR_L = Param.Latency(Self.tWTR, "Write to read, same rank switching "
129 "time, same bank group")
130
131 # minimum precharge to precharge delay time
132 tPPD = Param.Latency("0ns", "PRE to PRE delay")
133
134 # maximum delay between two-cycle ACT command phases
135 tAAD = Param.Latency(Self.tCK,
136 "Maximum delay between two-cycle ACT commands")
137
138 two_cycle_activate = Param.Bool(False,
139 "Two cycles required to send activate")
140
141 # minimum row activate to row activate delay time
142 tRRD = Param.Latency("ACT to ACT delay")
143
144 # only utilized with bank group architectures; set to 0 for default case
145 tRRD_L = Param.Latency("0ns", "Same bank group ACT to ACT delay")
146
147 # time window in which a maximum number of activates are allowed
148 # to take place, set to 0 to disable
149 tXAW = Param.Latency("X activation window")
150 activation_limit = Param.Unsigned("Max number of activates in window")
151
152 # time to exit power-down mode
153 # Exit power-down to next valid command delay
154 tXP = Param.Latency("0ns", "Power-up Delay")
155
156 # Exit Powerdown to commands requiring a locked DLL
157 tXPDLL = Param.Latency("0ns", "Power-up Delay with locked DLL")
158
159 # time to exit self-refresh mode
160 tXS = Param.Latency("0ns", "Self-refresh exit latency")
161
162 # time to exit self-refresh mode with locked DLL
163 tXSDLL = Param.Latency("0ns", "Self-refresh exit latency DLL")
164
165 # number of data beats per clock. with DDR, default is 2, one per edge
166 # used in drampower.cc
167 beats_per_clock = Param.Unsigned(2, "Data beats per clock")
168
169 data_clock_sync = Param.Bool(False, "Synchronization commands required")
170
171 # Currently rolled into other params
172 ######################################################################
173
174 # tRC - assumed to be tRAS + tRP
175
176 # Power Behaviour and Constraints
177 # DRAMs like LPDDR and WideIO have 2 external voltage domains. These are
178 # defined as VDD and VDD2. Each current is defined for each voltage domain
179 # separately. For example, current IDD0 is active-precharge current for
180 # voltage domain VDD and current IDD02 is active-precharge current for
181 # voltage domain VDD2.
182 # By default all currents are set to 0mA. Users who are only interested in
183 # the performance of DRAMs can leave them at 0.
184
185 # Operating 1 Bank Active-Precharge current
186 IDD0 = Param.Current("0mA", "Active precharge current")
187
188 # Operating 1 Bank Active-Precharge current multiple voltage Range
189 IDD02 = Param.Current("0mA", "Active precharge current VDD2")
190
191 # Precharge Power-down Current: Slow exit
192 IDD2P0 = Param.Current("0mA", "Precharge Powerdown slow")
193
194 # Precharge Power-down Current: Slow exit multiple voltage Range
195 IDD2P02 = Param.Current("0mA", "Precharge Powerdown slow VDD2")
196
197 # Precharge Power-down Current: Fast exit
198 IDD2P1 = Param.Current("0mA", "Precharge Powerdown fast")
199
200 # Precharge Power-down Current: Fast exit multiple voltage Range
201 IDD2P12 = Param.Current("0mA", "Precharge Powerdown fast VDD2")
202
203 # Precharge Standby current
204 IDD2N = Param.Current("0mA", "Precharge Standby current")
205
206 # Precharge Standby current multiple voltage range
207 IDD2N2 = Param.Current("0mA", "Precharge Standby current VDD2")
208
209 # Active Power-down current: slow exit
210 IDD3P0 = Param.Current("0mA", "Active Powerdown slow")
211
212 # Active Power-down current: slow exit multiple voltage range
213 IDD3P02 = Param.Current("0mA", "Active Powerdown slow VDD2")
214
215 # Active Power-down current : fast exit
216 IDD3P1 = Param.Current("0mA", "Active Powerdown fast")
217
218 # Active Power-down current : fast exit multiple voltage range
219 IDD3P12 = Param.Current("0mA", "Active Powerdown fast VDD2")
220
221 # Active Standby current
222 IDD3N = Param.Current("0mA", "Active Standby current")
223
224 # Active Standby current multiple voltage range
225 IDD3N2 = Param.Current("0mA", "Active Standby current VDD2")
226
227 # Burst Read Operating Current
228 IDD4R = Param.Current("0mA", "READ current")
229
230 # Burst Read Operating Current multiple voltage range
231 IDD4R2 = Param.Current("0mA", "READ current VDD2")
232
233 # Burst Write Operating Current
234 IDD4W = Param.Current("0mA", "WRITE current")
235
236 # Burst Write Operating Current multiple voltage range
237 IDD4W2 = Param.Current("0mA", "WRITE current VDD2")
238
239 # Refresh Current
240 IDD5 = Param.Current("0mA", "Refresh current")
241
242 # Refresh Current multiple voltage range
243 IDD52 = Param.Current("0mA", "Refresh current VDD2")
244
245 # Self-Refresh Current
246 IDD6 = Param.Current("0mA", "Self-refresh Current")
247
248 # Self-Refresh Current multiple voltage range
249 IDD62 = Param.Current("0mA", "Self-refresh Current VDD2")
250
251 # Main voltage range of the DRAM
252 VDD = Param.Voltage("0V", "Main Voltage Range")
253
254 # Second voltage range defined by some DRAMs
255 VDD2 = Param.Voltage("0V", "2nd Voltage Range")
256
257 # A single DDR3-1600 x64 channel (one command and address bus), with
258 # timings based on a DDR3-1600 4 Gbit datasheet (Micron MT41J512M8) in
259 # an 8x8 configuration.
260 class DDR3_1600_8x8(DRAMInterface):
261 # size of device in bytes
262 device_size = '512MB'
263
264 # 8x8 configuration, 8 devices each with an 8-bit interface
265 device_bus_width = 8
266
267 # DDR3 is a BL8 device
268 burst_length = 8
269
270 # Each device has a page (row buffer) size of 1 Kbyte (1K columns x8)
271 device_rowbuffer_size = '1kB'
272
273 # 8x8 configuration, so 8 devices
274 devices_per_rank = 8
275
276 # Use two ranks
277 ranks_per_channel = 2
278
279 # DDR3 has 8 banks in all configurations
280 banks_per_rank = 8
281
282 # 800 MHz
283 tCK = '1.25ns'
284
285 # 8 beats across an x64 interface translates to 4 clocks @ 800 MHz
286 tBURST = '5ns'
287
288 # DDR3-1600 11-11-11
289 tRCD = '13.75ns'
290 tCL = '13.75ns'
291 tRP = '13.75ns'
292 tRAS = '35ns'
293 tRRD = '6ns'
294 tXAW = '30ns'
295 activation_limit = 4
296 tRFC = '260ns'
297
298 tWR = '15ns'
299
300 # Greater of 4 CK or 7.5 ns
301 tWTR = '7.5ns'
302
303 # Greater of 4 CK or 7.5 ns
304 tRTP = '7.5ns'
305
306 # Default same rank rd-to-wr bus turnaround to 2 CK, @800 MHz = 2.5 ns
307 tRTW = '2.5ns'
308
309 # Default different rank bus delay to 2 CK, @800 MHz = 2.5 ns
310 tCS = '2.5ns'
311
312 # <=85C, half for >85C
313 tREFI = '7.8us'
314
315 # active powerdown and precharge powerdown exit time
316 tXP = '6ns'
317
318 # self refresh exit time
319 tXS = '270ns'
320
321 # Current values from datasheet Die Rev E,J
322 IDD0 = '55mA'
323 IDD2N = '32mA'
324 IDD3N = '38mA'
325 IDD4W = '125mA'
326 IDD4R = '157mA'
327 IDD5 = '235mA'
328 IDD3P1 = '38mA'
329 IDD2P1 = '32mA'
330 IDD6 = '20mA'
331 VDD = '1.5V'
332
333 # A single HMC-2500 x32 model based on:
334 # [1] DRAMSpec: a high-level DRAM bank modelling tool
335 # developed at the University of Kaiserslautern. This high level tool
336 # uses RC (resistance-capacitance) and CV (capacitance-voltage) models to
337 # estimate the DRAM bank latency and power numbers.
338 # [2] High performance AXI-4.0 based interconnect for extensible smart memory
339 # cubes (E. Azarkhish et. al)
340 # Assumed for the HMC model is a 30 nm technology node.
341 # The modelled HMC consists of 4 Gbit layers which sum up to 2GB of memory (4
342 # layers).
343 # Each layer has 16 vaults and each vault consists of 2 banks per layer.
344 # In order to be able to use the same controller used for 2D DRAM generations
345 # for HMC, the following analogy is done:
346 # Channel (DDR) => Vault (HMC)
347 # device_size (DDR) => size of a single layer in a vault
348 # ranks per channel (DDR) => number of layers
349 # banks per rank (DDR) => banks per layer
350 # devices per rank (DDR) => devices per layer ( 1 for HMC).
351 # The parameters for which no input is available are inherited from the DDR3
352 # configuration.
353 # This configuration includes the latencies from the DRAM to the logic layer
354 # of the HMC
355 class HMC_2500_1x32(DDR3_1600_8x8):
356 # size of device
357 # two banks per device with each bank 4MB [2]
358 device_size = '8MB'
359
360 # 1x32 configuration, 1 device with 32 TSVs [2]
361 device_bus_width = 32
362
363 # HMC is a BL8 device [2]
364 burst_length = 8
365
366 # Each device has a page (row buffer) size of 256 bytes [2]
367 device_rowbuffer_size = '256B'
368
369 # 1x32 configuration, so 1 device [2]
370 devices_per_rank = 1
371
372 # 4 layers so 4 ranks [2]
373 ranks_per_channel = 4
374
375 # HMC has 2 banks per layer [2]
376 # Each layer represents a rank. With 4 layers and 8 banks in total, each
377 # layer has 2 banks; thus 2 banks per rank.
378 banks_per_rank = 2
379
380 # 1250 MHz [2]
381 tCK = '0.8ns'
382
383 # 8 beats across an x32 interface translates to 4 clocks @ 1250 MHz
384 tBURST = '3.2ns'
385
386 # Values using DRAMSpec HMC model [1]
387 tRCD = '10.2ns'
388 tCL = '9.9ns'
389 tRP = '7.7ns'
390 tRAS = '21.6ns'
391
392 # tRRD depends on the power supply network for each vendor.
393 # We assume a tRRD of a double bank approach to be equal to 4 clock
394 # cycles (Assumption)
395 tRRD = '3.2ns'
396
397 # activation limit is set to 0 since there are only 2 banks per vault
398 # layer.
399 activation_limit = 0
400
401 # Values using DRAMSpec HMC model [1]
402 tRFC = '59ns'
403 tWR = '8ns'
404 tRTP = '4.9ns'
405
406 # Default different rank bus delay assumed to 1 CK for TSVs, @1250 MHz =
407 # 0.8 ns (Assumption)
408 tCS = '0.8ns'
409
410 # Value using DRAMSpec HMC model [1]
411 tREFI = '3.9us'
412
413 # The default page policy in the vault controllers is simple closed page
414 # [2] nevertheless 'close' policy opens and closes the row multiple times
415 # for bursts largers than 32Bytes. For this reason we use 'close_adaptive'
416 page_policy = 'close_adaptive'
417
418 # RoCoRaBaCh resembles the default address mapping in HMC
419 addr_mapping = 'RoCoRaBaCh'
420
421 # These parameters do not directly correlate with buffer_size in real
422 # hardware. Nevertheless, their value has been tuned to achieve a
423 # bandwidth similar to the cycle-accurate model in [2]
424 write_buffer_size = 32
425 read_buffer_size = 32
426
427 # A single DDR3-2133 x64 channel refining a selected subset of the
428 # options for the DDR-1600 configuration, based on the same DDR3-1600
429 # 4 Gbit datasheet (Micron MT41J512M8). Most parameters are kept
430 # consistent across the two configurations.
431 class DDR3_2133_8x8(DDR3_1600_8x8):
432 # 1066 MHz
433 tCK = '0.938ns'
434
435 # 8 beats across an x64 interface translates to 4 clocks @ 1066 MHz
436 tBURST = '3.752ns'
437
438 # DDR3-2133 14-14-14
439 tRCD = '13.09ns'
440 tCL = '13.09ns'
441 tRP = '13.09ns'
442 tRAS = '33ns'
443 tRRD = '5ns'
444 tXAW = '25ns'
445
446 # Current values from datasheet
447 IDD0 = '70mA'
448 IDD2N = '37mA'
449 IDD3N = '44mA'
450 IDD4W = '157mA'
451 IDD4R = '191mA'
452 IDD5 = '250mA'
453 IDD3P1 = '44mA'
454 IDD2P1 = '43mA'
455 IDD6 ='20mA'
456 VDD = '1.5V'
457
458 # A single DDR4-2400 x64 channel (one command and address bus), with
459 # timings based on a DDR4-2400 8 Gbit datasheet (Micron MT40A2G4)
460 # in an 16x4 configuration.
461 # Total channel capacity is 32GB
462 # 16 devices/rank * 2 ranks/channel * 1GB/device = 32GB/channel
463 class DDR4_2400_16x4(DRAMInterface):
464 # size of device
465 device_size = '1GB'
466
467 # 16x4 configuration, 16 devices each with a 4-bit interface
468 device_bus_width = 4
469
470 # DDR4 is a BL8 device
471 burst_length = 8
472
473 # Each device has a page (row buffer) size of 512 byte (1K columns x4)
474 device_rowbuffer_size = '512B'
475
476 # 16x4 configuration, so 16 devices
477 devices_per_rank = 16
478
479 # Match our DDR3 configurations which is dual rank
480 ranks_per_channel = 2
481
482 # DDR4 has 2 (x16) or 4 (x4 and x8) bank groups
483 # Set to 4 for x4 case
484 bank_groups_per_rank = 4
485
486 # DDR4 has 16 banks(x4,x8) and 8 banks(x16) (4 bank groups in all
487 # configurations). Currently we do not capture the additional
488 # constraints incurred by the bank groups
489 banks_per_rank = 16
490
491 # override the default buffer sizes and go for something larger to
492 # accommodate the larger bank count
493 write_buffer_size = 128
494 read_buffer_size = 64
495
496 # 1200 MHz
497 tCK = '0.833ns'
498
499 # 8 beats across an x64 interface translates to 4 clocks @ 1200 MHz
500 # tBURST is equivalent to the CAS-to-CAS delay (tCCD)
501 # With bank group architectures, tBURST represents the CAS-to-CAS
502 # delay for bursts to different bank groups (tCCD_S)
503 tBURST = '3.332ns'
504
505 # @2400 data rate, tCCD_L is 6 CK
506 # CAS-to-CAS delay for bursts to the same bank group
507 # tBURST is equivalent to tCCD_S; no explicit parameter required
508 # for CAS-to-CAS delay for bursts to different bank groups
509 tCCD_L = '5ns';
510
511 # DDR4-2400 17-17-17
512 tRCD = '14.16ns'
513 tCL = '14.16ns'
514 tRP = '14.16ns'
515 tRAS = '32ns'
516
517 # RRD_S (different bank group) for 512B page is MAX(4 CK, 3.3ns)
518 tRRD = '3.332ns'
519
520 # RRD_L (same bank group) for 512B page is MAX(4 CK, 4.9ns)
521 tRRD_L = '4.9ns';
522
523 # tFAW for 512B page is MAX(16 CK, 13ns)
524 tXAW = '13.328ns'
525 activation_limit = 4
526 # tRFC is 350ns
527 tRFC = '350ns'
528
529 tWR = '15ns'
530
531 # Here using the average of WTR_S and WTR_L
532 tWTR = '5ns'
533
534 # Greater of 4 CK or 7.5 ns
535 tRTP = '7.5ns'
536
537 # Default same rank rd-to-wr bus turnaround to 2 CK, @1200 MHz = 1.666 ns
538 tRTW = '1.666ns'
539
540 # Default different rank bus delay to 2 CK, @1200 MHz = 1.666 ns
541 tCS = '1.666ns'
542
543 # <=85C, half for >85C
544 tREFI = '7.8us'
545
546 # active powerdown and precharge powerdown exit time
547 tXP = '6ns'
548
549 # self refresh exit time
550 # exit delay to ACT, PRE, PREALL, REF, SREF Enter, and PD Enter is:
551 # tRFC + 10ns = 340ns
552 tXS = '340ns'
553
554 # Current values from datasheet
555 IDD0 = '43mA'
556 IDD02 = '3mA'
557 IDD2N = '34mA'
558 IDD3N = '38mA'
559 IDD3N2 = '3mA'
560 IDD4W = '103mA'
561 IDD4R = '110mA'
562 IDD5 = '250mA'
563 IDD3P1 = '32mA'
564 IDD2P1 = '25mA'
565 IDD6 = '30mA'
566 VDD = '1.2V'
567 VDD2 = '2.5V'
568
569 # A single DDR4-2400 x64 channel (one command and address bus), with
570 # timings based on a DDR4-2400 8 Gbit datasheet (Micron MT40A1G8)
571 # in an 8x8 configuration.
572 # Total channel capacity is 16GB
573 # 8 devices/rank * 2 ranks/channel * 1GB/device = 16GB/channel
574 class DDR4_2400_8x8(DDR4_2400_16x4):
575 # 8x8 configuration, 8 devices each with an 8-bit interface
576 device_bus_width = 8
577
578 # Each device has a page (row buffer) size of 1 Kbyte (1K columns x8)
579 device_rowbuffer_size = '1kB'
580
581 # 8x8 configuration, so 8 devices
582 devices_per_rank = 8
583
584 # RRD_L (same bank group) for 1K page is MAX(4 CK, 4.9ns)
585 tRRD_L = '4.9ns';
586
587 tXAW = '21ns'
588
589 # Current values from datasheet
590 IDD0 = '48mA'
591 IDD3N = '43mA'
592 IDD4W = '123mA'
593 IDD4R = '135mA'
594 IDD3P1 = '37mA'
595
596 # A single DDR4-2400 x64 channel (one command and address bus), with
597 # timings based on a DDR4-2400 8 Gbit datasheet (Micron MT40A512M16)
598 # in an 4x16 configuration.
599 # Total channel capacity is 4GB
600 # 4 devices/rank * 1 ranks/channel * 1GB/device = 4GB/channel
601 class DDR4_2400_4x16(DDR4_2400_16x4):
602 # 4x16 configuration, 4 devices each with an 16-bit interface
603 device_bus_width = 16
604
605 # Each device has a page (row buffer) size of 2 Kbyte (1K columns x16)
606 device_rowbuffer_size = '2kB'
607
608 # 4x16 configuration, so 4 devices
609 devices_per_rank = 4
610
611 # Single rank for x16
612 ranks_per_channel = 1
613
614 # DDR4 has 2 (x16) or 4 (x4 and x8) bank groups
615 # Set to 2 for x16 case
616 bank_groups_per_rank = 2
617
618 # DDR4 has 16 banks(x4,x8) and 8 banks(x16) (4 bank groups in all
619 # configurations). Currently we do not capture the additional
620 # constraints incurred by the bank groups
621 banks_per_rank = 8
622
623 # RRD_S (different bank group) for 2K page is MAX(4 CK, 5.3ns)
624 tRRD = '5.3ns'
625
626 # RRD_L (same bank group) for 2K page is MAX(4 CK, 6.4ns)
627 tRRD_L = '6.4ns';
628
629 tXAW = '30ns'
630
631 # Current values from datasheet
632 IDD0 = '80mA'
633 IDD02 = '4mA'
634 IDD2N = '34mA'
635 IDD3N = '47mA'
636 IDD4W = '228mA'
637 IDD4R = '243mA'
638 IDD5 = '280mA'
639 IDD3P1 = '41mA'
640
641 # A single LPDDR2-S4 x32 interface (one command/address bus), with
642 # default timings based on a LPDDR2-1066 4 Gbit part (Micron MT42L128M32D1)
643 # in a 1x32 configuration.
644 class LPDDR2_S4_1066_1x32(DRAMInterface):
645 # No DLL in LPDDR2
646 dll = False
647
648 # size of device
649 device_size = '512MB'
650
651 # 1x32 configuration, 1 device with a 32-bit interface
652 device_bus_width = 32
653
654 # LPDDR2_S4 is a BL4 and BL8 device
655 burst_length = 8
656
657 # Each device has a page (row buffer) size of 1KB
658 # (this depends on the memory density)
659 device_rowbuffer_size = '1kB'
660
661 # 1x32 configuration, so 1 device
662 devices_per_rank = 1
663
664 # Use a single rank
665 ranks_per_channel = 1
666
667 # LPDDR2-S4 has 8 banks in all configurations
668 banks_per_rank = 8
669
670 # 533 MHz
671 tCK = '1.876ns'
672
673 # Fixed at 15 ns
674 tRCD = '15ns'
675
676 # 8 CK read latency, 4 CK write latency @ 533 MHz, 1.876 ns cycle time
677 tCL = '15ns'
678
679 # Pre-charge one bank 15 ns (all banks 18 ns)
680 tRP = '15ns'
681
682 tRAS = '42ns'
683 tWR = '15ns'
684
685 tRTP = '7.5ns'
686
687 # 8 beats across an x32 DDR interface translates to 4 clocks @ 533 MHz.
688 # Note this is a BL8 DDR device.
689 # Requests larger than 32 bytes are broken down into multiple requests
690 # in the controller
691 tBURST = '7.5ns'
692
693 # LPDDR2-S4, 4 Gbit
694 tRFC = '130ns'
695 tREFI = '3.9us'
696
697 # active powerdown and precharge powerdown exit time
698 tXP = '7.5ns'
699
700 # self refresh exit time
701 tXS = '140ns'
702
703 # Irrespective of speed grade, tWTR is 7.5 ns
704 tWTR = '7.5ns'
705
706 # Default same rank rd-to-wr bus turnaround to 2 CK, @533 MHz = 3.75 ns
707 tRTW = '3.75ns'
708
709 # Default different rank bus delay to 2 CK, @533 MHz = 3.75 ns
710 tCS = '3.75ns'
711
712 # Activate to activate irrespective of density and speed grade
713 tRRD = '10.0ns'
714
715 # Irrespective of density, tFAW is 50 ns
716 tXAW = '50ns'
717 activation_limit = 4
718
719 # Current values from datasheet
720 IDD0 = '15mA'
721 IDD02 = '70mA'
722 IDD2N = '2mA'
723 IDD2N2 = '30mA'
724 IDD3N = '2.5mA'
725 IDD3N2 = '30mA'
726 IDD4W = '10mA'
727 IDD4W2 = '190mA'
728 IDD4R = '3mA'
729 IDD4R2 = '220mA'
730 IDD5 = '40mA'
731 IDD52 = '150mA'
732 IDD3P1 = '1.2mA'
733 IDD3P12 = '8mA'
734 IDD2P1 = '0.6mA'
735 IDD2P12 = '0.8mA'
736 IDD6 = '1mA'
737 IDD62 = '3.2mA'
738 VDD = '1.8V'
739 VDD2 = '1.2V'
740
741 # A single WideIO x128 interface (one command and address bus), with
742 # default timings based on an estimated WIO-200 8 Gbit part.
743 class WideIO_200_1x128(DRAMInterface):
744 # No DLL for WideIO
745 dll = False
746
747 # size of device
748 device_size = '1024MB'
749
750 # 1x128 configuration, 1 device with a 128-bit interface
751 device_bus_width = 128
752
753 # This is a BL4 device
754 burst_length = 4
755
756 # Each device has a page (row buffer) size of 4KB
757 # (this depends on the memory density)
758 device_rowbuffer_size = '4kB'
759
760 # 1x128 configuration, so 1 device
761 devices_per_rank = 1
762
763 # Use one rank for a one-high die stack
764 ranks_per_channel = 1
765
766 # WideIO has 4 banks in all configurations
767 banks_per_rank = 4
768
769 # 200 MHz
770 tCK = '5ns'
771
772 # WIO-200
773 tRCD = '18ns'
774 tCL = '18ns'
775 tRP = '18ns'
776 tRAS = '42ns'
777 tWR = '15ns'
778 # Read to precharge is same as the burst
779 tRTP = '20ns'
780
781 # 4 beats across an x128 SDR interface translates to 4 clocks @ 200 MHz.
782 # Note this is a BL4 SDR device.
783 tBURST = '20ns'
784
785 # WIO 8 Gb
786 tRFC = '210ns'
787
788 # WIO 8 Gb, <=85C, half for >85C
789 tREFI = '3.9us'
790
791 # Greater of 2 CK or 15 ns, 2 CK @ 200 MHz = 10 ns
792 tWTR = '15ns'
793
794 # Default same rank rd-to-wr bus turnaround to 2 CK, @200 MHz = 10 ns
795 tRTW = '10ns'
796
797 # Default different rank bus delay to 2 CK, @200 MHz = 10 ns
798 tCS = '10ns'
799
800 # Activate to activate irrespective of density and speed grade
801 tRRD = '10.0ns'
802
803 # Two instead of four activation window
804 tXAW = '50ns'
805 activation_limit = 2
806
807 # The WideIO specification does not provide current information
808
809 # A single LPDDR3 x32 interface (one command/address bus), with
810 # default timings based on a LPDDR3-1600 4 Gbit part (Micron
811 # EDF8132A1MC) in a 1x32 configuration.
812 class LPDDR3_1600_1x32(DRAMInterface):
813 # No DLL for LPDDR3
814 dll = False
815
816 # size of device
817 device_size = '512MB'
818
819 # 1x32 configuration, 1 device with a 32-bit interface
820 device_bus_width = 32
821
822 # LPDDR3 is a BL8 device
823 burst_length = 8
824
825 # Each device has a page (row buffer) size of 4KB
826 device_rowbuffer_size = '4kB'
827
828 # 1x32 configuration, so 1 device
829 devices_per_rank = 1
830
831 # Technically the datasheet is a dual-rank package, but for
832 # comparison with the LPDDR2 config we stick to a single rank
833 ranks_per_channel = 1
834
835 # LPDDR3 has 8 banks in all configurations
836 banks_per_rank = 8
837
838 # 800 MHz
839 tCK = '1.25ns'
840
841 tRCD = '18ns'
842
843 # 12 CK read latency, 6 CK write latency @ 800 MHz, 1.25 ns cycle time
844 tCL = '15ns'
845
846 tRAS = '42ns'
847 tWR = '15ns'
848
849 # Greater of 4 CK or 7.5 ns, 4 CK @ 800 MHz = 5 ns
850 tRTP = '7.5ns'
851
852 # Pre-charge one bank 18 ns (all banks 21 ns)
853 tRP = '18ns'
854
855 # 8 beats across a x32 DDR interface translates to 4 clocks @ 800 MHz.
856 # Note this is a BL8 DDR device.
857 # Requests larger than 32 bytes are broken down into multiple requests
858 # in the controller
859 tBURST = '5ns'
860
861 # LPDDR3, 4 Gb
862 tRFC = '130ns'
863 tREFI = '3.9us'
864
865 # active powerdown and precharge powerdown exit time
866 tXP = '7.5ns'
867
868 # self refresh exit time
869 tXS = '140ns'
870
871 # Irrespective of speed grade, tWTR is 7.5 ns
872 tWTR = '7.5ns'
873
874 # Default same rank rd-to-wr bus turnaround to 2 CK, @800 MHz = 2.5 ns
875 tRTW = '2.5ns'
876
877 # Default different rank bus delay to 2 CK, @800 MHz = 2.5 ns
878 tCS = '2.5ns'
879
880 # Activate to activate irrespective of density and speed grade
881 tRRD = '10.0ns'
882
883 # Irrespective of size, tFAW is 50 ns
884 tXAW = '50ns'
885 activation_limit = 4
886
887 # Current values from datasheet
888 IDD0 = '8mA'
889 IDD02 = '60mA'
890 IDD2N = '0.8mA'
891 IDD2N2 = '26mA'
892 IDD3N = '2mA'
893 IDD3N2 = '34mA'
894 IDD4W = '2mA'
895 IDD4W2 = '190mA'
896 IDD4R = '2mA'
897 IDD4R2 = '230mA'
898 IDD5 = '28mA'
899 IDD52 = '150mA'
900 IDD3P1 = '1.4mA'
901 IDD3P12 = '11mA'
902 IDD2P1 = '0.8mA'
903 IDD2P12 = '1.8mA'
904 IDD6 = '0.5mA'
905 IDD62 = '1.8mA'
906 VDD = '1.8V'
907 VDD2 = '1.2V'
908
909 # A single GDDR5 x64 interface, with
910 # default timings based on a GDDR5-4000 1 Gbit part (SK Hynix
911 # H5GQ1H24AFR) in a 2x32 configuration.
912 class GDDR5_4000_2x32(DRAMInterface):
913 # size of device
914 device_size = '128MB'
915
916 # 2x32 configuration, 1 device with a 32-bit interface
917 device_bus_width = 32
918
919 # GDDR5 is a BL8 device
920 burst_length = 8
921
922 # Each device has a page (row buffer) size of 2Kbits (256Bytes)
923 device_rowbuffer_size = '256B'
924
925 # 2x32 configuration, so 2 devices
926 devices_per_rank = 2
927
928 # assume single rank
929 ranks_per_channel = 1
930
931 # GDDR5 has 4 bank groups
932 bank_groups_per_rank = 4
933
934 # GDDR5 has 16 banks with 4 bank groups
935 banks_per_rank = 16
936
937 # 1000 MHz
938 tCK = '1ns'
939
940 # 8 beats across an x64 interface translates to 2 clocks @ 1000 MHz
941 # Data bus runs @2000 Mhz => DDR ( data runs at 4000 MHz )
942 # 8 beats at 4000 MHz = 2 beats at 1000 MHz
943 # tBURST is equivalent to the CAS-to-CAS delay (tCCD)
944 # With bank group architectures, tBURST represents the CAS-to-CAS
945 # delay for bursts to different bank groups (tCCD_S)
946 tBURST = '2ns'
947
948 # @1000MHz data rate, tCCD_L is 3 CK
949 # CAS-to-CAS delay for bursts to the same bank group
950 # tBURST is equivalent to tCCD_S; no explicit parameter required
951 # for CAS-to-CAS delay for bursts to different bank groups
952 tCCD_L = '3ns';
953
954 tRCD = '12ns'
955
956 # tCL is not directly found in datasheet and assumed equal tRCD
957 tCL = '12ns'
958
959 tRP = '12ns'
960 tRAS = '28ns'
961
962 # RRD_S (different bank group)
963 # RRD_S is 5.5 ns in datasheet.
964 # rounded to the next multiple of tCK
965 tRRD = '6ns'
966
967 # RRD_L (same bank group)
968 # RRD_L is 5.5 ns in datasheet.
969 # rounded to the next multiple of tCK
970 tRRD_L = '6ns'
971
972 tXAW = '23ns'
973
974 # tXAW < 4 x tRRD.
975 # Therefore, activation limit is set to 0
976 activation_limit = 0
977
978 tRFC = '65ns'
979 tWR = '12ns'
980
981 # Here using the average of WTR_S and WTR_L
982 tWTR = '5ns'
983
984 # Read-to-Precharge 2 CK
985 tRTP = '2ns'
986
987 # Assume 2 cycles
988 tRTW = '2ns'
989
990 # A single HBM x128 interface (one command and address bus), with
991 # default timings based on data publically released
992 # ("HBM: Memory Solution for High Performance Processors", MemCon, 2014),
993 # IDD measurement values, and by extrapolating data from other classes.
994 # Architecture values based on published HBM spec
995 # A 4H stack is defined, 2Gb per die for a total of 1GB of memory.
996 class HBM_1000_4H_1x128(DRAMInterface):
997 # HBM gen1 supports up to 8 128-bit physical channels
998 # Configuration defines a single channel, with the capacity
999 # set to (full_ stack_capacity / 8) based on 2Gb dies
1000 # To use all 8 channels, set 'channels' parameter to 8 in
1001 # system configuration
1002
1003 # 128-bit interface legacy mode
1004 device_bus_width = 128
1005
1006 # HBM supports BL4 and BL2 (legacy mode only)
1007 burst_length = 4
1008
1009 # size of channel in bytes, 4H stack of 2Gb dies is 1GB per stack;
1010 # with 8 channels, 128MB per channel
1011 device_size = '128MB'
1012
1013 device_rowbuffer_size = '2kB'
1014
1015 # 1x128 configuration
1016 devices_per_rank = 1
1017
1018 # HBM does not have a CS pin; set rank to 1
1019 ranks_per_channel = 1
1020
1021 # HBM has 8 or 16 banks depending on capacity
1022 # 2Gb dies have 8 banks
1023 banks_per_rank = 8
1024
1025 # depending on frequency, bank groups may be required
1026 # will always have 4 bank groups when enabled
1027 # current specifications do not define the minimum frequency for
1028 # bank group architecture
1029 # setting bank_groups_per_rank to 0 to disable until range is defined
1030 bank_groups_per_rank = 0
1031
1032 # 500 MHz for 1Gbps DDR data rate
1033 tCK = '2ns'
1034
1035 # use values from IDD measurement in JEDEC spec
1036 # use tRP value for tRCD and tCL similar to other classes
1037 tRP = '15ns'
1038 tRCD = '15ns'
1039 tCL = '15ns'
1040 tRAS = '33ns'
1041
1042 # BL2 and BL4 supported, default to BL4
1043 # DDR @ 500 MHz means 4 * 2ns / 2 = 4ns
1044 tBURST = '4ns'
1045
1046 # value for 2Gb device from JEDEC spec
1047 tRFC = '160ns'
1048
1049 # value for 2Gb device from JEDEC spec
1050 tREFI = '3.9us'
1051
1052 # extrapolate the following from LPDDR configs, using ns values
1053 # to minimize burst length, prefetch differences
1054 tWR = '18ns'
1055 tRTP = '7.5ns'
1056 tWTR = '10ns'
1057
1058 # start with 2 cycles turnaround, similar to other memory classes
1059 # could be more with variations across the stack
1060 tRTW = '4ns'
1061
1062 # single rank device, set to 0
1063 tCS = '0ns'
1064
1065 # from MemCon example, tRRD is 4ns with 2ns tCK
1066 tRRD = '4ns'
1067
1068 # from MemCon example, tFAW is 30ns with 2ns tCK
1069 tXAW = '30ns'
1070 activation_limit = 4
1071
1072 # 4tCK
1073 tXP = '8ns'
1074
1075 # start with tRFC + tXP -> 160ns + 8ns = 168ns
1076 tXS = '168ns'
1077
1078 # A single HBM x64 interface (one command and address bus), with
1079 # default timings based on HBM gen1 and data publically released
1080 # A 4H stack is defined, 8Gb per die for a total of 4GB of memory.
1081 # Note: This defines a pseudo-channel with a unique controller
1082 # instantiated per pseudo-channel
1083 # Stay at same IO rate (1Gbps) to maintain timing relationship with
1084 # HBM gen1 class (HBM_1000_4H_x128) where possible
1085 class HBM_1000_4H_1x64(HBM_1000_4H_1x128):
1086 # For HBM gen2 with pseudo-channel mode, configure 2X channels.
1087 # Configuration defines a single pseudo channel, with the capacity
1088 # set to (full_ stack_capacity / 16) based on 8Gb dies
1089 # To use all 16 pseudo channels, set 'channels' parameter to 16 in
1090 # system configuration
1091
1092 # 64-bit pseudo-channle interface
1093 device_bus_width = 64
1094
1095 # HBM pseudo-channel only supports BL4
1096 burst_length = 4
1097
1098 # size of channel in bytes, 4H stack of 8Gb dies is 4GB per stack;
1099 # with 16 channels, 256MB per channel
1100 device_size = '256MB'
1101
1102 # page size is halved with pseudo-channel; maintaining the same same number
1103 # of rows per pseudo-channel with 2X banks across 2 channels
1104 device_rowbuffer_size = '1kB'
1105
1106 # HBM has 8 or 16 banks depending on capacity
1107 # Starting with 4Gb dies, 16 banks are defined
1108 banks_per_rank = 16
1109
1110 # reset tRFC for larger, 8Gb device
1111 # use HBM1 4Gb value as a starting point
1112 tRFC = '260ns'
1113
1114 # start with tRFC + tXP -> 160ns + 8ns = 168ns
1115 tXS = '268ns'
1116 # Default different rank bus delay to 2 CK, @1000 MHz = 2 ns
1117 tCS = '2ns'
1118 tREFI = '3.9us'
1119
1120 # active powerdown and precharge powerdown exit time
1121 tXP = '10ns'
1122
1123 # self refresh exit time
1124 tXS = '65ns'
1125
1126 # A single LPDDR5 x16 interface (one command/address bus)
1127 # for a single x16 channel with default timings based on
1128 # initial JEDEC specification
1129 # Starting with 5.5Gbps data rates and 8Gbit die
1130 # Configuring for 16-bank mode with bank-group architecture
1131 # burst of 32, which means bursts can be interleaved
1132 class LPDDR5_5500_1x16_BG_BL32(DRAMInterface):
1133
1134 # Increase buffer size to account for more bank resources
1135 read_buffer_size = 64
1136
1137 # Set page policy to better suit DMC Huxley
1138 page_policy = 'close_adaptive'
1139
1140 # 16-bit channel interface
1141 device_bus_width = 16
1142
1143 # LPDDR5 is a BL16 or BL32 device
1144 # With BG mode, BL16 and BL32 are supported
1145 # Use BL32 for higher command bandwidth
1146 burst_length = 32
1147
1148 # size of device in bytes
1149 device_size = '1GB'
1150
1151 # 2kB page with BG mode
1152 device_rowbuffer_size = '2kB'
1153
1154 # Use a 1x16 configuration
1155 devices_per_rank = 1
1156
1157 # Use a single rank
1158 ranks_per_channel = 1
1159
1160 # LPDDR5 supports configurable bank options
1161 # 8B : BL32, all frequencies
1162 # 16B : BL32 or BL16, <=3.2Gbps
1163 # 16B with Bank Group Arch (4B/BG): BL32 or BL16, >3.2Gbps
1164 # Initial configuration will have 16 banks with Bank Group Arch
1165 # to maximim resources and enable higher data rates
1166 banks_per_rank = 16
1167 bank_groups_per_rank = 4
1168
1169 # 5.5Gb/s DDR with 4:1 WCK:CK ratio for 687.5 MHz CK
1170 tCK = '1.455ns'
1171
1172 # Greater of 2 CK or 18ns
1173 tRCD = '18ns'
1174
1175 # Base RL is 16 CK @ 687.5 MHz = 23.28ns
1176 tCL = '23.280ns'
1177
1178 # Greater of 2 CK or 18ns
1179 tRP = '18ns'
1180
1181 # Greater of 3 CK or 42ns
1182 tRAS = '42ns'
1183
1184 # Greater of 3 CK or 34ns
1185 tWR = '34ns'
1186
1187 # active powerdown and precharge powerdown exit time
1188 # Greater of 3 CK or 7ns
1189 tXP = '7ns'
1190
1191 # self refresh exit time (tRFCab + 7.5ns)
1192 tXS = '217.5ns'
1193
1194 # Greater of 2 CK or 7.5 ns minus 2 CK
1195 tRTP = '4.59ns'
1196
1197 # With BG architecture, burst of 32 transferred in two 16-beat
1198 # sub-bursts, with a 16-beat gap in between.
1199 # Each 16-beat sub-burst is 8 WCK @2.75 GHz or 2 CK @ 687.5 MHz
1200 # tBURST is the delay to transfer the Bstof32 = 6 CK @ 687.5 MHz
1201 tBURST = '8.73ns'
1202 # can interleave a Bstof32 from another bank group at tBURST_MIN
1203 # 16-beats is 8 WCK @2.75 GHz or 2 CK @ 687.5 MHz
1204 tBURST_MIN = '2.91ns'
1205 # tBURST_MAX is the maximum burst delay for same bank group timing
1206 # this is 8 CK @ 687.5 MHz
1207 tBURST_MAX = '11.64ns'
1208
1209 # 8 CK @ 687.5 MHz
1210 tCCD_L = "11.64ns"
1211
1212 # LPDDR5, 8 Gbit/channel for 280ns tRFCab
1213 tRFC = '210ns'
1214 tREFI = '3.9us'
1215
1216 # Greater of 4 CK or 6.25 ns
1217 tWTR = '6.25ns'
1218 # Greater of 4 CK or 12 ns
1219 tWTR_L = '12ns'
1220
1221 # Required RD-to-WR timing is RL+ BL/n + tWCKDQ0/tCK - WL
1222 # tWCKDQ0/tCK will be 1 CK for most cases
1223 # For gem5 RL = WL and BL/n is already accounted for with tBURST
1224 # Result is and additional 1 CK is required
1225 tRTW = '1.455ns'
1226
1227 # Default different rank bus delay to 2 CK, @687.5 MHz = 2.91 ns
1228 tCS = '2.91ns'
1229
1230 # 2 CK
1231 tPPD = '2.91ns'
1232
1233 # Greater of 2 CK or 5 ns
1234 tRRD = '5ns'
1235 tRRD_L = '5ns'
1236
1237 # With Bank Group Arch mode tFAW is 20 ns
1238 tXAW = '20ns'
1239 activation_limit = 4
1240
1241 # at 5Gbps, 4:1 WCK to CK ratio required
1242 # 2 data beats per WCK (DDR) -> 8 per CK
1243 beats_per_clock = 8
1244
1245 # 2 cycles required to send activate command
1246 # 2 command phases can be sent back-to-back or
1247 # with a gap up to tAAD = 8 CK
1248 two_cycle_activate = True
1249 tAAD = '11.640ns'
1250
1251 data_clock_sync = True
1252
1253 # A single LPDDR5 x16 interface (one command/address bus)
1254 # for a single x16 channel with default timings based on
1255 # initial JEDEC specification
1256 # Starting with 5.5Gbps data rates and 8Gbit die
1257 # Configuring for 16-bank mode with bank-group architecture, burst of 16
1258 class LPDDR5_5500_1x16_BG_BL16(LPDDR5_5500_1x16_BG_BL32):
1259
1260 # LPDDR5 is a BL16 or BL32 device
1261 # With BG mode, BL16 and BL32 are supported
1262 # Use BL16 for smaller access granularity
1263 burst_length = 16
1264
1265 # For Bstof16 with BG arch, 2 CK @ 687.5 MHz with 4:1 clock ratio
1266 tBURST = '2.91ns'
1267 tBURST_MIN = '2.91ns'
1268 # For Bstof16 with BG arch, 4 CK @ 687.5 MHz with 4:1 clock ratio
1269 tBURST_MAX = '5.82ns'
1270
1271 # 4 CK @ 687.5 MHz
1272 tCCD_L = "5.82ns"
1273
1274
1275 # A single LPDDR5 x16 interface (one command/address bus)
1276 # for a single x16 channel with default timings based on
1277 # initial JEDEC specification
1278 # Starting with 5.5Gbps data rates and 8Gbit die
1279 # Configuring for 8-bank mode, burst of 32
1280 class LPDDR5_5500_1x16_8B_BL32(LPDDR5_5500_1x16_BG_BL32):
1281
1282 # 4kB page with 8B mode
1283 device_rowbuffer_size = '4kB'
1284
1285 # LPDDR5 supports configurable bank options
1286 # 8B : BL32, all frequencies
1287 # 16B : BL32 or BL16, <=3.2Gbps
1288 # 16B with Bank Group Arch (4B/BG): BL32 or BL16, >3.2Gbps
1289 # Select 8B
1290 banks_per_rank = 8
1291 bank_groups_per_rank = 0
1292
1293 # For Bstof32 with 8B mode, 4 CK @ 687.5 MHz with 4:1 clock ratio
1294 tBURST = '5.82ns'
1295 tBURST_MIN = '5.82ns'
1296 tBURST_MAX = '5.82ns'
1297
1298 # Greater of 4 CK or 12 ns
1299 tWTR = '12ns'
1300
1301 # Greater of 2 CK or 10 ns
1302 tRRD = '10ns'
1303
1304 # With 8B mode tFAW is 40 ns
1305 tXAW = '40ns'
1306 activation_limit = 4
1307
1308 # Reset BG arch timing for 8B mode
1309 tCCD_L = "0ns"
1310 tRRD_L = "0ns"
1311 tWTR_L = "0ns"
1312
1313 # A single LPDDR5 x16 interface (one command/address bus)
1314 # for a single x16 channel with default timings based on
1315 # initial JEDEC specification
1316 # 6.4Gbps data rates and 8Gbit die
1317 # Configuring for 16-bank mode with bank-group architecture
1318 # burst of 32, which means bursts can be interleaved
1319 class LPDDR5_6400_1x16_BG_BL32(LPDDR5_5500_1x16_BG_BL32):
1320
1321 # 5.5Gb/s DDR with 4:1 WCK:CK ratio for 687.5 MHz CK
1322 tCK = '1.25ns'
1323
1324 # Base RL is 17 CK @ 800 MHz = 21.25ns
1325 tCL = '21.25ns'
1326
1327 # With BG architecture, burst of 32 transferred in two 16-beat
1328 # sub-bursts, with a 16-beat gap in between.
1329 # Each 16-beat sub-burst is 8 WCK @3.2 GHz or 2 CK @ 800 MHz
1330 # tBURST is the delay to transfer the Bstof32 = 6 CK @ 800 MHz
1331 tBURST = '7.5ns'
1332 # can interleave a Bstof32 from another bank group at tBURST_MIN
1333 # 16-beats is 8 WCK @2.3 GHz or 2 CK @ 800 MHz
1334 tBURST_MIN = '2.5ns'
1335 # tBURST_MAX is the maximum burst delay for same bank group timing
1336 # this is 8 CK @ 800 MHz
1337 tBURST_MAX = '10ns'
1338
1339 # 8 CK @ 800 MHz
1340 tCCD_L = "10ns"
1341
1342 # Required RD-to-WR timing is RL+ BL/n + tWCKDQ0/tCK - WL
1343 # tWCKDQ0/tCK will be 1 CK for most cases
1344 # For gem5 RL = WL and BL/n is already accounted for with tBURST
1345 # Result is and additional 1 CK is required
1346 tRTW = '1.25ns'
1347
1348 # Default different rank bus delay to 2 CK, @687.5 MHz = 2.5 ns
1349 tCS = '2.5ns'
1350
1351 # 2 CK
1352 tPPD = '2.5ns'
1353
1354 # 2 command phases can be sent back-to-back or
1355 # with a gap up to tAAD = 8 CK
1356 tAAD = '10ns'
1357
1358 # A single LPDDR5 x16 interface (one command/address bus)
1359 # for a single x16 channel with default timings based on initial
1360 # JEDEC specifcation
1361 # 6.4Gbps data rates and 8Gbit die
1362 # Configuring for 16-bank mode with bank-group architecture, burst of 16
1363 class LPDDR5_6400_1x16_BG_BL16(LPDDR5_6400_1x16_BG_BL32):
1364
1365 # LPDDR5 is a BL16 or BL32 device
1366 # With BG mode, BL16 and BL32 are supported
1367 # Use BL16 for smaller access granularity
1368 burst_length = 16
1369
1370 # For Bstof16 with BG arch, 2 CK @ 800 MHz with 4:1 clock ratio
1371 tBURST = '2.5ns'
1372 tBURST_MIN = '2.5ns'
1373 # For Bstof16 with BG arch, 4 CK @ 800 MHz with 4:1 clock ratio
1374 tBURST_MAX = '5ns'
1375
1376 # 4 CK @ 800 MHz
1377 tCCD_L = "5ns"
1378
1379
1380 # A single LPDDR5 x16 interface (one command/address bus)
1381 # for a single x16 channel with default timings based on
1382 # initial JEDEC specification
1383 # 6.4Gbps data rates and 8Gbit die
1384 # Configuring for 8-bank mode, burst of 32
1385 class LPDDR5_6400_1x16_8B_BL32(LPDDR5_6400_1x16_BG_BL32):
1386
1387 # 4kB page with 8B mode
1388 device_rowbuffer_size = '4kB'
1389
1390 # LPDDR5 supports configurable bank options
1391 # 8B : BL32, all frequencies
1392 # 16B : BL32 or BL16, <=3.2Gbps
1393 # 16B with Bank Group Arch (4B/BG): BL32 or BL16, >3.2Gbps
1394 # Select 8B
1395 banks_per_rank = 8
1396 bank_groups_per_rank = 0
1397
1398 # For Bstof32 with 8B mode, 4 CK @ 800 MHz with 4:1 clock ratio
1399 tBURST = '5ns'
1400 tBURST_MIN = '5ns'
1401 tBURST_MAX = '5ns'
1402
1403 # Greater of 4 CK or 12 ns
1404 tWTR = '12ns'
1405
1406 # Greater of 2 CK or 10 ns
1407 tRRD = '10ns'
1408
1409 # With 8B mode tFAW is 40 ns
1410 tXAW = '40ns'
1411 activation_limit = 4
1412
1413 # Reset BG arch timing for 8B mode
1414 tCCD_L = "0ns"
1415 tRRD_L = "0ns"
1416 tWTR_L = "0ns"