Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TESTING #264

Open
wants to merge 279 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
279 commits
Select commit Hold shift + click to select a range
6ef32d4
Bug fix. Very close to first compilation.
mahyarsamani Feb 16, 2022
14ca405
More bug fixes.
mahyarsamani Feb 16, 2022
df282dd
Compilation. yeay.
mahyarsamani Feb 16, 2022
ed22547
Fixing a typo.
mahyarsamani Feb 16, 2022
1a87fc9
Restructuring the directory.
mahyarsamani Feb 18, 2022
254dd92
Restructing the classes.
marjanfariborz Feb 20, 2022
2c27ec0
Sperating WLEngine and BaseWLEngine + few changes in BaseApplyEngine
marjanfariborz Feb 20, 2022
73a55cd
Restructuring classes.
mahyarsamani Feb 20, 2022
bb54ba5
Adding RequestorID
marjanfariborz Feb 20, 2022
3f666de
Definining MPU interfaces.
mahyarsamani Feb 20, 2022
bf317d6
Adding changes to ApplyEngine and WLEngine
marjanfariborz Feb 20, 2022
f3e7206
Finished restructured for ApplyE and WLE, pre-compiled
marjanfariborz Feb 21, 2022
a0736d5
Finished restructure for PushEngine. Pre-compile.
mahyarsamani Feb 21, 2022
d700e45
Debugging.
marjanfariborz Feb 21, 2022
99ada0f
Lots of debugging.
mahyarsamani Feb 21, 2022
7afc5fc
Style fix.
mahyarsamani Feb 21, 2022
8319d4a
Adding PARAMS macro.
mahyarsamani Feb 21, 2022
77d8e1a
First compilation after restructure.
mahyarsamani Feb 21, 2022
196679c
Adding config file for SEGA and missing ports.
mahyarsamani Feb 22, 2022
d5eb804
Adding BaseEngine class and started pointer fix.
mahyarsamani Feb 22, 2022
422248c
Cont. fixing pointer issue.
mahyarsamani Feb 23, 2022
dfb1ce2
Cont. fix pointer issue.
mahyarsamani Feb 23, 2022
f4473eb
Cont. fix pointer issue. MemQ to BaseEngine.
mahyarsamani Feb 23, 2022
e5de463
Pointer issue fixed.
mahyarsamani Feb 23, 2022
0bf910b
Adding BaseEngine to SConscript.
mahyarsamani Feb 23, 2022
0415b96
Compilation issues fixed. Still linking issues.
mahyarsamani Feb 23, 2022
74575ea
Removing unnecessary includes.
mahyarsamani Feb 23, 2022
91e3047
Fixing the issue of calling pure virtual function.
mahyarsamani Feb 23, 2022
22d0fba
Fixed cycle in hierarchy and config. Sim starts.
mahyarsamani Feb 24, 2022
9e74f27
Started fixing memory leak.
mahyarsamani Feb 24, 2022
a93ce61
Adding newlines.
mahyarsamani Feb 24, 2022
e45304a
Removed the UpdateWL from the MemCmd.
marjanfariborz Feb 24, 2022
6ad40e3
Adding initial update. Fixing some bugs.
mahyarsamani Feb 25, 2022
8c2e290
Adding few debugging flags.
marjanfariborz Feb 25, 2022
5e34439
Adding lock_dir.
mahyarsamani Feb 28, 2022
fb21094
Debugging
marjanfariborz Feb 28, 2022
6d40759
More debugging.
mahyarsamani Feb 28, 2022
bda63d5
Fixed the bugs. Simulation is an endless loop.
mahyarsamani Mar 1, 2022
034fa1f
Debugged: Releases the address when the memory is blocked.
marjanfariborz Mar 1, 2022
99c512c
Adding coalescer to the code.
mahyarsamani Mar 22, 2022
2771b72
Finalizing source code. Before compile.
marjanfariborz Mar 22, 2022
c0beedd
Compiles.
marjanfariborz Mar 23, 2022
c879b21
Debugging after compilation. Loop writting to mem
mahyarsamani Mar 23, 2022
2f106dd
Correctness tested with small graph.
mahyarsamani Mar 23, 2022
ea912f9
Added performance statistics.
marjanfariborz Mar 23, 2022
a3dd0fe
Updating definitions for structs and removing unnecessary funcs.
mahyarsamani Mar 31, 2022
7570393
Fixing base_edge_addr in config and debugs.
mahyarsamani Apr 1, 2022
179340c
Changing queue to deque
marjanfariborz Apr 1, 2022
d654ddb
Removing old files and renaming utils to data_structs.
mahyarsamani Apr 1, 2022
dde65c8
Fixing bugs.
mahyarsamani Apr 1, 2022
71c6b5d
Updating createUpdatePacket.
mahyarsamani Apr 3, 2022
95cf1b8
Adding retry to wle respPort and debug.
mahyarsamani Apr 4, 2022
af47d0a
Debugging coalesce engine deadlock.
mahyarsamani Apr 5, 2022
98b03f4
Restructing inheritance and fixiing inf queue.
mahyarsamani Apr 7, 2022
e1a4281
Fixing one scheduling error in events.
mahyarsamani Apr 8, 2022
7a9be5b
Works!!!!!!
mahyarsamani Apr 10, 2022
4e79e41
Removing SystemXBar from config script. [has-bug]
mahyarsamani Apr 12, 2022
75c36e6
Fixing the bug when deallocating a taken line.
mahyarsamani Apr 13, 2022
3fba566
Parameterizing cache_size and memory_atom_size.
mahyarsamani Apr 13, 2022
8c3e777
Renaming BaseReadEngine to BaseMemEngine.
mahyarsamani Apr 13, 2022
08dc5d0
Adding a new SConscript for src/accl.
mahyarsamani Apr 13, 2022
be06d12
Fixing stats and adding a few new ones.
mahyarsamani Apr 13, 2022
0b4177e
Fixing memory atom size issue.
mahyarsamani Apr 15, 2022
d951956
Removing dead code.
mahyarsamani Apr 17, 2022
96761b6
[WIP] added the central control unit.
marjanfariborz Apr 19, 2022
311062b
Adding UpdateWL as a MemCmd and fixing code.
mahyarsamani Apr 22, 2022
620f101
A little bit of debugging and updating config script.
mahyarsamani Apr 25, 2022
6a9aa29
Adding initState to CenteralController.
mahyarsamani Apr 25, 2022
2715f74
Changing debug flag for CenteralController.
mahyarsamani Apr 29, 2022
a6542d9
Fixing a bug and adding new stats.
mahyarsamani May 3, 2022
1d6d99b
Fixing double evicts.
mahyarsamani May 17, 2022
8aedc2d
Fixing false dependency and deadlock issues. wip.
mahyarsamani May 19, 2022
4143b56
Decoupling apply and evict. Done.
mahyarsamani May 19, 2022
72e1339
Fixed miss-deallocation bug. Hopefully.
mahyarsamani May 20, 2022
83cb67a
Correctness passed with finite push queue and facebook graph.
mahyarsamani May 22, 2022
c79edd7
Fixing an incorrect assertion.
mahyarsamani May 23, 2022
5e28bea
Converting apply and evict queues to FIFOSet.
mahyarsamani Jun 3, 2022
80e3758
Moving delete pkt in push_engine.cc.
mahyarsamani Jun 13, 2022
6c706e0
Enforced limited length on memRespQueue in PushEngine.
mahyarsamani Jun 19, 2022
74afbe4
Adding bit vector implementation for caching push meta data.
mahyarsamani Jul 8, 2022
b77bc19
Completing retry between coalesce and push engine.
mahyarsamani Jul 17, 2022
5742163
Updating variable names and debug flags.
mahyarsamani Jul 19, 2022
ebcf6b8
Somewhat fixing the correctness.
mahyarsamani Jul 19, 2022
ca7eb6c
Almost fixed retry bugs. 14 wrong vertices in lj.
mahyarsamani Jul 20, 2022
ec9b0e8
Deleting comments and updating config.
mahyarsamani Jul 20, 2022
6a3fea5
Adding a new debug print.
mahyarsamani Jul 20, 2022
6ee0b0f
Updating debug flags. Adding one per comp.
mahyarsamani Jul 20, 2022
5ebb51d
Removing accidentally commented out wrong code.
mahyarsamani Jul 20, 2022
4946d9a
Adding in between counter for retry.
mahyarsamani Jul 21, 2022
42ca800
Fixing the retry mechanism.
mahyarsamani Jul 22, 2022
1783648
Limiting retries to one.
mahyarsamani Jul 23, 2022
11777e3
Adding MemoryEvent class and nextReadOnMissEvent.
mahyarsamani Jul 24, 2022
f47a3f1
Restructuring events and adding nextWriteBackEvent.
mahyarsamani Jul 24, 2022
66f146d
Implemented MemoryEvent retry mechanism.
mahyarsamani Jul 24, 2022
26f18a4
Adding DPRINTF for structure sizes.
mahyarsamani Jul 25, 2022
2cf0bbd
Updating config script for sega.
mahyarsamani Jul 25, 2022
252cb70
Adding more assertion for MSHR and fillQueue.
marjanfariborz Jul 25, 2022
f93dbc1
Adding debug flags for responseQueue size.
marjanfariborz Jul 25, 2022
744e4f3
Adding assertions to test the size of queues in coalesce engine.
marjanfariborz Jul 25, 2022
9fb9943
Checking the size of queues in PushEngine and WLEngine
marjanfariborz Jul 25, 2022
2787e47
Making CoalesceEngine a BaseMemoryEngine.
mahyarsamani Jul 25, 2022
d437ddf
Fixing cache mapping issue.
mahyarsamani Jul 25, 2022
4f431ae
Refactoring PushEngine to inherit from BaseMemoryEngine.
mahyarsamani Jul 26, 2022
4f1c302
Refactored PushEngine to inherit from BaseMemoryEngine.
mahyarsamani Jul 26, 2022
3642de0
Making bit vector smaller and choosing slices faster.
mahyarsamani Jul 26, 2022
94da460
Merging all memory interactions into one event.
mahyarsamani Jul 28, 2022
0b726a7
Adding more dprintfs.
mahyarsamani Jul 29, 2022
14d331e
Fixing cache block state machine. wip.
mahyarsamani Jul 29, 2022
30e94f3
Fixing cache block state machine. cont. wip
mahyarsamani Jul 31, 2022
32385c4
Completed cache block state machine. Needs rework of push interface.
mahyarsamani Jul 31, 2022
aa08cf5
Fixing scheduling error of memory functions.
mahyarsamani Aug 3, 2022
0279e8a
Fixing incorrect assert.
mahyarsamani Aug 3, 2022
15c5d55
Updating memory address mapping and interface for push coalesce.
mahyarsamani Aug 5, 2022
ef1606c
Implemented pullVertex.
mahyarsamani Aug 12, 2022
b734fb8
Added sim exit functionality. WIP
mahyarsamani Aug 22, 2022
3ab8666
Adding a DDR model to the accelerator
marjanfariborz Aug 26, 2022
6ecdecb
Completed sim exit. I think...
mahyarsamani Aug 29, 2022
3bb95d0
Minor improvements in the code.
mahyarsamani Sep 2, 2022
f493fc5
Added HBM as vertex memory. It doesn't exit!
marjanfariborz Sep 2, 2022
f580571
Adding Real memory for EM
marjanfariborz Sep 2, 2022
0031a84
Fixing style.
mahyarsamani Sep 2, 2022
3fb094d
Khoshgelation.
mahyarsamani Sep 2, 2022
079a873
Adding new stats.
mahyarsamani Sep 2, 2022
106e4c3
Fixing asserion error on busyMask.
mahyarsamani Sep 5, 2022
f56df58
Fixing finding work in coalesce engine.
marjanfariborz Sep 5, 2022
164f423
Fixing choosing work in coalesce engine.
mahyarsamani Sep 6, 2022
20a902e
Adding support for synthetic traffic
marjanfariborz Jul 28, 2022
3a926e4
Adding workload as a parameter
marjanfariborz Jul 28, 2022
ba6cd3d
Adding workload as a parameter to coalesce engine.
mahyarsamani Sep 7, 2022
a292970
Adding stats.
mahyarsamani Sep 8, 2022
2c7a9dd
Separating graph generation from run script.
mahyarsamani Sep 11, 2022
1e06db5
Adding new stats.
mahyarsamani Sep 12, 2022
a82ff6d
Fixing sconscript style.
mahyarsamani Sep 14, 2022
8ef7013
Adding stats for measuring push and pull rate.
mahyarsamani Sep 15, 2022
2a6bea7
Added FinalAnswer debugFlag and answer printing.
mahyarsamani Sep 16, 2022
59400e0
Adding stats to measure vertexReadLatency.
mahyarsamani Sep 19, 2022
94752ea
Adding a config script with simple memory
mahyarsamani Sep 19, 2022
dda4f4f
Adding stats to count the result of bitvector search.
marjanfariborz Sep 20, 2022
58ba502
Adding a stat to count number of idle cycles.
mahyarsamani Sep 22, 2022
3bb5376
Adding stats to measure queueing latencies.
mahyarsamani Sep 23, 2022
63a69c5
Added pybindmethod to createInitialUpdate. merge added.
mahyarsamani Sep 26, 2022
3f002a4
Adding stat to measure response latency.
mahyarsamani Sep 26, 2022
1b5fb0c
Adding stats to count model inaccuracies.
mahyarsamani Sep 27, 2022
dbcfad0
style fix.
mahyarsamani Sep 29, 2022
884117a
Adding multiple queues and ports in pushEngine
marjanfariborz Sep 28, 2022
51e9475
Changing propagate function
marjanfariborz Sep 28, 2022
e71353b
Pushing on Marjan's behalf, refactored out_port to vector-port.
mahyarsamani Sep 29, 2022
ddefa3a
Attempting to add multi-inports to MPU
marjanfariborz Sep 30, 2022
da1584b
Moving reqPorts from MPU to PushEngine
marjanfariborz Oct 3, 2022
8829d55
Moving respPorts from MPU to WLEngine
marjanfariborz Oct 3, 2022
e14d4ad
Updating dprintfs.
mahyarsamani Oct 3, 2022
8c0146a
Fixing the problems with retry
marjanfariborz Oct 4, 2022
020ebf7
Fixing done, code style and conifg. Adding a stat.
mahyarsamani Oct 4, 2022
f2735fe
Back indent.
mahyarsamani Oct 6, 2022
9179026
Fixed HBM range issue.
mahyarsamani Oct 7, 2022
2eb7732
Refactoring reading edges from memory
marjanfariborz Oct 7, 2022
fdc455a
Added statistics to calculate number of propagates sent
marjanfariborz Oct 7, 2022
876670c
Adding coalescing to pushEngine
marjanfariborz Oct 8, 2022
cae9309
Adding function to print final answer.
mahyarsamani Oct 9, 2022
714f5c3
Typos.
mahyarsamani Oct 10, 2022
8605159
Adding functions to move value to and from float.
mahyarsamani Oct 11, 2022
b33e951
Adding sssp and pr.
marjanfariborz Oct 11, 2022
e404933
making workload appropriate inits
marjanfariborz Oct 12, 2022
56007c9
wip for implementing prewB and prePush apply functions.
mahyarsamani Oct 12, 2022
2dd3d4d
Adding GraphWorkload class.
marjanfariborz Oct 14, 2022
718a837
Cleaning up.
mahyarsamani Oct 15, 2022
dd9cebb
Implementing post push wb buffer.
mahyarsamani Oct 17, 2022
31458d9
Implementing correction function for PushEngine.
mahyarsamani Oct 17, 2022
a0064f1
Adding initialization to graphWorkloads
marjanfariborz Oct 19, 2022
2ea00f9
Fixing algo start issue.
marjanfariborz Oct 22, 2022
0ef4d5e
Fixing block addr initialization.
mahyarsamani Oct 22, 2022
aa6fb7d
Adding PR.
mahyarsamani Oct 24, 2022
ac64518
Prepping for PR.
mahyarsamani Oct 24, 2022
a839eaa
Adding print function to GraphWorkload class.
mahyarsamani Oct 25, 2022
76cf9de
Updating PR
marjanfariborz Oct 25, 2022
8952187
Updating configs for pr and bfs. Fixing bugs for pr.
mahyarsamani Oct 26, 2022
c12acb8
Fixing typos.
mahyarsamani Oct 26, 2022
ae87291
Adding sample script.
mahyarsamani Oct 27, 2022
f0dc01e
Fixing sim performance issue.
mahyarsamani Oct 28, 2022
b5a8075
Fixing write miss issue.
mahyarsamani Oct 31, 2022
e459799
Restructuring the cache.
mahyarsamani Nov 1, 2022
ebe3fc1
First working and tested version of workdirectory.
mahyarsamani Nov 7, 2022
c24c8f8
Adding new stats.
mahyarsamani Nov 8, 2022
a86d7b1
Adding state.
mahyarsamani Nov 8, 2022
e38b1c0
Adding stat to count number of conflict misses.
mahyarsamani Nov 8, 2022
614ba92
Adding stat to count the number of update rolls.
mahyarsamani Nov 8, 2022
c38cab0
Removing unnecessary comments.
mahyarsamani Nov 9, 2022
1169c19
Removing comments.
mahyarsamani Nov 9, 2022
a98dd0f
Adding pr and updating config scripts.
mahyarsamani Nov 9, 2022
b3d678a
Updating activeCondition for PR.
mahyarsamani Nov 10, 2022
e3ef860
Adding SSSP and CC
marjanfariborz Nov 13, 2022
c56b386
Adding option to use SimpleMemory for vertex memory.
mahyarsamani Nov 11, 2022
6e749d3
Removing graph gen scripts and moved to sega-utils.
mahyarsamani Nov 12, 2022
51b12cd
Adding BSP mode.
mahyarsamani Nov 12, 2022
7ce7ef9
Fixing enums
mahyarsamani Nov 12, 2022
27ee07a
Further fixes for enums.
mahyarsamani Nov 12, 2022
97ff473
Fixing typos
mahyarsamani Nov 12, 2022
54a0df2
Fixing typos.
mahyarsamani Nov 12, 2022
65e203d
Fixing typos.
mahyarsamani Nov 12, 2022
2381680
Debug.
mahyarsamani Nov 12, 2022
a2f76f6
Debugging.
mahyarsamani Nov 12, 2022
991d2db
Typos.
mahyarsamani Nov 12, 2022
90641ab
Debugging.
mahyarsamani Nov 12, 2022
f94a1db
Finalizing bsp and pr.
mahyarsamani Nov 13, 2022
1bbb4c7
Fixing a bug in async mode.
mahyarsamani Nov 13, 2022
8ea1b02
Debugging and removing typos. sega-ddr represent correct system config.
mahyarsamani Nov 14, 2022
442c106
Debugging, finalizing the config and merging new workloads.
mahyarsamani Nov 14, 2022
5b132e2
Fixing port proxy bug of limiting size to int.
mahyarsamani Nov 14, 2022
e554060
Fixing postConsumeProcess.
mahyarsamani Nov 14, 2022
d1742f7
Addding BC.
mahyarsamani Nov 15, 2022
778c75b
Adding BC and degbugging.
mahyarsamani Nov 15, 2022
492ccc0
Fixing BC run script.
mahyarsamani Nov 15, 2022
f714d88
Fixing dirty issue in bsp.
mahyarsamani Nov 17, 2022
a342da4
Adding Async PR.
mahyarsamani Nov 18, 2022
a0406ed
Fixing typos.
mahyarsamani Nov 18, 2022
72567c4
Fixing init in asyncPR.
marjanfariborz Feb 7, 2023
b56fe04
Improving UniqueFIFO implementation.
mahyarsamani Mar 9, 2023
bdec32a
Improving sim performance for push engine.
mahyarsamani Mar 21, 2023
8e13459
Randomizing retry sending order.
mahyarsamani Mar 29, 2023
63245ec
mem: HBMCtrl changes to allow PC data buses to be in different states
aakahlow Nov 10, 2022
76a12f1
Improving wlengine model.
mahyarsamani Mar 29, 2023
540694b
Improving vertex access time by improving updateQeueu reads + more stats
marjanfariborz Apr 1, 2023
edeae08
Cleaning up wl_engine.cc
mahyarsamani Apr 1, 2023
feedf20
Fixing = operator for UniqueFIFO.
mahyarsamani Apr 3, 2023
850d452
Fixing a typo.
mahyarsamani Apr 5, 2023
0180566
Updating wl_engine stats. Adding colaescing to update queue.
mahyarsamani Apr 6, 2023
121c824
Adding number of transitions.
mahyarsamani Apr 7, 2023
25b6f1f
Improving the performance of pushEngine.
marjanfariborz Apr 10, 2023
7521e84
Initial commit for PG.
mahyarsamani Apr 5, 2023
5e3a809
Fixing typo in centeral controller.
mahyarsamani Apr 5, 2023
c16ff96
Updating centeral controller.
mahyarsamani Apr 7, 2023
8fa233d
Completing temporal partitioning.
mahyarsamani Apr 12, 2023
d87e030
Cleaning up and merging temp partition.
mahyarsamani Apr 12, 2023
791d9af
Updating config scripts.
mahyarsamani Apr 12, 2023
d126c24
Adding stats to centeral controller.
mahyarsamani Apr 14, 2023
f710081
Updating choosing next slice.
mahyarsamani Apr 14, 2023
1205dba
Fixing choosing next slice.
mahyarsamani Apr 14, 2023
c949bab
Fixing sign extend issue when address is bigger than 2GB.
mahyarsamani Apr 18, 2023
5a0f709
Fixing the packet size issue.
mahyarsamani Apr 18, 2023
40497bb
Fixing overflow issue with counting the number of bytes.
mahyarsamani Apr 26, 2023
0d370e7
Bunch of stuff
mahyarsamani Jul 26, 2023
9a6b65f
Fixing compilation issues after rebasing.
mahyarsamani Aug 18, 2023
8f49979
Cleaning up the config files
marjanfariborz Aug 21, 2023
ee1058c
Fixing the memory controller segmentation fault
marjanfariborz Aug 21, 2023
276dc58
Adding a stat to count the number of activations.
mahyarsamani Aug 23, 2023
8677727
Enable edge mem init through central controller.
mahyarsamani May 16, 2024
412915f
Adding actual write call.
mahyarsamani May 16, 2024
c3c2d61
ready to push changes
Jun 20, 2024
62bd78e
Enabling disagg sega
Jun 20, 2024
240ad42
added stats to track round trip edge memory lat and outstandingEdgeMe…
Jun 22, 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
280 changes: 280 additions & 0 deletions configs/accl/archived/sega_detailed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
# Copyright (c) 2022 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 math import log
from m5.objects import *


