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

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

26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28# Authors: Brad Beckmann
29
30import math
31import m5
32from m5.objects import *
33from m5.defines import buildEnv
1# Copyright (c) 2006-2007 The Regents of The University of Michigan
2# Copyright (c) 2009 Advanced Micro Devices, Inc.
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

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

26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28# Authors: Brad Beckmann
29
30import math
31import m5
32from m5.objects import *
33from m5.defines import buildEnv
34from Ruby import create_topology
34from Ruby import create_topology, create_directories
35from Ruby import send_evicts
36
37#
38# Declare caches used by the protocol
39#
40class L1Cache(RubyCache): pass
41class L2Cache(RubyCache): pass
42#

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

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

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

60 cpu_sequencers = []
61
62 #
63 # The ruby network creation expects the list of nodes in the system to be
64 # consistent with the NetDest list. Therefore the l1 controller nodes must be
65 # listed before the directory nodes and directory nodes before dma nodes, etc.
66 #
67 l1_cntrl_nodes = []
68 dir_cntrl_nodes = []
69 dma_cntrl_nodes = []
70
71 #
72 # Must create the individual controllers before the network to ensure the
73 # controller constructors are called before the network constructor
74 #
75 block_size_bits = int(math.log(options.cacheline_size, 2))
76

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

138 # Connect the buffers from the network to the controller
139 l1_cntrl.mandatoryQueue = MessageBuffer()
140 l1_cntrl.forwardToCache = MessageBuffer()
141 l1_cntrl.forwardToCache.slave = ruby_system.network.master
142 l1_cntrl.responseToCache = MessageBuffer()
143 l1_cntrl.responseToCache.slave = ruby_system.network.master
144
145
68 dma_cntrl_nodes = []
69
70 #
71 # Must create the individual controllers before the network to ensure the
72 # controller constructors are called before the network constructor
73 #
74 block_size_bits = int(math.log(options.cacheline_size, 2))
75

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

137 # Connect the buffers from the network to the controller
138 l1_cntrl.mandatoryQueue = MessageBuffer()
139 l1_cntrl.forwardToCache = MessageBuffer()
140 l1_cntrl.forwardToCache.slave = ruby_system.network.master
141 l1_cntrl.responseToCache = MessageBuffer()
142 l1_cntrl.responseToCache.slave = ruby_system.network.master
143
144
146 phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
147 assert(phys_mem_size % options.num_dirs == 0)
148 mem_module_size = phys_mem_size / options.num_dirs
149
150 #
151 # determine size and index bits for probe filter
152 # By default, the probe filter size is configured to be twice the
153 # size of the L2 cache.
154 #
155 pf_size = MemorySize(options.l2_size)
156 pf_size.value = pf_size.value * 2
157 dir_bits = int(math.log(options.num_dirs, 2))

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

172
173 # Run each of the ruby memory controllers at a ratio of the frequency of
174 # the ruby system
175 # clk_divider value is a fix to pass regression.
176 ruby_system.memctrl_clk_domain = DerivedClockDomain(
177 clk_domain=ruby_system.clk_domain,
178 clk_divider=3)
179
145 #
146 # determine size and index bits for probe filter
147 # By default, the probe filter size is configured to be twice the
148 # size of the L2 cache.
149 #
150 pf_size = MemorySize(options.l2_size)
151 pf_size.value = pf_size.value * 2
152 dir_bits = int(math.log(options.num_dirs, 2))

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

167
168 # Run each of the ruby memory controllers at a ratio of the frequency of
169 # the ruby system
170 # clk_divider value is a fix to pass regression.
171 ruby_system.memctrl_clk_domain = DerivedClockDomain(
172 clk_domain=ruby_system.clk_domain,
173 clk_divider=3)
174
180 for i in xrange(options.num_dirs):
181 dir_size = MemorySize('0B')
182 dir_size.value = mem_module_size
183
175 dir_cntrl_nodes = create_directories(options, system.mem_ranges,
176 ruby_system)
177 for dir_cntrl in dir_cntrl_nodes:
184 pf = ProbeFilter(size = pf_size, assoc = 4,
185 start_index_bit = pf_start_bit)
186
178 pf = ProbeFilter(size = pf_size, assoc = 4,
179 start_index_bit = pf_start_bit)
180
187 dir_cntrl = Directory_Controller(version = i,
188 directory = RubyDirectoryMemory(
189 version = i, size = dir_size),
190 probeFilter = pf,
191 probe_filter_enabled = options.pf_on,
192 full_bit_dir_enabled = options.dir_on,
193 transitions_per_cycle = options.ports,
194 ruby_system = ruby_system)
181 dir_cntrl.probeFilter = pf
182 dir_cntrl.probe_filter_enabled = options.pf_on
183 dir_cntrl.full_bit_dir_enabled = options.dir_on
195
196 if options.recycle_latency:
197 dir_cntrl.recycle_latency = options.recycle_latency
198
184
185 if options.recycle_latency:
186 dir_cntrl.recycle_latency = options.recycle_latency
187
199 exec("ruby_system.dir_cntrl%d = dir_cntrl" % i)
200 dir_cntrl_nodes.append(dir_cntrl)
201
202 # Connect the directory controller to the network
203 dir_cntrl.forwardFromDir = MessageBuffer()
204 dir_cntrl.forwardFromDir.master = ruby_system.network.slave
205 dir_cntrl.responseFromDir = MessageBuffer()
206 dir_cntrl.responseFromDir.master = ruby_system.network.slave
207 dir_cntrl.dmaResponseFromDir = MessageBuffer(ordered = True)
208 dir_cntrl.dmaResponseFromDir.master = ruby_system.network.slave
209

--- 62 unchanged lines hidden ---
188 # Connect the directory controller to the network
189 dir_cntrl.forwardFromDir = MessageBuffer()
190 dir_cntrl.forwardFromDir.master = ruby_system.network.slave
191 dir_cntrl.responseFromDir = MessageBuffer()
192 dir_cntrl.responseFromDir.master = ruby_system.network.slave
193 dir_cntrl.dmaResponseFromDir = MessageBuffer(ordered = True)
194 dir_cntrl.dmaResponseFromDir.master = ruby_system.network.slave
195

--- 62 unchanged lines hidden ---