Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0171bc2
repo: created a new branch for review
kaustav-goswami Apr 9, 2024
f401564
ext,config,mem: updated the code for review
kaustav-goswami Apr 11, 2024
688c221
ext,doc: added a documentation and sst-script
kaustav-goswami Apr 11, 2024
e27e690
configs,ext: final touchups for the composable project
kaustav-goswami Apr 22, 2024
2b05d8c
configs: hotfix to include fatal
kaustav-goswami Apr 22, 2024
32bd5d1
doc: updated the documentation
kaustav-goswami Apr 30, 2024
7071c0a
configs: upstreamed experiment scripts (partial)
kaustav-goswami May 3, 2024
223f796
doc: updated the README wtih traffic generator instructions
kaustav-goswami May 3, 2024
c6dc87a
exp: starting to prepare for the experiments
kaustav-goswami May 8, 2024
f589eeb
configs: fixed the system; added an npb script
kaustav-goswami May 10, 2024
16bf9e9
fixed the issues in the main scripts
mbabaie May 10, 2024
e431eb0
temp: uploading to kg to fix ext mem
kaustav-goswami May 11, 2024
c4d8cd6
exp: starting to prepare for the experiments
kaustav-goswami May 8, 2024
695af04
configs: fixed the system; added an npb script
kaustav-goswami May 10, 2024
b4ec774
stats,ext: added new stats in the external memory
kaustav-goswami May 14, 2024
9bec144
shrank the scripts and puut everything in the same dir: disaggdisaggr…
mbabaie May 15, 2024
b62eb9c
merging with latest changes from the repo
mbabaie May 15, 2024
07d32ad
all the shrunk scripts for running stream and npb, with checkpoint or…
mbabaie May 20, 2024
908cf77
ext,mem: Fixed incorrect bandwidth calculation and added a new stat t…
kaustav-goswami May 22, 2024
5f35af5
fixed the remote memory ranges for np apps and added md5sum for resou…
mbabaie May 24, 2024
6618566
Merge branch 'kg/composable-memory-2' of https://github.com/darchr/ge…
mbabaie May 24, 2024
d301960
latest version of scripts for experiments
mbabaie May 28, 2024
2031cb7
x86,ext: added a composable memory board to the repo
kaustav-goswami Jun 29, 2024
fd515c6
config,ext: added a arm shared memory board
kaustav-goswami Aug 28, 2024
c99fc7f
arch-x86,stdlib: updated the x86 main board with madt
kaustav-goswami Sep 18, 2024
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
469 changes: 469 additions & 0 deletions disaggregated_memory/boards/arm_main_board.py

Large diffs are not rendered by default.

596 changes: 596 additions & 0 deletions disaggregated_memory/boards/riscv_main_board.py

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions disaggregated_memory/cachehierarchies/chi_dm_caches.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Copyright (c) 2023-24 The Regents of the University of California
# 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 typing import List

from m5.objects import (
DMASequencer,
RubyPortProxy,
RubySequencer,
RubySystem,
)

from gem5.coherence_protocol import CoherenceProtocol
from gem5.components.boards.abstract_board import AbstractBoard
from gem5.components.cachehierarchies.abstract_cache_hierarchy import (
AbstractCacheHierarchy,
)
from gem5.components.cachehierarchies.chi.nodes.memory_controller import (
MemoryController,
)
from gem5.components.cachehierarchies.chi.private_l1_cache_hierarchy import (
PrivateL1CacheHierarchy,
)
from gem5.isas import ISA
from gem5.utils.override import overrides
from gem5.utils.requires import requires


class PrivateL1DMCacheHierarchy(PrivateL1CacheHierarchy):
def __init__(self, size: str, assoc: int) -> None:
"""
:param size: The size of the priavte I/D caches in the hierarchy.
:param assoc: The associativity of each cache.
"""
super().__init__(size, assoc)