def interleave_addresses(plain_range, num_channels, cache_line_size):
intlv_low_bit = log(cache_line_size, 2)
intlv_bits = log(num_channels, 2)
ret = []
for i in range(num_channels):
ret.append(
AddrRange(
start=plain_range.start,
size=plain_range.size(),
intlvHighBit=intlv_low_bit + intlv_bits - 1,
xorHighBit=0,
intlvBits=intlv_bits,
intlvMatch=i,
)
)
return ret, intlv_low_bit + intlv_bits - 1


class GPT(SubSystem):
def __init__(self, register_file_size: int, cache_size: str):
super().__init__()
self.wl_engine = WLEngine(
update_queue_size=64,
register_file_size=register_file_size,
examine_window=8,
rd_per_cycle=4,
reduce_per_cycle=32,
wr_per_cycle=4,
)
self.coalesce_engine = CoalesceEngine(
attached_memory_atom_size=32,
cache_size=cache_size,
max_resp_per_cycle=8,
pending_pull_limit=64,
active_buffer_size=80,
post_push_wb_queue_size=64,
transitions_per_cycle=4,
)
self.push_engine = PushEngine(
push_req_queue_size=32,
attached_memory_atom_size=64,
resp_queue_size=1024,
examine_window=12,
max_propagates_per_cycle=8,
update_queue_size=64,
)

