|
| 1 | +# Copyright (c) 2012-2021 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 | +"""Interfaces for DDR3 memories |
| 42 | +
|
| 43 | +These memory "interfaces" contain the timing, energy, etc. parameters for each |
| 44 | +memory type and are usually based on datasheets for the memory devices. |
| 45 | +
|
| 46 | +You can use these interfaces in the MemCtrl object as the `dram` timing |
| 47 | +interface. |
| 48 | +""" |
| 49 | + |
| 50 | +from m5.objects import DRAMDCInterface |
| 51 | + |
| 52 | + |
| 53 | +class DDR3_1600_8x8(DRAMDCInterface): |
| 54 | + """ |
| 55 | + A single DDR3-1600 x64 channel (one command and address bus), with |
| 56 | + timings based on a DDR3-1600 4 Gbit datasheet (Micron MT41J512M8) in |
| 57 | + an 8x8 configuration. |
| 58 | +
|
| 59 | + """ |
| 60 | + |
| 61 | + # size of device in bytes |
| 62 | + device_size = "512MiB" |
| 63 | + |
| 64 | + # 8x8 configuration, 8 devices each with an 8-bit interface |
| 65 | + device_bus_width = 8 |
| 66 | + |
| 67 | + # DDR3 is a BL8 device |
| 68 | + burst_length = 8 |
| 69 | + |
| 70 | + # Each device has a page (row buffer) size of 1 Kbyte (1K columns x8) |
| 71 | + device_rowbuffer_size = "1KiB" |
| 72 | + |
| 73 | + # 8x8 configuration, so 8 devices |
| 74 | + devices_per_rank = 8 |
| 75 | + |
| 76 | + # Use two ranks |
| 77 | + ranks_per_channel = 2 |
| 78 | + |
| 79 | + # DDR3 has 8 banks in all configurations |
| 80 | + banks_per_rank = 8 |
| 81 | + |
| 82 | + # 800 MHz |
| 83 | + tCK = "1.25ns" |
| 84 | + |
| 85 | + # 8 beats across an x64 interface translates to 4 clocks @ 800 MHz |
| 86 | + tBURST = "5ns" |
| 87 | + |
| 88 | + # DDR3-1600 11-11-11 |
| 89 | + tRCD = "13.75ns" |
| 90 | + tCL = "13.75ns" |
| 91 | + tRP = "13.75ns" |
| 92 | + tRAS = "35ns" |
| 93 | + tRRD = "6ns" |
| 94 | + tXAW = "30ns" |
| 95 | + activation_limit = 4 |
| 96 | + tRFC = "260ns" |
| 97 | + |
| 98 | + tWR = "15ns" |
| 99 | + |
| 100 | + # Greater of 4 CK or 7.5 ns |
| 101 | + tWTR = "7.5ns" |
| 102 | + |
| 103 | + # Greater of 4 CK or 7.5 ns |
| 104 | + tRTP = "7.5ns" |
| 105 | + |
| 106 | + # Default same rank rd-to-wr bus turnaround to 2 CK, @800 MHz = 2.5 ns |
| 107 | + tRTW = "2.5ns" |
| 108 | + |
| 109 | + # Default different rank bus delay to 2 CK, @800 MHz = 2.5 ns |
| 110 | + tCS = "2.5ns" |
| 111 | + |
| 112 | + # <=85C, half for >85C |
| 113 | + tREFI = "7.8us" |
| 114 | + |
| 115 | + # active powerdown and precharge powerdown exit time |
| 116 | + tXP = "6ns" |
| 117 | + |
| 118 | + # self refresh exit time |
| 119 | + tXS = "270ns" |
| 120 | + |
| 121 | + # Current values from datasheet Die Rev E,J |
| 122 | + IDD0 = "55mA" |
| 123 | + IDD2N = "32mA" |
| 124 | + IDD3N = "38mA" |
| 125 | + IDD4W = "125mA" |
| 126 | + IDD4R = "157mA" |
| 127 | + IDD5 = "235mA" |
| 128 | + IDD3P1 = "38mA" |
| 129 | + IDD2P1 = "32mA" |
| 130 | + IDD6 = "20mA" |
| 131 | + VDD = "1.5V" |
| 132 | + |
| 133 | + |
| 134 | +class DDR3_2133_8x8(DDR3_1600_8x8): |
| 135 | + """ |
| 136 | + A single DDR3-2133 x64 channel refining a selected subset of the |
| 137 | + options for the DDR-1600 configuration, based on the same DDR3-1600 |
| 138 | + 4 Gbit datasheet (Micron MT41J512M8). Most parameters are kept |
| 139 | + consistent across the two configurations. |
| 140 | + """ |
| 141 | + |
| 142 | + # 1066 MHz |
| 143 | + tCK = "0.938ns" |
| 144 | + |
| 145 | + # 8 beats across an x64 interface translates to 4 clocks @ 1066 MHz |
| 146 | + tBURST = "3.752ns" |
| 147 | + |
| 148 | + # DDR3-2133 14-14-14 |
| 149 | + tRCD = "13.09ns" |
| 150 | + tCL = "13.09ns" |
| 151 | + tRP = "13.09ns" |
| 152 | + tRAS = "33ns" |
| 153 | + tRRD = "5ns" |
| 154 | + tXAW = "25ns" |
| 155 | + |
| 156 | + # Current values from datasheet |
| 157 | + IDD0 = "70mA" |
| 158 | + IDD2N = "37mA" |
| 159 | + IDD3N = "44mA" |
| 160 | + IDD4W = "157mA" |
| 161 | + IDD4R = "191mA" |
| 162 | + IDD5 = "250mA" |
| 163 | + IDD3P1 = "44mA" |
| 164 | + IDD2P1 = "43mA" |
| 165 | + IDD6 = "20mA" |
| 166 | + VDD = "1.5V" |
0 commit comments