Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c63c554
mem: splitting dram and nvm interfaces into separate files
aakahlow May 4, 2022
3596acf
mem: updates in mem interface to help implement a simple mem ctrl
aakahlow May 4, 2022
8cb47dc
mem: Add a simple mem controller
aakahlow May 4, 2022
7a25b4f
mem: Add mem ctrl
aakahlow May 4, 2022
37af282
mem: Update simple ctrl and mem ctrl
aakahlow May 5, 2022
d584159
mem: Some updates based on comments
aakahlow May 6, 2022
b32d20b
mem: added the remaining of the fixes discussed in comments
mbabaie May 6, 2022
e90cff1
mem: applied the fixes asked for in the comments
mbabaie May 6, 2022
6fba673
mem: update the event handlers
aakahlow May 8, 2022
9cdbf5f
mem: revert back the port's ctrl to a reference
aakahlow May 8, 2022
29208f2
mem: more updates based on PR comments
aakahlow May 9, 2022
35e98b6
mem: all changes before renaming old MemCtrl() to the new naming
mbabaie May 9, 2022
c4df59a
mem: fixed most of renamings and passed all the tests
mbabaie May 9, 2022
8705d3c
mem: resolve pr comments
aakahlow May 13, 2022
2804add
mem: make SimpleMemCtrl dram not have a deault
aakahlow May 13, 2022
4a0d404
mem: fix indendation issues in mem_interface.hh
aakahlow May 13, 2022
1adc731
mem: updating readsWaitingToIssue signature
aakahlow May 13, 2022
b924e9b
mem: fixes in mem_ctrl.cc
aakahlow May 13, 2022
bb2b1c9
mem: remove unwanted import form SimpleMemCtrl.py
aakahlow May 13, 2022
dfe3eb5
mem: remove processNextReq from memctrl
aakahlow May 13, 2022
db63462
mem: some fixes in simpleMemCtrl processNextReqEvent
aakahlow May 13, 2022
8121ed0
mem: remove dram check from SimpleMemCtrl
aakahlow May 13, 2022
fac8020
mem: removing nvm default
aakahlow May 13, 2022
c7260e7
mem: rename MemCtrl to HeteroMemCtrl
aakahlow May 13, 2022
4574d8d
mem: rename SimpleMemCtrl as MemCtrl
aakahlow May 13, 2022
3cfe2c5
mem: small fix
aakahlow May 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configs/common/MemConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def config_mem(options, system):
# Create a controller if not sharing a channel with DRAM
# in which case the controller has already been created
if not opt_hybrid_channel:
mem_ctrl = m5.objects.MemCtrl()
mem_ctrl = m5.objects.HeteroMemCtrl()
mem_ctrl.nvm = nvm_intf

mem_ctrls.append(mem_ctrl)
Expand Down
2 changes: 1 addition & 1 deletion configs/dram/lat_mem_rd.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@

# the following assumes that we are using the native DRAM
# controller, check to be sure
if isinstance(ctrl, m5.objects.MemCtrl):
if isinstance(ctrl, m5.objects.HeteroMemCtrl):
# make the DRAM refresh interval sufficiently infinite to avoid
# latency spikes
ctrl.tREFI = '100s'
Expand Down
22 changes: 11 additions & 11 deletions configs/nvm/sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@
# controller with an NVM interface, check to be sure
if not isinstance(system.mem_ctrls[0], m5.objects.MemCtrl):
fatal("This script assumes the controller is a MemCtrl subclass")
if not isinstance(system.mem_ctrls[0].nvm, m5.objects.NVMInterface):
if not isinstance(system.mem_ctrls[0].dram, m5.objects.NVMInterface):
fatal("This script assumes the memory is a NVMInterface class")

# there is no point slowing things down by saving any data
system.mem_ctrls[0].nvm.null = True
system.mem_ctrls[0].dram.null = True

# Set the address mapping based on input argument
system.mem_ctrls[0].nvm.addr_mapping = args.addr_map
system.mem_ctrls[0].dram.addr_mapping = args.addr_map

# stay in each state for 0.25 ms, long enough to warm things up, and
# short enough to avoid hitting a refresh
Expand All @@ -124,21 +124,21 @@
# the DRAM maximum bandwidth to ensure that it is saturated

# get the number of regions
nbr_banks = system.mem_ctrls[0].nvm.banks_per_rank.value
nbr_banks = system.mem_ctrls[0].dram.banks_per_rank.value

# determine the burst length in bytes
burst_size = int((system.mem_ctrls[0].nvm.devices_per_rank.value *
system.mem_ctrls[0].nvm.device_bus_width.value *
system.mem_ctrls[0].nvm.burst_length.value) / 8)
burst_size = int((system.mem_ctrls[0].dram.devices_per_rank.value *
system.mem_ctrls[0].dram.device_bus_width.value *
system.mem_ctrls[0].dram.burst_length.value) / 8)


# next, get the page size in bytes
buffer_size = system.mem_ctrls[0].nvm.devices_per_rank.value * \
system.mem_ctrls[0].nvm.device_rowbuffer_size.value
buffer_size = system.mem_ctrls[0].dram.devices_per_rank.value * \
system.mem_ctrls[0].dram.device_rowbuffer_size.value

# match the maximum bandwidth of the memory, the parameter is in seconds
# and we need it in ticks (ps)
itt = system.mem_ctrls[0].nvm.tBURST.value * 1000000000000
itt = system.mem_ctrls[0].dram.tBURST.value * 1000000000000