self.vertex_mem_ctrl = HBMCtrl(
dram=HBM_2000_4H_1x64(),
dram_2=HBM_2000_4H_1x64(),
)
self.coalesce_engine.mem_port = self.vertex_mem_ctrl.port

self.mpu = MPU(
wl_engine=self.wl_engine,
coalesce_engine=self.coalesce_engine,
push_engine=self.push_engine,
)

def getRespPort(self):
return self.wl_engine.in_ports

def setRespPort(self, port):
self.wl_engine.in_ports = port

def getReqPort(self):
return self.push_engine.out_ports

def setReqPort(self, port):
self.push_engine.out_ports = port

def getEdgeMemPort(self):
return self.push_engine.mem_port

def setEdgeMemPort(self, port):
self.push_engine.mem_port = port

def set_vertex_range(self, vertex_ranges):
self.vertex_mem_ctrl.dram.range = vertex_ranges[0]
self.vertex_mem_ctrl.dram_2.range = vertex_ranges[1]

def set_vertex_pch_bit(self, pch_bit):
self.vertex_mem_ctrl.pch_bit = pch_bit


class EdgeMemory(SubSystem):
def __init__(self, size: str):
super(EdgeMemory, self).__init__()
self.clk_domain = SrcClockDomain()
self.clk_domain.clock = "2.4GHz"
self.clk_domain.voltage_domain = VoltageDomain()