@overrides(PrivateL1CacheHierarchy)
def _create_memory_controllers(
self, board: AbstractBoard
) -> List[MemoryController]:
memory_controllers = []
for rng, port in board.get_mem_ports():
mc = MemoryController(self.ruby_system.network, rng, port)
mc.ruby_system = self.ruby_system
memory_controllers.append(mc)
for rng, port in board.get_remote_mem_ports():
mc = MemoryController(self.ruby_system.network, rng, port)
mc.ruby_system = self.ruby_system
memory_controllers.append(mc)
return memory_controllers
224 changes: 224 additions & 0 deletions disaggregated_memory/cachehierarchies/dm_caches.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
# Copyright (c) 2023 The Regents of the University of California
# 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 cachehierarchies.private_l1_private_l2_shared_l3_cache_hierarchy import (
PrivateL1PrivateL2SharedL3CacheHierarchy,
)

from m5.objects import L2XBar

from gem5.components.boards.abstract_board import AbstractBoard
from gem5.components.cachehierarchies.classic.caches.l1dcache import L1DCache
from gem5.components.cachehierarchies.classic.caches.l1icache import L1ICache
from gem5.components.cachehierarchies.classic.caches.l2cache import L2Cache
from gem5.components.cachehierarchies.classic.caches.mmu_cache import MMUCache
from gem5.components.cachehierarchies.classic.private_l1_private_l2_cache_hierarchy import (
PrivateL1PrivateL2CacheHierarchy,
)
from gem5.isas import ISA
from gem5.utils.override import overrides


class ClassicPrivateL1PrivateL2SharedL3DMCache(
PrivateL1PrivateL2SharedL3CacheHierarchy
):
def __init__(
self,
l1d_size: str,
l1i_size: str,
l2_size: str,
l3_size: str,
l3_assoc: int = 16,
):
super().__init__(
l1d_size=l1d_size,
l1i_size=l1i_size,
l2_size=l2_size,
l3_size=l3_size,
l3_assoc=l3_assoc,
)

@overrides(PrivateL1PrivateL2SharedL3CacheHierarchy)
def incorporate_cache(self, board: AbstractBoard) -> None:
# Set up the system port for functional access from the simulator.
board.connect_system_port(self.membus.cpu_side_ports)

for cntr in board.get_local_memory().get_memory_controllers():
cntr.port = self.membus.mem_side_ports

# The remote memory ports may have additional latency. Therefore, this
# is moved into the board.

self.l1icaches = [
L1ICache(size=self._l1i_size)
for i in range(board.get_processor().get_num_cores())
]
self.l1dcaches = [
L1DCache(size=self._l1d_size)
for i in range(board.get_processor().get_num_cores())
]
self.l2buses = [
L2XBar() for i in range(board.get_processor().get_num_cores())
]
self.l2caches = [
L2Cache(size=self._l2_size)
for i in range(board.get_processor().get_num_cores())
]
self.l3cache = L2Cache(
size=self._l3_size,
assoc=self._l3_assoc,
tag_latency=self._l3_tag_latency,
data_latency=self._l3_data_latency,
response_latency=self._l3_response_latency,
mshrs=self._l3_mshrs,
tgts_per_mshr=self._l3_tgts_per_mshr,
)
# There is only one l3 bus, which connects l3 to the membus
self.l3bus = L2XBar()
# ITLB Page walk caches
self.iptw_caches = [
MMUCache(size="8KiB")
for _ in range(board.get_processor().get_num_cores())
]
# DTLB Page walk caches
self.dptw_caches = [
MMUCache(size="8KiB")
for _ in range(board.get_processor().get_num_cores())
]

if board.has_coherent_io():
self._setup_io_cache(board)

for i, cpu in enumerate(board.get_processor().get_cores()):
cpu.connect_icache(self.l1icaches[i].cpu_side)
cpu.connect_dcache(self.l1dcaches[i].cpu_side)

self.l1icaches[i].mem_side = self.l2buses[i].cpu_side_ports
self.l1dcaches[i].mem_side = self.l2buses[i].cpu_side_ports
self.iptw_caches[i].mem_side = self.l2buses[i].cpu_side_ports
self.dptw_caches[i].mem_side = self.l2buses[i].cpu_side_ports

