MI_example.py (11266:452e10b868ea) MI_example.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
41
42def define_options(parser):

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

50 cpu_sequencers = []
51
52 #
53 # The ruby network creation expects the list of nodes in the system to be
54 # consistent with the NetDest list. Therefore the l1 controller nodes must be
55 # listed before the directory nodes and directory nodes before dma nodes, etc.
56 #
57 l1_cntrl_nodes = []
35from Ruby import send_evicts
36
37#
38# Declare caches used by the protocol
39#
40class L1Cache(RubyCache): pass
41
42def define_options(parser):

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

50 cpu_sequencers = []
51
52 #
53 # The ruby network creation expects the list of nodes in the system to be
54 # consistent with the NetDest list. Therefore the l1 controller nodes must be
55 # listed before the directory nodes and directory nodes before dma nodes, etc.
56 #
57 l1_cntrl_nodes = []
58 dir_cntrl_nodes = []
59 dma_cntrl_nodes = []
60
61 #
62 # Must create the individual controllers before the network to ensure the
63 # controller constructors are called before the network constructor
64 #
65 block_size_bits = int(math.log(options.cacheline_size, 2))
66

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

121
122 # Run each of the ruby memory controllers at a ratio of the frequency of
123 # the ruby system.
124 # clk_divider value is a fix to pass regression.
125 ruby_system.memctrl_clk_domain = DerivedClockDomain(
126 clk_domain=ruby_system.clk_domain,
127 clk_divider=3)
128
58 dma_cntrl_nodes = []
59
60 #
61 # Must create the individual controllers before the network to ensure the
62 # controller constructors are called before the network constructor
63 #
64 block_size_bits = int(math.log(options.cacheline_size, 2))
65

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

120
121 # Run each of the ruby memory controllers at a ratio of the frequency of
122 # the ruby system.
123 # clk_divider value is a fix to pass regression.
124 ruby_system.memctrl_clk_domain = DerivedClockDomain(
125 clk_domain=ruby_system.clk_domain,
126 clk_divider=3)
127
129 for i in xrange(options.num_dirs):
130 dir_size = MemorySize('0B')
131 dir_size.value = mem_module_size
132 dir_cntrl = Directory_Controller(version = i,
133 directory = RubyDirectoryMemory(
134 version = i, size = dir_size),
135 transitions_per_cycle = options.ports,
136 ruby_system = ruby_system)
137
138 exec("ruby_system.dir_cntrl%d = dir_cntrl" % i)
139 dir_cntrl_nodes.append(dir_cntrl)
140
128 dir_cntrl_nodes = create_directories(options, system.mem_ranges,
129 ruby_system)
130 for dir_cntrl in dir_cntrl_nodes:
141 # Connect the directory controllers and the network
142 dir_cntrl.requestToDir = MessageBuffer(ordered = True)
143 dir_cntrl.requestToDir.slave = ruby_system.network.master
144 dir_cntrl.dmaRequestToDir = MessageBuffer(ordered = True)
145 dir_cntrl.dmaRequestToDir.slave = ruby_system.network.master
146
147 dir_cntrl.responseFromDir = MessageBuffer()
148 dir_cntrl.responseFromDir.master = ruby_system.network.slave

--- 53 unchanged lines hidden ---
131 # Connect the directory controllers and the network
132 dir_cntrl.requestToDir = MessageBuffer(ordered = True)
133 dir_cntrl.requestToDir.slave = ruby_system.network.master
134 dir_cntrl.dmaRequestToDir = MessageBuffer(ordered = True)
135 dir_cntrl.dmaRequestToDir.slave = ruby_system.network.master
136
137 dir_cntrl.responseFromDir = MessageBuffer()
138 dir_cntrl.responseFromDir.master = ruby_system.network.slave

--- 53 unchanged lines hidden ---