self.mem_ctrl = MemCtrl(
dram=DDR4_2400_8x8(range=AddrRange(size), in_addr_map=False)
)
self.xbar = NoncoherentXBar(
width=64, frontend_latency=1, forward_latency=1, response_latency=1
)
self.xbar.mem_side_ports = self.mem_ctrl.port

def set_image(self, image):
self.mem_ctrl.dram.image_file = image

def getPort(self):
return self.xbar.cpu_side_ports

def setPort(self, port):
self.xbar.cpu_side_ports = port


class SEGAController(SubSystem):
def __init__(self, mirror_bw):
super().__init__()
self.map_mem = SimpleMemory(
latency="0ns",
latency_var="0ns",
bandwidth="1024GiB/s",
range=AddrRange(start=0, size="4GiB"),
in_addr_map=False,
)
self.controller = CenteralController(
choose_best=False,
mirrors_mem=SimpleMemory(
latency="0ns",
latency_var="0ns",
bandwidth=mirror_bw,
range=AddrRange(start=0, size="16GiB"),
in_addr_map=False,
),
)
self.controller.mem_port = self.controller.mirrors_mem.port
self.controller.mirrors_map_mem = self.map_mem.port

def set_choose_best(self, choose_best):
self.controller.choose_best = choose_best

def set_vertices_image(self, vertices):
self.controller.vertex_image_file = vertices

