MESI_Three_Level.py (11266:452e10b868ea) MESI_Three_Level.py (12065:e3e51756dfef)
1# Copyright (c) 2006-2007 The Regents of The University of Michigan
2# Copyright (c) 2009,2015 Advanced Micro Devices, Inc.
3# Copyright (c) 2013 Mark D. Hill and David A. Wood
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

28#
29# Authors: Brad Beckmann
30# Nilay Vaish
31
32import math
33import m5
34from m5.objects import *
35from m5.defines import buildEnv
1# Copyright (c) 2006-2007 The Regents of The University of Michigan
2# Copyright (c) 2009,2015 Advanced Micro Devices, Inc.
3# Copyright (c) 2013 Mark D. Hill and David A. Wood
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

28#
29# Authors: Brad Beckmann
30# Nilay Vaish
31
32import math
33import m5
34from m5.objects import *
35from m5.defines import buildEnv
36from Ruby import create_topology
36from Ruby import create_topology, create_directories
37from Ruby import send_evicts
38
39#
40# Declare caches used by the protocol
41#
42class L0Cache(RubyCache): pass
43class L1Cache(RubyCache): pass
44class L2Cache(RubyCache): pass

--- 16 unchanged lines hidden (view full) ---

61 # The ruby network creation expects the list of nodes in the system to be
62 # consistent with the NetDest list. Therefore the l1 controller nodes
63 # must be listed before the directory nodes and directory nodes before
64 # dma nodes, etc.
65 #
66 l0_cntrl_nodes = []
67 l1_cntrl_nodes = []
68 l2_cntrl_nodes = []
37from Ruby import send_evicts
38
39#
40# Declare caches used by the protocol
41#
42class L0Cache(RubyCache): pass
43class L1Cache(RubyCache): pass
44class L2Cache(RubyCache): pass

--- 16 unchanged lines hidden (view full) ---

61 # The ruby network creation expects the list of nodes in the system to be
62 # consistent with the NetDest list. Therefore the l1 controller nodes
63 # must be listed before the directory nodes and directory nodes before
64 # dma nodes, etc.
65 #
66 l0_cntrl_nodes = []
67 l1_cntrl_nodes = []
68 l2_cntrl_nodes = []
69 dir_cntrl_nodes = []
70 dma_cntrl_nodes = []
71
72 assert (options.num_cpus % options.num_clusters == 0)
73 num_cpus_per_cluster = options.num_cpus / options.num_clusters
74
75 assert (options.num_l2caches % options.num_clusters == 0)
76 num_l2caches_per_cluster = options.num_l2caches / options.num_clusters
77

--- 111 unchanged lines hidden (view full) ---

189
190 l2_cntrl.unblockToL2Cache = MessageBuffer()
191 l2_cntrl.unblockToL2Cache.slave = ruby_system.network.master
192 l2_cntrl.L1RequestToL2Cache = MessageBuffer()
193 l2_cntrl.L1RequestToL2Cache.slave = ruby_system.network.master
194 l2_cntrl.responseToL2Cache = MessageBuffer()
195 l2_cntrl.responseToL2Cache.slave = ruby_system.network.master
196
69 dma_cntrl_nodes = []
70
71 assert (options.num_cpus % options.num_clusters == 0)
72 num_cpus_per_cluster = options.num_cpus / options.num_clusters
73
74 assert (options.num_l2caches % options.num_clusters == 0)
75 num_l2caches_per_cluster = options.num_l2caches / options.num_clusters
76

--- 111 unchanged lines hidden (view full) ---

188
189 l2_cntrl.unblockToL2Cache = MessageBuffer()
190 l2_cntrl.unblockToL2Cache.slave = ruby_system.network.master
191 l2_cntrl.L1RequestToL2Cache = MessageBuffer()
192 l2_cntrl.L1RequestToL2Cache.slave = ruby_system.network.master
193 l2_cntrl.responseToL2Cache = MessageBuffer()
194 l2_cntrl.responseToL2Cache.slave = ruby_system.network.master
195
197 phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
198 assert(phys_mem_size % options.num_dirs == 0)
199 mem_module_size = phys_mem_size / options.num_dirs
200
201 # Run each of the ruby memory controllers at a ratio of the frequency of
202 # the ruby system
203 # clk_divider value is a fix to pass regression.
204 ruby_system.memctrl_clk_domain = DerivedClockDomain(
205 clk_domain = ruby_system.clk_domain, clk_divider = 3)
206
196 # Run each of the ruby memory controllers at a ratio of the frequency of
197 # the ruby system
198 # clk_divider value is a fix to pass regression.
199 ruby_system.memctrl_clk_domain = DerivedClockDomain(
200 clk_domain = ruby_system.clk_domain, clk_divider = 3)
201
207 for i in xrange(options.num_dirs):
208 #
209 # Create the Ruby objects associated with the directory controller
210 #
211 dir_size = MemorySize('0B')
212 dir_size.value = mem_module_size
213
214 dir_cntrl = Directory_Controller(version = i,
215 directory = RubyDirectoryMemory(version = i, size = dir_size),
216 transitions_per_cycle = options.ports,
217 ruby_system = ruby_system)
218
219 exec("ruby_system.dir_cntrl%d = dir_cntrl" % i)
220 dir_cntrl_nodes.append(dir_cntrl)
221
202 dir_cntrl_nodes = create_directories(options, system.mem_ranges,
203 ruby_system)
204 for dir_cntrl in dir_cntrl_nodes:
222 # Connect the directory controllers and the network
223 dir_cntrl.requestToDir = MessageBuffer()
224 dir_cntrl.requestToDir.slave = ruby_system.network.master
225 dir_cntrl.responseToDir = MessageBuffer()
226 dir_cntrl.responseToDir.slave = ruby_system.network.master
227 dir_cntrl.responseFromDir = MessageBuffer()
228 dir_cntrl.responseFromDir.master = ruby_system.network.slave
229 dir_cntrl.responseFromMemory = MessageBuffer()

--- 50 unchanged lines hidden ---
205 # Connect the directory controllers and the network
206 dir_cntrl.requestToDir = MessageBuffer()
207 dir_cntrl.requestToDir.slave = ruby_system.network.master
208 dir_cntrl.responseToDir = MessageBuffer()
209 dir_cntrl.responseToDir.slave = ruby_system.network.master
210 dir_cntrl.responseFromDir = MessageBuffer()
211 dir_cntrl.responseFromDir.master = ruby_system.network.slave
212 dir_cntrl.responseFromMemory = MessageBuffer()

--- 50 unchanged lines hidden ---