config: Move the memory instantiation outside FSConfig
authorAndreas Hansson <andreas.hansson@arm.com>
Mon, 19 Aug 2013 07:52:27 +0000 (03:52 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Mon, 19 Aug 2013 07:52:27 +0000 (03:52 -0400)
This patch moves the instantiation of the memory controller outside
FSConfig and instead relies on the mem_ranges to pass the information
to the caller (e.g. fs.py or one of the regression scripts). The main
motivation for this change is to expose the structural composition of
the memory system and allow more tuning and configuration without
adding a large number of options to the makeSystem functions.

The patch updates the relevant example scripts to maintain the current
functionality. As the order that ports are connected to the memory bus
changes (in certain regresisons), some bus stats are shuffled
around. For example, what used to be layer 0 is now layer 1.

Going forward, options will be added to support the addition of
multi-channel memory controllers.

43 files changed:
configs/common/FSConfig.py
configs/example/fs.py
configs/example/ruby_fs.py
configs/ruby/MESI_CMP_directory.py
configs/ruby/MI_example.py
configs/ruby/MOESI_CMP_directory.py
configs/ruby/MOESI_CMP_token.py
configs/ruby/MOESI_hammer.py
configs/ruby/Network_test.py
configs/ruby/Ruby.py
tests/configs/alpha_generic.py
tests/configs/arm_generic.py
tests/configs/base_config.py
tests/configs/memtest-ruby.py
tests/configs/pc-o3-timing.py
tests/configs/pc-simple-atomic.py
tests/configs/pc-simple-timing-ruby.py
tests/configs/pc-simple-timing.py
tests/configs/pc-switcheroo-full.py
tests/configs/realview-o3-checker.py
tests/configs/realview-o3-dual.py
tests/configs/realview-o3.py
tests/configs/realview-simple-atomic-dual.py
tests/configs/realview-simple-atomic.py
tests/configs/realview-simple-timing-dual.py
tests/configs/realview-simple-timing.py
tests/configs/realview-switcheroo-atomic.py
tests/configs/realview-switcheroo-full.py
tests/configs/realview-switcheroo-o3.py
tests/configs/realview-switcheroo-timing.py
tests/configs/rubytest-ruby.py
tests/configs/simple-timing-ruby.py
tests/configs/t1000-simple-atomic.py
tests/configs/tsunami-inorder.py
tests/configs/tsunami-o3-dual.py
tests/configs/tsunami-o3.py
tests/configs/tsunami-simple-atomic-dual.py
tests/configs/tsunami-simple-atomic.py
tests/configs/tsunami-simple-timing-dual.py
tests/configs/tsunami-simple-timing.py
tests/configs/tsunami-switcheroo-full.py
tests/configs/twosys-tsunami-simple-atomic.py
tests/configs/x86_generic.py

index 422de971e746a8fa2ca4d39c85330008ffde02b0..d560e8d960f23bbddf09462212f5b95af6adf0a4 100644 (file)
@@ -55,7 +55,7 @@ class MemBus(CoherentBus):
     default = Self.badaddr_responder.pio
 
 
-def makeLinuxAlphaSystem(mem_mode, MemClass, mdesc = None):
+def makeLinuxAlphaSystem(mem_mode, mdesc = None):
     IO_address_space_base = 0x80000000000
     class BaseTsunami(Tsunami):
         ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0)
@@ -73,11 +73,9 @@ def makeLinuxAlphaSystem(mem_mode, MemClass, mdesc = None):
     # base address (including the PCI config space)
     self.bridge = Bridge(delay='50ns',
                          ranges = [AddrRange(IO_address_space_base, Addr.max)])
-    self.physmem = MemClass(range = AddrRange(mdesc.mem()))
-    self.mem_ranges = [self.physmem.range]
+    self.mem_ranges = [AddrRange(mdesc.mem())]
     self.bridge.master = self.iobus.slave
     self.bridge.slave = self.membus.master
-    self.physmem.port = self.membus.master
     self.disk0 = CowIdeDisk(driveID='master')
     self.disk2 = CowIdeDisk(driveID='master')
     self.disk0.childImage(mdesc.disk())
@@ -104,15 +102,13 @@ def makeLinuxAlphaSystem(mem_mode, MemClass, mdesc = None):
 
     return self
 
-def makeLinuxAlphaRubySystem(mem_mode, MemClass, mdesc = None):
+def makeLinuxAlphaRubySystem(mem_mode, mdesc = None):
     class BaseTsunami(Tsunami):
         ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0)
         ide = IdeController(disks=[Parent.disk0, Parent.disk2],
                             pci_func=0, pci_dev=0, pci_bus=0)
-        
-    physmem = MemClass(range = AddrRange(mdesc.mem()))
-    self = LinuxAlphaSystem(physmem = physmem)
-    self.mem_ranges = [self.physmem.range]
+    self = LinuxAlphaSystem()
+    self.mem_ranges = [AddrRange(mdesc.mem())]
     if not mdesc:
         # generic system
         mdesc = SysConfig()
@@ -121,13 +117,6 @@ def makeLinuxAlphaRubySystem(mem_mode, MemClass, mdesc = None):
     # Create pio bus to connect all device pio ports to rubymem's pio port
     self.piobus = NoncoherentBus()
 
