The purpose of the gem5 components library is to provide gem5 users a standard set of common and useful gem5 components pre-built to add to their experiments. The gem5 components library adopts a modular architecture design with the goal of components being easy to add and remove from designs, and extendable as needed. E.g., any Memory system should be interchangable with any other, and if not a helpful error messages should be raised. Examples of using the gem5 components library can be found in `configs/example/components-library`. Important Disclaimer: This is a pre-alpha release of the gem5 components library. The purpose of this release is to get some community feedback on this new component of gem5. Though some testing has been done, we expect regular fixes and improvements until this is in a stable state. The components library has been formatted with Python Black; typing has been checked with MyPy; and the library has been tested with the scripts in `configs/example/components-libary`. More rigorous tests are to be added in future revisions. More detailed documentation will appear in future revisions. Jira Ticket outlining TODOs and known bugs can be found here: https://gem5.atlassian.net/browse/GEM5-648 Change-Id: I3492ec4a6d8c59ffbae899ce8e87ab4ffb92b976 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47466 Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
155 lines
4.8 KiB
Python
155 lines
4.8 KiB
Python
# Copyright (c) 2012-2021 Arm Limited
|
|
# All rights reserved.
|
|
#
|
|
# The license below extends only to copyright in the software and shall
|
|
# not be construed as granting a license to any other intellectual
|
|
# property including but not limited to intellectual property relating
|
|
# to a hardware implementation of the functionality of the software
|
|
# licensed hereunder. You may use the software subject to the license
|
|
# terms below provided that you ensure that this notice is replicated
|
|
# unmodified and in its entirety in all distributions of the software,
|
|
# modified or unmodified, in source code or in binary form.
|
|
#
|
|
# Copyright (c) 2013 Amin Farmahini-Farahani
|
|
# Copyright (c) 2015 University of Kaiserslautern
|
|
# Copyright (c) 2015 The University of Bologna
|
|
# All rights reserved.
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without
|
|
# modification, are permitted provided that the following conditions are
|
|
# met: redistributions of source code must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer;
|
|
# redistributions in binary form must reproduce the above copyright
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
# documentation and/or other materials provided with the distribution;
|
|
# neither the name of the copyright holders nor the names of its
|
|
# contributors may be used to endorse or promote products derived from
|
|
# this software without specific prior written permission.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
"""Interfaces for LPDDR2 memory devices
|
|
|
|
These memory "interfaces" contain the timing,energy,etc parameters for each
|
|
memory type and are usually based on datasheets for the memory devices.
|
|
|
|
You can use these interfaces in the MemCtrl object as the `dram` timing
|
|
interface.
|
|
"""
|
|
|
|
from m5.objects import DRAMInterface
|
|
|
|
|
|
class LPDDR2_S4_1066_1x32(DRAMInterface):
|
|
"""
|
|
A single LPDDR2-S4 x32 interface (one command/address bus), with
|
|
default timings based on a LPDDR2-1066 4 Gbit part (Micron MT42L128M32D1)
|
|
in a 1x32 configuration.
|
|
"""
|
|
|
|
# No DLL in LPDDR2
|
|
dll = False
|
|
|
|
# size of device
|
|
device_size = "512MiB"
|
|
|
|
# 1x32 configuration, 1 device with a 32-bit interface
|
|
device_bus_width = 32
|
|
|
|
# LPDDR2_S4 is a BL4 and BL8 device
|
|
burst_length = 8
|
|
|
|
# Each device has a page (row buffer) size of 1KB
|
|
# (this depends on the memory density)
|
|
device_rowbuffer_size = "1KiB"
|
|
|
|
# 1x32 configuration, so 1 device
|
|
devices_per_rank = 1
|
|
|
|
# Use a single rank
|
|
ranks_per_channel = 1
|
|
|
|
# LPDDR2-S4 has 8 banks in all configurations
|
|
banks_per_rank = 8
|
|
|
|
# 533 MHz
|
|
tCK = "1.876ns"
|
|
|
|
# Fixed at 15 ns
|
|
tRCD = "15ns"
|
|
|
|
# 8 CK read latency, 4 CK write latency @ 533 MHz, 1.876 ns cycle time
|
|
tCL = "15ns"
|
|
|
|
# Pre-charge one bank 15 ns (all banks 18 ns)
|
|
tRP = "15ns"
|
|
|
|
tRAS = "42ns"
|
|
tWR = "15ns"
|
|
|
|
tRTP = "7.5ns"
|
|
|
|
# 8 beats across an x32 DDR interface translates to 4 clocks @ 533 MHz.
|
|
# Note this is a BL8 DDR device.
|
|
# Requests larger than 32 bytes are broken down into multiple requests
|
|
# in the controller
|
|
tBURST = "7.5ns"
|
|
|
|
# LPDDR2-S4, 4 Gbit
|
|
tRFC = "130ns"
|
|
tREFI = "3.9us"
|
|
|
|
# active powerdown and precharge powerdown exit time
|
|
tXP = "7.5ns"
|
|
|
|
# self refresh exit time
|
|
tXS = "140ns"
|
|
|
|
# Irrespective of speed grade, tWTR is 7.5 ns
|
|
tWTR = "7.5ns"
|
|
|
|
# Default same rank rd-to-wr bus turnaround to 2 CK, @533 MHz = 3.75 ns
|
|
tRTW = "3.75ns"
|
|
|
|
# Default different rank bus delay to 2 CK, @533 MHz = 3.75 ns
|
|
tCS = "3.75ns"
|
|
|
|
# Activate to activate irrespective of density and speed grade
|
|
tRRD = "10.0ns"
|
|
|
|
# Irrespective of density, tFAW is 50 ns
|
|
tXAW = "50ns"
|
|
activation_limit = 4
|
|
|
|
# Current values from datasheet
|
|
IDD0 = "15mA"
|
|
IDD02 = "70mA"
|
|
IDD2N = "2mA"
|
|
IDD2N2 = "30mA"
|
|
IDD3N = "2.5mA"
|
|
IDD3N2 = "30mA"
|
|
IDD4W = "10mA"
|
|
IDD4W2 = "190mA"
|
|
IDD4R = "3mA"
|
|
IDD4R2 = "220mA"
|
|
IDD5 = "40mA"
|
|
IDD52 = "150mA"
|
|
IDD3P1 = "1.2mA"
|
|
IDD3P12 = "8mA"
|
|
IDD2P1 = "0.6mA"
|
|
IDD2P12 = "0.8mA"
|
|
IDD6 = "1mA"
|
|
IDD62 = "3.2mA"
|
|
VDD = "1.8V"
|
|
VDD2 = "1.2V"
|