# assume we start at 0
max_addr = mem_range.end
Expand Down Expand Up @@ -179,7 +179,7 @@ def trace():
0, max_addr, burst_size, int(itt), int(itt),
args.rd_perc, 0,
num_seq_pkts, buffer_size, nbr_banks, bank,
addr_map, args.nvm_ranks)
addr_map, args.dram_ranks)
yield system.tgen.createExit(0)

system.tgen.start(trace())
Expand Down
4 changes: 2 additions & 2 deletions configs/nvm/sweep_hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@

# the following assumes that we are using the native controller
# with NVM and DRAM interfaces, check to be sure
if not isinstance(system.mem_ctrls[0], m5.objects.MemCtrl):
fatal("This script assumes the controller is a MemCtrl subclass")
if not isinstance(system.mem_ctrls[0], m5.objects.HeteroMemCtrl):
fatal("This script assumes the controller is a HeteroMemCtrl subclass")
if not isinstance(system.mem_ctrls[0].dram, m5.objects.DRAMInterface):
fatal("This script assumes the first memory is a DRAMInterface subclass")
if not isinstance(system.mem_ctrls[0].nvm, m5.objects.NVMInterface):
Expand Down
2 changes: 1 addition & 1 deletion configs/ruby/GPU_VIPER.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def construct_gpudirs(options, system, ruby_system, network):
int(math.log(options.dgpu_num_dirs, 2)), options.cacheline_size,
xor_low_bit)
if issubclass(mem_type, DRAMInterface):
mem_ctrl = m5.objects.MemCtrl(dram = dram_intf)
mem_ctrl = m5.objects.HeteroMemCtrl(dram = dram_intf)
else:
mem_ctrl = dram_intf

Expand Down
2 changes: 1 addition & 1 deletion src/mem/DRAMInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class PageManage(Enum): vals = ['open', 'open_adaptive', 'close',

class DRAMInterface(MemInterface):
type = 'DRAMInterface'
cxx_header = "mem/mem_interface.hh"
cxx_header = "mem/dram_interface.hh"
cxx_class = 'gem5::memory::DRAMInterface'

# scheduler page policy
Expand Down
56 changes: 56 additions & 0 deletions src/mem/HeteroMemCtrl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright (c) 2012-2020 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.

from m5.params import *
from m5.proxy import *
from m5.objects.MemCtrl import *


# HeteroMemCtrl controls a dram and an nvm interface
# Both memory interfaces share the data and command bus
class HeteroMemCtrl(MemCtrl):
type = 'HeteroMemCtrl'
cxx_header = "mem/hetero_mem_ctrl.hh"
cxx_class = 'gem5::memory::HeteroMemCtrl'

# Interface to nvm memory media
# The dram interface `dram` used by HeteroMemCtrl is defined in
# the MemCtrl
nvm = Param.NVMInterface("NVM memory interface to use")
8 changes: 3 additions & 5 deletions src/mem/MemCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ class MemCtrl(QoSMemCtrl):
# bus in front of the controller for multiple ports
port = ResponsePort("This port responds to memory requests")

# Interface to volatile, DRAM media
dram = Param.DRAMInterface(NULL, "DRAM interface")

# Interface to non-volatile media
nvm = Param.NVMInterface(NULL, "NVM interface")
# Interface to memory media
dram = Param.MemInterface("Memory interface, can be a DRAM"
"or an NVM interface ")

# read and write buffer depths are set in the interface
# the controller will read these values when instantiated
Expand Down
4 changes: 2 additions & 2 deletions src/mem/NVMInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# are modeled without getting into too much detail of the media itself.
class NVMInterface(MemInterface):
type = 'NVMInterface'
cxx_header = "mem/mem_interface.hh"
cxx_header = "mem/nvm_interface.hh"
cxx_class = 'gem5::memory::NVMInterface'

# NVM DIMM could have write buffer to offload writes
Expand Down Expand Up @@ -73,7 +73,7 @@ def controller(self):
the current interface.
"""
controller = MemCtrl()
controller.nvm = self
controller.dram = self
return controller

# NVM delays and device architecture defined to mimic PCM like memory.
Expand Down
7 changes: 6 additions & 1 deletion src/mem/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ SimObject('AddrMapper.py', sim_objects=['AddrMapper', 'RangeAddrMapper'])
SimObject('Bridge.py', sim_objects=['Bridge'])
SimObject('SysBridge.py', sim_objects=['SysBridge'])
DebugFlag('SysBridge')
SimObject('MemCtrl.py', sim_objects=['MemCtrl'], enums=['MemSched'])
SimObject('MemCtrl.py', sim_objects=['MemCtrl'],
enums=['MemSched'])
SimObject('HeteroMemCtrl.py', sim_objects=['HeteroMemCtrl'])
SimObject('MemInterface.py', sim_objects=['MemInterface'], enums=['AddrMap'])
SimObject('DRAMInterface.py', sim_objects=['DRAMInterface'],
enums=['PageManage'])
Expand All @@ -74,7 +76,10 @@ Source('drampower.cc')
Source('external_master.cc')
Source('external_slave.cc')
Source('mem_ctrl.cc')
Source('hetero_mem_ctrl.cc')
Source('mem_interface.cc')
Source('dram_interface.cc')
Source('nvm_interface.cc')
Source('noncoherent_xbar.cc')
Source('packet.cc')
Source('port.cc')
Expand Down
Loading