self.l2buses[i].mem_side_ports = self.l2caches[i].cpu_side

self.l2caches[i].mem_side = self.l3bus.cpu_side_ports

cpu.connect_walker_ports(
self.iptw_caches[i].cpu_side, self.dptw_caches[i].cpu_side
)

if board.get_processor().get_isa() == ISA.X86:
int_req_port = self.membus.mem_side_ports
int_resp_port = self.membus.cpu_side_ports
cpu.connect_interrupt(int_req_port, int_resp_port)
else:
cpu.connect_interrupt()
self.l3bus.mem_side_ports = self.l3cache.cpu_side
self.membus.cpu_side_ports = self.l3cache.mem_side


class ClassicPrivateL1PrivateL2DMCache(PrivateL1PrivateL2CacheHierarchy):
def __init__(
self,
l1d_size: str,
l1i_size: str,
l2_size: str,
) -> None:
"""
:param l1d_size: The size of the L1 Data Cache (e.g., "32kB").
:type l1d_size: str
:param l1i_size: The size of the L1 Instruction Cache (e.g., "32kB").
:type l1i_size: str
:param l2_size: The size of the L2 Cache (e.g., "256kB").
:type l2_size: str
:param membus: The memory bus. This parameter is optional parameter and
will default to a 64 bit width SystemXBar is not specified.
:type membus: BaseXBar
"""
super().__init__(l1i_size, l1d_size, l2_size)

@overrides(PrivateL1PrivateL2CacheHierarchy)
def incorporate_cache(self, board: AbstractBoard) -> None:
# Set up the system port for functional access from the simulator.
board.connect_system_port(self.membus.cpu_side_ports)

for cntr in board.get_local_memory().get_memory_controllers():
cntr.port = self.membus.mem_side_ports

for cntr in board.get_remote_memory().get_memory_controllers():
cntr.port = self.membus.mem_side_ports

self.l1icaches = [
L1ICache(size=self._l1i_size)
for i in range(board.get_processor().get_num_cores())
]
self.l1dcaches = [
L1DCache(size=self._l1d_size)
for i in range(board.get_processor().get_num_cores())
]
self.l2buses = [
L2XBar() for i in range(board.get_processor().get_num_cores())
]
self.l2caches = [
L2Cache(size=self._l2_size)
for i in range(board.get_processor().get_num_cores())
]
# ITLB Page walk caches
self.iptw_caches = [
MMUCache(size="8KiB")
for _ in range(board.get_processor().get_num_cores())
]
# DTLB Page walk caches
self.dptw_caches = [
MMUCache(size="8KiB")
for _ in range(board.get_processor().get_num_cores())
]

if board.has_coherent_io():
self._setup_io_cache(board)

for i, cpu in enumerate(board.get_processor().get_cores()):
cpu.connect_icache(self.l1icaches[i].cpu_side)
cpu.connect_dcache(self.l1dcaches[i].cpu_side)

self.l1icaches[i].mem_side = self.l2buses[i].cpu_side_ports
self.l1dcaches[i].mem_side = self.l2buses[i].cpu_side_ports
self.iptw_caches[i].mem_side = self.l2buses[i].cpu_side_ports
self.dptw_caches[i].mem_side = self.l2buses[i].cpu_side_ports

self.l2buses[i].mem_side_ports = self.l2caches[i].cpu_side

self.membus.cpu_side_ports = self.l2caches[i].mem_side

cpu.connect_walker_ports(
self.iptw_caches[i].cpu_side, self.dptw_caches[i].cpu_side
)

if board.get_processor().get_isa() == ISA.X86:
int_req_port = self.membus.mem_side_ports
int_resp_port = self.membus.cpu_side_ports
cpu.connect_interrupt(int_req_port, int_resp_port)
else:
cpu.connect_interrupt()
Loading