def set_aux_images(self, mirrors, mirrors_map):
self.controller.mirrors_mem.image_file = mirrors
self.map_mem.image_file = mirrors_map

def set_mpu_vector(self, mpu_vector):
self.controller.mpu_vector = mpu_vector


class SEGA(System):
def __init__(
self,
num_gpts,
num_registers,
cache_size,
graph_path,
):
super(SEGA, self).__init__()
assert num_gpts != 0
assert num_gpts % 2 == 0
assert (num_gpts & (num_gpts - 1)) == 0

self._num_gpts = num_gpts

self.clk_domain = SrcClockDomain()
self.clk_domain.clock = "2GHz"
self.clk_domain.voltage_domain = VoltageDomain()
self.cache_line_size = 32
self.mem_mode = "timing"

self.ctrl = SEGAController("256GiB/s")
self.ctrl.set_vertices_image(f"{graph_path}/vertices")

edge_mem = []
for i in range(int(num_gpts / 2)):
mem = EdgeMemory("4GiB")
mem.set_image(f"{graph_path}/edgelist_{i}")
edge_mem.append(mem)
self.edge_mem = edge_mem
# Building the GPTs
vertex_ranges, pch_bit = interleave_addresses(
AddrRange(start=0, size="4GiB"), 2 * num_gpts, 32
)
gpts = []
for i in range(num_gpts):
gpt = GPT(num_registers, cache_size)
gpt.set_vertex_range(
[vertex_ranges[i], vertex_ranges[i + num_gpts]]
)
gpt.set_vertex_pch_bit(pch_bit)
gpt.setEdgeMemPort(
self.edge_mem[i % (int(num_gpts / 2))].getPort()
)
gpts.append(gpt)
# Creating the interconnect among mpus
for gpt_0 in gpts:
for gpt_1 in gpts:
gpt_0.setReqPort(gpt_1.getRespPort())
self.gpts = gpts