-    #
-    # Pio functional accesses from devices need direct access to memory
-    # RubyPort currently does support functional accesses.  Therefore provide
-    # the piobus a direct connection to physical memory
-    #
-    self.piobus.master = physmem.port
-
     self.disk0 = CowIdeDisk(driveID='master')
     self.disk2 = CowIdeDisk(driveID='master')
     self.disk0.childImage(mdesc.disk())
@@ -157,7 +146,7 @@ def makeLinuxAlphaRubySystem(mem_mode, MemClass, mdesc = None):
 
     return self
 
-def makeSparcSystem(mem_mode, MemClass, mdesc = None):
+def makeSparcSystem(mem_mode, mdesc = None):
     # Constants from iob.cc and uart8250.cc
     iob_man_addr = 0x9800000000
     uart_pio_size = 8
@@ -180,13 +169,10 @@ def makeSparcSystem(mem_mode, MemClass, mdesc = None):
     self.t1000 = T1000()
     self.t1000.attachOnChipIO(self.membus)
     self.t1000.attachIO(self.iobus)
-    self.physmem = MemClass(range = AddrRange(Addr('1MB'), size = '64MB'))
-    self.physmem2 = MemClass(range = AddrRange(Addr('2GB'), size ='256MB'))
-    self.mem_ranges = [self.physmem.range, self.physmem2.range]
+    self.mem_ranges = [AddrRange(Addr('1MB'), size = '64MB'),
+                       AddrRange(Addr('2GB'), size ='256MB')]
     self.bridge.master = self.iobus.slave
     self.bridge.slave = self.membus.master
-    self.physmem.port = self.membus.master
-    self.physmem2.port = self.membus.master
     self.rom.port = self.membus.master
     self.nvram.port = self.membus.master
     self.hypervisor_desc.port = self.membus.master
@@ -225,7 +211,7 @@ def makeSparcSystem(mem_mode, MemClass, mdesc = None):
 
     return self
 
