Enable MP systems via cmd-line flag in fs.py.
authorSteve Reinhardt <stever@eecs.umich.edu>
Wed, 18 Oct 2006 04:15:11 +0000 (21:15 -0700)
committerSteve Reinhardt <stever@eecs.umich.edu>
Wed, 18 Oct 2006 04:15:11 +0000 (21:15 -0700)
configs/example/fs.py:
    Add flag for MP server systems.
src/python/m5/objects/AlphaConsole.py:
src/python/m5/objects/IntrControl.py:
    Change CPU from 'any' to 'cpu[0]' to work better with MP sytems.
tests/configs/tsunami-simple-atomic-dual.py:
tests/configs/tsunami-simple-timing-dual.py:
    Don't need to set console & intrcontrol cpu
    params anymore (default is fixed now).

--HG--
extra : convert_revision : 9417b12b1b395ff7d6a9f2894e4123923c754daf

configs/example/fs.py
src/python/m5/objects/AlphaConsole.py
src/python/m5/objects/IntrControl.py
tests/configs/tsunami-simple-atomic-dual.py
tests/configs/tsunami-simple-timing-dual.py

index 200b0b52207803d37e18e2533ce9d8602bd4ee48..bab6a722930e8cd9396c20c1cbb339b6f4f214df 100644 (file)
@@ -42,6 +42,7 @@ parser = optparse.OptionParser()
 
 parser.add_option("-d", "--detailed", action="store_true")
 parser.add_option("-t", "--timing", action="store_true")
+parser.add_option("-n", "--num_cpus", type="int", default=1)
 parser.add_option("-m", "--maxtick", type="int")
 parser.add_option("--maxtime", type="float")
 parser.add_option("--dual", action="store_true",
@@ -96,9 +97,11 @@ else:
         bm = [SysConfig()]
 
 server_sys = makeLinuxAlphaSystem(server_mem_mode, bm[0])
-server_sys.cpu = ServerCPUClass(cpu_id=0)
-server_sys.cpu.connectMemPorts(server_sys.membus)
-server_sys.cpu.mem = server_sys.physmem
+np = options.num_cpus
+server_sys.cpu = [ServerCPUClass(cpu_id=i) for i in xrange(np)]
+for i in xrange(np):
+    server_sys.cpu[i].connectMemPorts(server_sys.membus)
+    server_sys.cpu[i].mem = server_sys.physmem
 
 if len(bm) == 2:
     client_sys = makeLinuxAlphaSystem(client_mem_mode, bm[1])
index 1c71493b1854b18ce68d1ba4525d2d6de46057b4..f968aaa4012d129dd829723efc229dc0909cca15 100644 (file)
@@ -4,7 +4,7 @@ from Device import BasicPioDevice
 
 class AlphaConsole(BasicPioDevice):
     type = 'AlphaConsole'
-    cpu = Param.BaseCPU(Parent.any, "Processor")
+    cpu = Param.BaseCPU(Parent.cpu[0], "Processor")
     disk = Param.SimpleDisk("Simple Disk")
     sim_console = Param.SimConsole(Parent.any, "The Simulator Console")
     system = Param.AlphaSystem(Parent.any, "system object")
index 95be0f4dfc40e4e85f4770238d1958ac8d75a3c9..a7cf5cc84c93a244070ad6a4bfda604915b13de7 100644 (file)
@@ -3,4 +3,4 @@ from m5.params import *
 from m5.proxy import *
 class IntrControl(SimObject):
     type = 'IntrControl'
-    cpu = Param.BaseCPU(Parent.any, "the cpu")
+    cpu = Param.BaseCPU(Parent.cpu[0], "the cpu")
index f798213dbfa217c669d7c5806334c5194af6376b..1e6c10243603bb5c412dfcf3ce196aba7ee8d40e 100644 (file)
@@ -31,9 +31,6 @@ from m5.objects import *
 m5.AddToPath('../configs/common')
 import FSConfig
 
-AlphaConsole.cpu = Parent.cpu[0]
-IntrControl.cpu = Parent.cpu[0]
-
 cpus = [ AtomicSimpleCPU(cpu_id=i) for i in xrange(2) ]
 system = FSConfig.makeLinuxAlphaSystem('atomic')
 system.cpu = cpus
index bf94214fd8aa1d5359c77f0750f8e5fa604d8fbf..516495d18cb7d5964efc19cafee554036ebbee2b 100644 (file)
@@ -31,9 +31,6 @@ from m5.objects import *
 m5.AddToPath('../configs/common')
 import FSConfig
 
-AlphaConsole.cpu = Parent.cpu[0]
-IntrControl.cpu = Parent.cpu[0]
-
 cpus = [ TimingSimpleCPU(cpu_id=i) for i in xrange(2) ]
 system = FSConfig.makeLinuxAlphaSystem('timing')
 system.cpu = cpus