self.ctrl.set_mpu_vector([gpt.mpu for gpt in self.gpts])

def work_count(self):
return self.ctrl.controller.workCount()

def set_async_mode(self):
self.ctrl.controller.setAsyncMode()

def set_bsp_mode(self):
self.ctrl.controller.setBSPMode()

def set_pg_mode(self):
self.ctrl.controller.setPGMode()

def set_aux_images(self, mirrors, mirrors_map):
self.ctrl.set_aux_images(mirrors, mirrors_map)

def set_choose_best(self, choose_best):
self.ctrl.set_choose_best(choose_best)

def create_pop_count_directory(self, atoms_per_block):
self.ctrl.controller.createPopCountDirectory(atoms_per_block)

def create_bfs_workload(self, init_addr, init_value):
self.ctrl.controller.createBFSWorkload(init_addr, init_value)

def create_bfs_visited_workload(self, init_addr, init_value):
self.ctrl.controller.createBFSVisitedWorkload(init_addr, init_value)

def create_sssp_workload(self, init_addr, init_value):
self.ctrl.controller.createSSSPWorkload(init_addr, init_value)

def create_cc_workload(self):
self.ctrl.controller.createCCWorkload()

def create_async_pr_workload(self, alpha, threshold):
self.ctrl.controller.createAsyncPRWorkload(alpha, threshold)

def create_pr_workload(self, num_nodes, alpha):
self.ctrl.controller.createPRWorkload(num_nodes, alpha)

def get_pr_error(self):
return self.ctrl.controller.getPRError()

def create_bc_workload(self, init_addr, init_value):
self.ctrl.controller.createBCWorkload(init_addr, init_value)

def print_answer(self):
self.ctrl.controller.printAnswerToHostSimout()

def get_num_gpts(self):
return self._num_gpts
Loading