-def makeArmSystem(mem_mode, machine_type, MemClass, mdesc = None,
+def makeArmSystem(mem_mode, machine_type, mdesc = None,
                   dtb_filename = None, bare_metal=False):
     assert machine_type
 
@@ -273,8 +259,7 @@ def makeArmSystem(mem_mode, machine_type, MemClass, mdesc = None,
     if bare_metal:
         # EOT character on UART will end the simulation
         self.realview.uart.end_on_eot = True
-        self.physmem = MemClass(range = AddrRange(Addr(mdesc.mem())))
-        self.mem_ranges = [self.physmem.range]
+        self.mem_ranges = [AddrRange(mdesc.mem())]
     else:
         self.kernel = binary('vmlinux.arm.smp.fb.2.6.38.8')
         if dtb_filename is not None:
@@ -288,11 +273,8 @@ def makeArmSystem(mem_mode, machine_type, MemClass, mdesc = None,
 
         boot_flags = 'earlyprintk console=ttyAMA0 lpj=19988480 norandmaps ' + \
                      'rw loglevel=8 mem=%s root=/dev/sda1' % mdesc.mem()
-
-        self.physmem = MemClass(range = AddrRange(self.realview.mem_start_addr,
-                                                  size = mdesc.mem()),
-                                conf_table_reported = True)
-        self.mem_ranges = [self.physmem.range]
+        self.mem_ranges = [AddrRange(self.realview.mem_start_addr,
+                                     size = mdesc.mem())]
         self.realview.setupBootLoader(self.membus, self, binary)
         self.gic_cpu_addr = self.realview.gic.cpu_addr
         self.flags_addr = self.realview.realview_io.pio_addr + 0x30
@@ -300,8 +282,6 @@ def makeArmSystem(mem_mode, machine_type, MemClass, mdesc = None,
         if mdesc.disk().lower().count('android'):
             boot_flags += " init=/init "
         self.boot_osflags = boot_flags
-
-    self.physmem.port = self.membus.master
     self.realview.attachOnChipIO(self.membus, self.bridge)
     self.realview.attachIO(self.iobus)
     self.intrctrl = IntrControl()
@@ -313,7 +293,7 @@ def makeArmSystem(mem_mode, machine_type, MemClass, mdesc = None,
     return self
 
 
-def makeLinuxMipsSystem(mem_mode, MemClass, mdesc = None):
+def makeLinuxMipsSystem(mem_mode, mdesc = None):
     class BaseMalta(Malta):
         ethernet = NSGigE(pci_bus=0, pci_dev=1, pci_func=0)
         ide = IdeController(disks=[Parent.disk0, Parent.disk2],
@@ -327,11 +307,9 @@ def makeLinuxMipsSystem(mem_mode, MemClass, mdesc = None):
     self.iobus = NoncoherentBus()
     self.membus = MemBus()
     self.bridge = Bridge(delay='50ns')
-    self.physmem = MemClass(range = AddrRange('1GB'))
-    self.mem_ranges = [self.physmem.range]
+    self.mem_ranges = [AddrRange('1GB')]
     self.bridge.master = self.iobus.slave
     self.bridge.slave = self.membus.master
-    self.physmem.port = self.membus.master
     self.disk0 = CowIdeDisk(driveID='master')
     self.disk2 = CowIdeDisk(driveID='master')
     self.disk0.childImage(mdesc.disk())
@@ -369,7 +347,6 @@ def connectX86ClassicSystem(x86_sys, numCPUs):
     APIC_range_size = 1 << 12;
 
     x86_sys.membus = MemBus()
-    x86_sys.physmem.port = x86_sys.membus.master
 
     # North Bridge
     x86_sys.iobus = NoncoherentBus()
@@ -409,19 +386,13 @@ def connectX86RubySystem(x86_sys):
     # North Bridge
     x86_sys.piobus = NoncoherentBus()
 
-    #
-    # Pio functional accesses from devices need direct access to memory
-    # RubyPort currently does support functional accesses.  Therefore provide
-    # the piobus a direct connection to physical memory
-    #
-    x86_sys.piobus.master = x86_sys.physmem.port
     # add the ide to the list of dma devices that later need to attach to
     # dma controllers
     x86_sys._dma_ports = [x86_sys.pc.south_bridge.ide.dma]
     x86_sys.pc.attachIO(x86_sys.piobus, x86_sys._dma_ports)
 
 
-def makeX86System(mem_mode, MemClass, numCPUs = 1, mdesc = None, self = None,
+def makeX86System(mem_mode, numCPUs = 1, mdesc = None, self = None,
                   Ruby = False):
     if self == None:
         self = X86System()
@@ -434,8 +405,7 @@ def makeX86System(mem_mode, MemClass, numCPUs = 1, mdesc = None, self = None,
     self.mem_mode = mem_mode
 
     # Physical memory
-    self.physmem = MemClass(range = AddrRange(mdesc.mem()))
-    self.mem_ranges = [self.physmem.range]
+    self.mem_ranges = [AddrRange(mdesc.mem())]
 
     # Platform
     self.pc = Pc()
@@ -518,17 +488,16 @@ def makeX86System(mem_mode, MemClass, numCPUs = 1, mdesc = None, self = None,
     self.intel_mp_table.base_entries = base_entries
     self.intel_mp_table.ext_entries = ext_entries
 
-def makeLinuxX86System(mem_mode, MemClass, numCPUs = 1, mdesc = None,
+def makeLinuxX86System(mem_mode, numCPUs = 1, mdesc = None,
                        Ruby = False):
     self = LinuxX86System()
 
     # Build up the x86 system and then specialize it for Linux
-    makeX86System(mem_mode, MemClass, numCPUs, mdesc, self, Ruby)
+    makeX86System(mem_mode, numCPUs, mdesc, self, Ruby)
 
     # We assume below that there's at least 1MB of memory. We'll require 2
     # just to avoid corner cases.
-    phys_mem_size = sum(map(lambda mem: mem.range.size(),
-                            self.memories.unproxy(self)))
+    phys_mem_size = sum(map(lambda r: r.size(), self.mem_ranges))
     assert(phys_mem_size >= 0x200000)
 
     self.e820_table.entries = \
index 02814840486372b5b3a51c4c10c9cb1b0d31af4e..037a54b75802e3f364530468d6ab882c7a8dc6f7 100644 (file)
@@ -102,17 +102,16 @@ else:
 np = options.num_cpus
 
 if buildEnv['TARGET_ISA'] == "alpha":
-    test_sys = makeLinuxAlphaSystem(test_mem_mode, TestMemClass, bm[0])
+    test_sys = makeLinuxAlphaSystem(test_mem_mode, bm[0])
 elif buildEnv['TARGET_ISA'] == "mips":
-    test_sys = makeLinuxMipsSystem(test_mem_mode, TestMemClass, bm[0])
+    test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0])
 elif buildEnv['TARGET_ISA'] == "sparc":
-    test_sys = makeSparcSystem(test_mem_mode, TestMemClass, bm[0])
+    test_sys = makeSparcSystem(test_mem_mode, bm[0])
 elif buildEnv['TARGET_ISA'] == "x86":
-    test_sys = makeLinuxX86System(test_mem_mode, TestMemClass,
-                                  options.num_cpus, bm[0])
+    test_sys = makeLinuxX86System(test_mem_mode, options.num_cpus, bm[0])
 elif buildEnv['TARGET_ISA'] == "arm":
-    test_sys = makeArmSystem(test_mem_mode, options.machine_type,
-                             TestMemClass, bm[0], options.dtb_filename,
+    test_sys = makeArmSystem(test_mem_mode, options.machine_type, bm[0],
+                             options.dtb_filename,
                              bare_metal=options.bare_metal)
 else:
     fatal("Incapable of building %s full system!", buildEnv['TARGET_ISA'])
@@ -164,18 +163,24 @@ for i in xrange(np):
 
 CacheConfig.config_cache(options, test_sys)
 
+# Create the appropriate memory controllers and connect them to the
+# memory bus
+test_sys.mem_ctrls = [TestMemClass(range = r, conf_table_reported = True)
+                      for r in test_sys.mem_ranges]
+for i in xrange(len(test_sys.mem_ctrls)):
+    test_sys.mem_ctrls[i].port = test_sys.membus.master
+
 if len(bm) == 2:
     if buildEnv['TARGET_ISA'] == 'alpha':
-        drive_sys = makeLinuxAlphaSystem(drive_mem_mode, DriveMemClass, bm[1])
+        drive_sys = makeLinuxAlphaSystem(drive_mem_mode, bm[1])
     elif buildEnv['TARGET_ISA'] == 'mips':
-        drive_sys = makeLinuxMipsSystem(drive_mem_mode, DriveMemClass, bm[1])
+        drive_sys = makeLinuxMipsSystem(drive_mem_mode, bm[1])
     elif buildEnv['TARGET_ISA'] == 'sparc':
-        drive_sys = makeSparcSystem(drive_mem_mode, DriveMemClass, bm[1])
+        drive_sys = makeSparcSystem(drive_mem_mode, bm[1])
     elif buildEnv['TARGET_ISA'] == 'x86':
-        drive_sys = makeX86System(drive_mem_mode, DriveMemClass, np, bm[1])
+        drive_sys = makeX86System(drive_mem_mode, np, bm[1])
     elif buildEnv['TARGET_ISA'] == 'arm':
-        drive_sys = makeArmSystem(drive_mem_mode, options.machine_type,
-                                  DriveMemClass, bm[1])
+        drive_sys = makeArmSystem(drive_mem_mode, options.machine_type, bm[1])
 
     # Create a source clock for the system and set the clock period
     drive_sys.clk_domain = SrcClockDomain(clock =  options.sys_clock)
@@ -201,6 +206,13 @@ if len(bm) == 2:
     drive_sys.iobridge.slave = drive_sys.iobus.master
     drive_sys.iobridge.master = drive_sys.membus.slave
 
+    # Create the appropriate memory controllers and connect them to the
+    # memory bus
+    drive_sys.mem_ctrls = [DriveMemClass(range = r, conf_table_reported = True)
+                           for r in drive_sys.mem_ranges]
+    for i in xrange(len(drive_sys.mem_ctrls)):
+        drive_sys.mem_ctrls[i].port = drive_sys.membus.master
+
     drive_sys.init_param = options.init_param
     root = makeDualRoot(True, test_sys, drive_sys, options.etherdump)
 elif len(bm) == 1:
index a1293a08c67ab184bfadad0c5e32ea0a85bb5084..a254841d221710098de45517332dffa10f38aef6 100644 (file)
@@ -83,10 +83,9 @@ if not (options.cpu_type == "detailed" or options.cpu_type == "timing"):
 TestMemClass = Simulation.setMemClass(options)
 
 if buildEnv['TARGET_ISA'] == "alpha":
-    system = makeLinuxAlphaRubySystem(test_mem_mode, TestMemClass, bm[0])
+    system = makeLinuxAlphaRubySystem(test_mem_mode, bm[0])
 elif buildEnv['TARGET_ISA'] == "x86":
-    system = makeLinuxX86System(test_mem_mode, TestMemClass,
-                                options.num_cpus, bm[0], True)
+    system = makeLinuxX86System(test_mem_mode, options.num_cpus, bm[0], True)
     Simulation.setWorkCountOptions(system, options)
 else:
     fatal("incapable of building non-alpha or non-x86 full system!")
@@ -127,5 +126,13 @@ for (i, cpu) in enumerate(system.cpu):
 
     system.ruby._cpu_ruby_ports[i].access_phys_mem = True
 
+# Create the appropriate memory controllers and connect them to the
+# PIO bus
+system.mem_ctrls = [TestMemClass(range = r,
+                                 conf_table_reported = True)
+                    for r in system.mem_ranges]
+for i in xrange(len(system.physmem)):
+    system.mem_ctrls[i].port = system.piobus.master
+
 root = Root(full_system = True, system = system)
 Simulation.run(options, root, system, FutureClass)
index e263b4e5a1cb3680c9ed3fc7270af2ab53eb05b0..8cd74cde6768e88093f8558e08777723a1f167f2 100644 (file)
@@ -140,8 +140,7 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
         
         cntrl_count += 1
 
-    phys_mem_size = sum(map(lambda mem: mem.range.size(),
-                            system.memories.unproxy(system)))
+    phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
     assert(phys_mem_size % options.num_dirs == 0)
     mem_module_size = phys_mem_size / options.num_dirs
 
index 896a01a61e0d3063a92b5533b9e90c74d72e1d9f..44687e49330f923ffd24abc1640ef13872901373 100644 (file)
@@ -105,8 +105,7 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
 
         cntrl_count += 1
 
-    phys_mem_size = sum(map(lambda mem: mem.range.size(),
-                            system.memories.unproxy(system)))
+    phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
     assert(phys_mem_size % options.num_dirs == 0)
     mem_module_size = phys_mem_size / options.num_dirs
 
index bc1f7d6410104e2c88e116097974f49dd57819b8..33c62f7a339f0c45f92fb532fb06ac33dd2310d0 100644 (file)
@@ -135,8 +135,7 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
 
         cntrl_count += 1
 
-    phys_mem_size = sum(map(lambda mem: mem.range.size(),
-                            system.memories.unproxy(system)))
+    phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
     assert(phys_mem_size % options.num_dirs == 0)
     mem_module_size = phys_mem_size / options.num_dirs
 
index 4ede788a82e7b0b1cc382aa6de1579ced8ad2472..43b9f97e8b76ff719bd51654914954d42fe1296d 100644 (file)
@@ -156,8 +156,7 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
 
         cntrl_count += 1
 
-    phys_mem_size = sum(map(lambda mem: mem.range.size(),
-                            system.memories.unproxy(system)))
+    phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
     assert(phys_mem_size % options.num_dirs == 0)
     mem_module_size = phys_mem_size / options.num_dirs
 
index da8b004ee32e3754c5a628f5f14b3aa0c82c3301..124845ab8bf96e0f7301e2bf97bd72e808f4e426 100644 (file)
@@ -131,8 +131,7 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
 
         cntrl_count += 1
 
-    phys_mem_size = sum(map(lambda mem: mem.range.size(),
-                            system.memories.unproxy(system)))
+    phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
     assert(phys_mem_size % options.num_dirs == 0)
     mem_module_size = phys_mem_size / options.num_dirs
 
index d7b04cd313ecf926503e226adc1d32bd7876b993..6dfcc0b590923fad076eced15d19c5811c2b17f5 100644 (file)
@@ -103,8 +103,7 @@ def create_system(options, system, piobus, dma_ports, ruby_system):
 
         cntrl_count += 1
 
-    phys_mem_size = sum(map(lambda mem: mem.range.size(),
-                            system.memories.unproxy(system)))
+    phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
     assert(phys_mem_size % options.num_dirs == 0)
     mem_module_size = phys_mem_size / options.num_dirs
 
index a35ef4f095fb9f7259dec76e03f99bc3049959e2..b6cc7a5e8e63ad900e11295b51ccb9da18f25e81 100644 (file)
@@ -183,8 +183,7 @@ def create_system(options, system, piobus = None, dma_ports = []):
         total_mem_size.value += dir_cntrl.directory.size.value
         dir_cntrl.directory.numa_high_bit = numa_bit
 
-    phys_mem_size = sum(map(lambda mem: mem.range.size(),
-                            system.memories.unproxy(system)))
+    phys_mem_size = sum(map(lambda r: r.size(), system.mem_ranges))
     assert(total_mem_size.value == phys_mem_size)
 
     ruby_profiler = RubyProfiler(ruby_system = ruby,
index f7a4166bed53c3fc683e23d878a91f80cd32f2f3..a4ebba54d9acdf2fb39f40865287e5c863acbba4 100644 (file)
@@ -59,7 +59,7 @@ class LinuxAlphaSystemBuilder(object):
         pass
 
     def create_system(self):
-        system = FSConfig.makeLinuxAlphaSystem(self.mem_mode, DDR3_1600_x64)
+        system = FSConfig.makeLinuxAlphaSystem(self.mem_mode)
         self.init_system(system)
         return system
 
index 0cf170a9b2d3dde94e0762a7b4e8cd046159e84d..ada49ba971f21b25aa9939b513f02894c7931d4a 100644 (file)
@@ -60,9 +60,7 @@ class LinuxArmSystemBuilder(object):
 
     def create_system(self):
         system = FSConfig.makeArmSystem(self.mem_mode,
-                                        self.machine_type,
-                                        DDR3_1600_x64,
-                                        None, False)
+                                        self.machine_type, None, False)
 
         # We typically want the simulator to panic if the kernel
         # panics or oopses. This prevents the simulator from running
index 16620c4ddab2018cf96887c9088f9ed024d5adea..d93be0d1b450a95346f56bf19796a816a1314ee4 100644 (file)
@@ -221,6 +221,14 @@ class BaseFSSystem(BaseSystem):
     def init_system(self, system):
         BaseSystem.init_system(self, system)
 
+        # create the memory controllers and connect them, stick with
+        # the physmem name to avoid bumping all the reference stats
+        system.physmem = [self.mem_class(range = r,
+                                         conf_table_reported = True)
+                          for r in system.mem_ranges]
+        for i in xrange(len(system.physmem)):
+            system.physmem[i].port = system.membus.master
+
         # create the iocache, which by default runs at the system clock
         system.iocache = IOCache(addr_ranges=system.mem_ranges)
         system.iocache.cpu_side = system.iobus.master
index 3261ba3ffca4d0a101e93537320f063164f121bb..a0500458ad9defb56578b645c46fc8cac05efebb 100644 (file)
@@ -91,6 +91,8 @@ system.cpu_clk_domain = SrcClockDomain(clock = '2GHz')
 for cpu in cpus:
     cpu.clk_domain = system.cpu_clk_domain
 
+system.mem_ranges = AddrRange('256MB')
+
 Ruby.create_system(options, system)
 
 # Create a separate clock domain for Ruby
index 6020478a0d51aa02eb6a3f86e8b56b0ec0ea31cf..ed21a9f38cfbdc9e7806c65b70efab2ba2163fff 100644 (file)
@@ -39,4 +39,5 @@ from m5.objects import *
 from x86_generic import *
 
 root = LinuxX86FSSystemUniprocessor(mem_mode='timing',
+                                    mem_class=DDR3_1600_x64,
                                     cpu_class=DerivO3CPU).create_root()
index ce6aa0616ad62645ba1015a5dd4f3133061f682a..94a06ed6f2f48c7dedc955c3fc22818136289ea7 100644 (file)
@@ -39,4 +39,5 @@ from m5.objects import *
 from x86_generic import *
 
 root = LinuxX86FSSystemUniprocessor(mem_mode='atomic',
+                                    mem_class=DDR3_1600_x64,
                                     cpu_class=AtomicSimpleCPU).create_root()
index e0ef72db9b1ba2144b89652b78f6fd3cb0034b40..7fd9c0b5f9dd9beeda5d5f1315fe74b58b8ad8b3 100644 (file)
@@ -55,7 +55,7 @@ options.num_cpus = 2
 
 #the system
 mdesc = SysConfig(disk = 'linux-x86.img')
-system = FSConfig.makeLinuxX86System('timing', DDR3_1600_x64, options.num_cpus,
+system = FSConfig.makeLinuxX86System('timing', options.num_cpus,
                                      mdesc=mdesc, Ruby=True)
 
 system.kernel = FSConfig.binary('x86_64-vmlinux-2.6.22.9.smp')
@@ -84,5 +84,11 @@ for (i, cpu) in enumerate(system.cpu):
     # Set access_phys_mem to True for ruby port
     system.ruby._cpu_ruby_ports[i].access_phys_mem = True
 
+system.physmem = [DDR3_1600_x64(range = r,
+                                conf_table_reported = True)
+                  for r in system.mem_ranges]
+for i in xrange(len(system.physmem)):
+    system.physmem[i].port = system.piobus.master
+
 root = Root(full_system = True, system = system)
 m5.ticks.setGlobalFrequency('1THz')
index e8d73a249891407039f8c268613040bd7e8371f3..45fff460e5bd7880d9fcce3cd0b68376708dff97 100644 (file)
@@ -39,5 +39,6 @@ from m5.objects import *
 from x86_generic import *
 
 root = LinuxX86FSSystemUniprocessor(mem_mode='timing',
+                                    mem_class=DDR3_1600_x64,
                                     cpu_class=TimingSimpleCPU).create_root()
 
index c94987638f3965968441c23163fefbfc351c8bac..ccae0cc76654ab4498dd1cce788ca196106d4c44 100644 (file)
@@ -42,6 +42,7 @@ from x86_generic import *
 import switcheroo
 
 root = LinuxX86FSSwitcheroo(
+    mem_class=DDR3_1600_x64,
     cpu_classes=(AtomicSimpleCPU, TimingSimpleCPU, DerivO3CPU)
     ).create_root()
 
index 3f252bf2c70733f90c56e6283f9a7556c8c3b13a..6c930e759442c9371fe1600cf5160bf8394152c8 100644 (file)
@@ -39,5 +39,6 @@ from m5.objects import *
 from arm_generic import *
 
 root = LinuxArmFSSystemUniprocessor(mem_mode='timing',
+                                    mem_class=DDR3_1600_x64,
                                     cpu_class=DerivO3CPU,
                                     checker=True).create_root()
index 56e6aee73a89f5d150fc6a85dc6df17ab132d420..b686acced5dd77b2627d5d2fd08668784154c190 100644 (file)
@@ -38,5 +38,7 @@
 from m5.objects import *
 from arm_generic import *
 
-root = LinuxArmFSSystem(mem_mode='timing', cpu_class=DerivO3CPU,
+root = LinuxArmFSSystem(mem_mode='timing',
+                        mem_class=DDR3_1600_x64,
+                        cpu_class=DerivO3CPU,
                         num_cpus=2).create_root()
index 99f8ea3dc9c798afc2f212ad42bb691fdb2beb5c..b8580a3a23b47f538be205dd7c3325f03a2cc6ae 100644 (file)
@@ -39,4 +39,5 @@ from m5.objects import *
 from arm_generic import *
 
 root = LinuxArmFSSystemUniprocessor(mem_mode='timing',
+                                    mem_class=DDR3_1600_x64,
                                     cpu_class=DerivO3CPU).create_root()
index 64ddf0595cd8caecbfc4b6986660c33f42b7bf64..0d6b11cf6ce8ac9ad228e101309cd959d4db251c 100644 (file)
@@ -38,5 +38,7 @@
 from m5.objects import *
 from arm_generic import *
 
-root = LinuxArmFSSystem(mem_mode='atomic', cpu_class=AtomicSimpleCPU,
+root = LinuxArmFSSystem(mem_mode='atomic',
+                        mem_class=DDR3_1600_x64,
+                        cpu_class=AtomicSimpleCPU,
                         num_cpus=2).create_root()
index 866a13395afba7f1e280e44b44b6737b75c8c553..a440de29129fe2a3db88702310d3be2d4c338f7a 100644 (file)
@@ -39,5 +39,6 @@ from m5.objects import *
 from arm_generic import *
 
 root = LinuxArmFSSystemUniprocessor(mem_mode='atomic',
+                                    mem_class=DDR3_1600_x64,
                                     cpu_class=AtomicSimpleCPU).create_root()
 
index 86efd4c1a50e2d5bdd45f7fae60702dc75c2b3bb..1744f4af0250b851be702222ae98f6a7f0c0686f 100644 (file)
@@ -38,5 +38,7 @@
 from m5.objects import *
 from arm_generic import *
 
-root = LinuxArmFSSystem(mem_mode='timing', cpu_class=TimingSimpleCPU,
+root = LinuxArmFSSystem(mem_mode='timing',
+                        mem_class=DDR3_1600_x64,
+                        cpu_class=TimingSimpleCPU,
                         num_cpus=2).create_root()
index 9ff8b33e0477ca148e10b3e0516496d4d0f35307..f73823d30c95fe8fb6e31fe46c72c32644993be1 100644 (file)
@@ -39,4 +39,5 @@ from m5.objects import *
 from arm_generic import *
 
 root = LinuxArmFSSystemUniprocessor(mem_mode='timing',
+                                    mem_class=DDR3_1600_x64,
                                     cpu_class=TimingSimpleCPU).create_root()
index 880162527d906f7e2f87fa180056d1ef3569fe27..bab11ebe64260bfd3a6aab7a4fe4448a37d64000 100644 (file)
@@ -40,6 +40,7 @@ from arm_generic import *
 import switcheroo
 
 root = LinuxArmFSSwitcheroo(
+    mem_class=DDR3_1600_x64,
     cpu_classes=(AtomicSimpleCPU, AtomicSimpleCPU)
     ).create_root()
 
index 091357114e62aa8dadf65c63af0be2fe4dcb71e7..3467eb4c9d7d49fb1f2e737dd6aea77283006322 100644 (file)
@@ -40,6 +40,7 @@ from arm_generic import *
 import switcheroo
 
 root = LinuxArmFSSwitcheroo(
+    mem_class=DDR3_1600_x64,
     cpu_classes=(AtomicSimpleCPU, TimingSimpleCPU, DerivO3CPU)
     ).create_root()
 
index 6079402e2df3aa0bb185c5c9e06ffc2d01511213..864e0cfd49ecc95e5504a22cd54f32ff5cc0357c 100644 (file)
@@ -40,6 +40,7 @@ from arm_generic import *
 import switcheroo
 
 root = LinuxArmFSSwitcheroo(
+    mem_class=DDR3_1600_x64,
     cpu_classes=(DerivO3CPU, DerivO3CPU)
     ).create_root()
 
index 2329de6b00f03bb9beaa53c488d61ee7e89e86f1..ff09b7f260e9d089a41d3b42f88b8b4618ae79e2 100644 (file)
@@ -40,6 +40,7 @@ from arm_generic import *
 import switcheroo
 
 root = LinuxArmFSSwitcheroo(
+    mem_class=DDR3_1600_x64,
     cpu_classes=(TimingSimpleCPU, TimingSimpleCPU)
     ).create_root()
 
index 1553e29f4d4b94431e43fa3e20198e8ce373641b..d2809f2a2dd08abce536e09e61188f0b0699d5f2 100644 (file)
@@ -80,6 +80,8 @@ tester = RubyTester(check_flush = check_flush, checks_to_complete = 100,
 system = System(tester = tester, physmem = SimpleMemory(null = True),
                 clk_domain = SrcClockDomain(clock = options.sys_clock))
 
+system.mem_ranges = AddrRange('256MB')
+
 Ruby.create_system(options, system)
 
 # Create a separate clock domain for Ruby
index 27d56a31da756a7339ef6890a3d0b09755aeb432..ce155c23cd59520f0bdfb4fc9af607a6a05aac7f 100644 (file)
@@ -74,6 +74,8 @@ system = System(cpu = cpu, physmem = SimpleMemory(null = True),
 # CPUs frequency
 system.cpu.clk_domain = SrcClockDomain(clock = '2GHz')
 
+system.mem_ranges = AddrRange('256MB')
+
 Ruby.create_system(options, system)
 
 # Create a separate clock for Ruby
index c0744a6a2febf574621b081ea2878a7009a20875..64c3dc40802079b4e8d8756533707573c0a9e5e5 100644 (file)
@@ -31,7 +31,7 @@ from m5.objects import *
 m5.util.addToPath('../configs/common')
 import FSConfig
 
-system = FSConfig.makeSparcSystem('atomic', SimpleMemory)
+system = FSConfig.makeSparcSystem('atomic')
 system.clk_domain = SrcClockDomain(clock = '1GHz')
 system.cpu_clk_domain = SrcClockDomain(clock = '1GHz')
 cpu = AtomicSimpleCPU(cpu_id=0, clk_domain = system.cpu_clk_domain)
@@ -40,6 +40,14 @@ system.cpu = cpu
 cpu.createInterruptController()
 cpu.connectAllPorts(system.membus)
 
+# create the memory controllers and connect them, stick with
+# the physmem name to avoid bumping all the reference stats
+system.physmem = [SimpleMemory(range = r,
+                               conf_table_reported = True)
+                  for r in system.mem_ranges]
+for i in xrange(len(system.physmem)):
+    system.physmem[i].port = system.membus.master
+
 root = Root(full_system=True, system=system)
 
 m5.ticks.setGlobalFrequency('2GHz')
index 102c5a8d2605d46abf7c075e0b24a7d0da8d0c15..9f052527fd1fd7be2ab7b7cb672471cd5abc45ec 100644 (file)
@@ -39,4 +39,5 @@ from m5.objects import *
 from alpha_generic import *
 
 root = LinuxAlphaFSSystemUniprocessor(mem_mode='timing',
+                                      mem_class=DDR3_1600_x64,
                                       cpu_class=InOrderCPU).create_root()
index d7964b4d89e47f113759370ca76cb8f7ca8a0024..b50cda5572870f2ae36d6c92a913d36bea84a0f6 100644 (file)
@@ -38,5 +38,7 @@
 from m5.objects import *
 from alpha_generic import *
 
-root = LinuxAlphaFSSystem(mem_mode='timing', cpu_class=DerivO3CPU,
+root = LinuxAlphaFSSystem(mem_mode='timing',
+                          mem_class=DDR3_1600_x64,
+                          cpu_class=DerivO3CPU,
                           num_cpus=2).create_root()
index 2c782e2cce4ab49f45e1ae1931a3124557f8c331..dbbc75e1ced2fe69ffa39da515df7cd4f1b2e08e 100644 (file)
@@ -39,4 +39,5 @@ from m5.objects import *
 from alpha_generic import *
 
 root = LinuxAlphaFSSystemUniprocessor(mem_mode='timing',
+                                      mem_class=DDR3_1600_x64,
                                       cpu_class=DerivO3CPU).create_root()
index 36dc8133bbcddb591e8c6fbc3d0a575293df02d8..9f827d9d9ca9e12888dae6b54b23556d9d7cb258 100644 (file)
@@ -38,5 +38,7 @@
 from m5.objects import *
 from alpha_generic import *
 
-root = LinuxAlphaFSSystem(mem_mode='atomic', cpu_class=AtomicSimpleCPU,
+root = LinuxAlphaFSSystem(mem_mode='atomic',
+                          mem_class=DDR3_1600_x64,
+                          cpu_class=AtomicSimpleCPU,
                           num_cpus=2).create_root()
index be8e93a187d6789e8c77b1684d078e9da66a8230..8c486204c9be7ae6c1f5c73563dc6694f12cc369 100644 (file)
@@ -39,4 +39,5 @@ from m5.objects import *
 from alpha_generic import *
 
 root = LinuxAlphaFSSystemUniprocessor(mem_mode='atomic',
+                                      mem_class=DDR3_1600_x64,
                                       cpu_class=AtomicSimpleCPU).create_root()
index 2ca280f0622b72ccab3b8d7d5603afc65caed23b..5b8a99ca67d2a5073d7cd22664118f10f6b35b4d 100644 (file)
@@ -38,5 +38,7 @@
 from m5.objects import *
 from alpha_generic import *
 
-root = LinuxAlphaFSSystem(mem_mode='timing', cpu_class=TimingSimpleCPU,
+root = LinuxAlphaFSSystem(mem_mode='timing',
+                          mem_class=DDR3_1600_x64,
+                          cpu_class=TimingSimpleCPU,
                           num_cpus=2).create_root()
index 27cb679b8e779109c3581b37c9e26e40fa3c4121..082f79d1ed19db4842d6b4a3b60ca917cc26a788 100644 (file)
@@ -39,4 +39,5 @@ from m5.objects import *
 from alpha_generic import *
 
 root = LinuxAlphaFSSystemUniprocessor(mem_mode='timing',
+                                      mem_class=DDR3_1600_x64,
                                       cpu_class=TimingSimpleCPU).create_root()
index d2be0ebfaeac396b22a4ed5fb4926d34ac8d89c8..121e669b416ae74b28ae03f9653e56b5d265d6f8 100644 (file)
@@ -40,6 +40,7 @@ from alpha_generic import *
 import switcheroo
 
 root = LinuxAlphaFSSwitcheroo(
+    mem_class=DDR3_1600_x64,
     cpu_classes=(AtomicSimpleCPU, TimingSimpleCPU, DerivO3CPU)
     ).create_root()
 
index 22c6686ae2b985f86b70a32eea94ecda5e5c89d9..b69e355170bbce577d60cf3efa9e2d2a0b4f525e 100644 (file)
@@ -32,8 +32,8 @@ m5.util.addToPath('../configs/common')
 from FSConfig import *
 from Benchmarks import *
 
-test_sys = makeLinuxAlphaSystem('atomic', SimpleMemory,
-                                 SysConfig('netperf-stream-client.rcS'))
+test_sys = makeLinuxAlphaSystem('atomic',
+                                SysConfig('netperf-stream-client.rcS'))
 
 # Create the system clock domain
 test_sys.clk_domain = SrcClockDomain(clock = '1GHz')
@@ -57,7 +57,10 @@ test_sys.iobridge = Bridge(delay='50ns', ranges = test_sys.mem_ranges)
 test_sys.iobridge.slave = test_sys.iobus.master
 test_sys.iobridge.master = test_sys.membus.slave
 
-drive_sys = makeLinuxAlphaSystem('atomic', SimpleMemory,
+test_sys.physmem = SimpleMemory(range = test_sys.mem_ranges[0])
+test_sys.physmem.port = test_sys.membus.master
+
+drive_sys = makeLinuxAlphaSystem('atomic',
                                  SysConfig('netperf-server.rcS'))
 # Create the system clock domain
 drive_sys.clk_domain = SrcClockDomain(clock = '1GHz')
@@ -77,6 +80,9 @@ drive_sys.iobridge = Bridge(delay='50ns', ranges = drive_sys.mem_ranges)
 drive_sys.iobridge.slave = drive_sys.iobus.master
 drive_sys.iobridge.master = drive_sys.membus.slave
 
+drive_sys.physmem = SimpleMemory(range = drive_sys.mem_ranges[0])
+drive_sys.physmem.port = drive_sys.membus.master
+
 root = makeDualRoot(True, test_sys, drive_sys, "ethertrace")
 
 maxtick = 199999999
index be28ba687f4cf28c7648e6b5566d1f53003d18ae..d30087df109d2d65099e7ee1341ed6e5ef16e410 100644 (file)
@@ -58,7 +58,6 @@ class LinuxX86SystemBuilder(object):
     def create_system(self):
         mdesc = SysConfig(disk = 'linux-x86.img')
         system = FSConfig.makeLinuxX86System(self.mem_mode,
-                                             DDR3_1600_x64,
                                              numCPUs=self.num_cpus,
                                              mdesc=mdesc)
         system.kernel = FSConfig.binary('x86_64-vmlinux-2.6.22.9')