Rename 'Machine' to 'SysConfig'.
authorSteve Reinhardt <stever@eecs.umich.edu>
Tue, 17 Oct 2006 18:08:49 +0000 (11:08 -0700)
committerSteve Reinhardt <stever@eecs.umich.edu>
Tue, 17 Oct 2006 18:08:49 +0000 (11:08 -0700)
Clean up a little.

--HG--
extra : convert_revision : db5f36776209c76a593205c46b08aa147358f33a

configs/common/Benchmarks.py
configs/common/FSConfig.py
configs/example/fs.py

index bb1ac1ab505536143a2b8d1b4ef3fb1262beed34..1f272517ab3d627ecf41321bec02d01e2b4e84b2 100644 (file)
@@ -28,7 +28,7 @@
 
 from SysPaths import *
 
-class Machine:
+class SysConfig:
     def __init__(self, script=None, mem=None, disk=None):
         self.scriptname = script
         self.diskname = disk
@@ -52,54 +52,54 @@ class Machine:
         else:
             return env.get('LINUX_IMAGE', disk('linux-latest.img'))
 
-#Benchmarks are defined as a key in a dict which is a list of Machines
+# Benchmarks are defined as a key in a dict which is a list of SysConfigs
 # The first defined machine is the test system, the others are driving systems
-# Currently there is only support for 1 or 2 machines
 
-Benchmarks = {}
-Benchmarks['PovrayBench']       = [Machine('povray-bench.rcS', '512MB', 'povray.img')]
-Benchmarks['PovrayAutumn']      = [Machine('povray-autumn.rcS', '512MB', 'povray.img')]
-Benchmarks['NetperfStream']     = [Machine('netperf-stream-client.rcS'),
-                                   Machine('netperf-server.rcS')]
-Benchmarks['NetperfStreamNT']   = [Machine('netperf-stream-nt-client.rcS'),
-                                   Machine('netperf-server.rcS')]
-Benchmarks['NetperfMaerts']     = [Machine('netperf-maerts-client.rcS'),
-                                   Machine('netperf-server.rcS')]
-Benchmarks['SurgeStandard']     = [Machine('surge-server.rcS', '512MB'),
-                                   Machine('surge-client.rcS', '256MB')]
-Benchmarks['SurgeSpecweb']      = [Machine('spec-surge-server.rcS', '512MB'),
-                                   Machine('spec-surge-client.rcS', '256MB')]
-Benchmarks['Nhfsstone']         = [Machine('nfs-server-nhfsstone.rcS', '512MB'),
-                                   Machine('nfs-client-nhfsstone.rcS')]
-Benchmarks['Nfs']               = [Machine('nfs-server.rcS', '900MB'),
-                                   Machine('nfs-client-dbench.rcS')]
-Benchmarks['NfsTcp']            = [Machine('nfs-server.rcS', '900MB'),
-                                   Machine('nfs-client-tcp.rcS')]
-Benchmarks['IScsiInitiator']    = [Machine('iscsi-client.rcS', '512MB'),
-                                   Machine('iscsi-server.rcS', '512MB')]
-Benchmarks['IScsiTarget']       = [Machine('iscsi-server.rcS', '512MB'),
-                                   Machine('iscsi-client.rcS', '512MB')]
-Benchmarks['Validation']        = [Machine('iscsi-server.rcS', '512MB'),
-                                   Machine('iscsi-client.rcS', '512MB')]
-Benchmarks['Ping']              = [Machine('ping-server.rcS',),
-                                   Machine('ping-client.rcS')]
+Benchmarks = {
+    'PovrayBench':  [SysConfig('povray-bench.rcS', '512MB', 'povray.img')],
+    'PovrayAutumn': [SysConfig('povray-autumn.rcS', '512MB', 'povray.img')],
 
+    'NetperfStream':   [SysConfig('netperf-stream-client.rcS'),
+                         SysConfig('netperf-server.rcS')],
+    'NetperfStreamNT': [SysConfig('netperf-stream-nt-client.rcS'),
+                         SysConfig('netperf-server.rcS')],
+    'NetperfMaerts':   [SysConfig('netperf-maerts-client.rcS'),
+                         SysConfig('netperf-server.rcS')],
+    'SurgeStandard':   [SysConfig('surge-server.rcS', '512MB'),
+                         SysConfig('surge-client.rcS', '256MB')],
+    'SurgeSpecweb':    [SysConfig('spec-surge-server.rcS', '512MB'),
+                         SysConfig('spec-surge-client.rcS', '256MB')],
+    'Nhfsstone':       [SysConfig('nfs-server-nhfsstone.rcS', '512MB'),
+                         SysConfig('nfs-client-nhfsstone.rcS')],
+    'Nfs':             [SysConfig('nfs-server.rcS', '900MB'),
+                         SysConfig('nfs-client-dbench.rcS')],
+    'NfsTcp':          [SysConfig('nfs-server.rcS', '900MB'),
+                         SysConfig('nfs-client-tcp.rcS')],
+    'IScsiInitiator':  [SysConfig('iscsi-client.rcS', '512MB'),
+                         SysConfig('iscsi-server.rcS', '512MB')],
+    'IScsiTarget':     [SysConfig('iscsi-server.rcS', '512MB'),
+                         SysConfig('iscsi-client.rcS', '512MB')],
+    'Validation':      [SysConfig('iscsi-server.rcS', '512MB'),
+                         SysConfig('iscsi-client.rcS', '512MB')],
+    'Ping':            [SysConfig('ping-server.rcS',),
+                         SysConfig('ping-client.rcS')],
 
-Benchmarks['ValAccDelay']      = [Machine('devtime.rcS', '512MB')]
-Benchmarks['ValAccDelay2']     = [Machine('devtimewmr.rcS', '512MB')]
-Benchmarks['ValMemLat']         = [Machine('micro_memlat.rcS', '512MB')]
-Benchmarks['ValMemLat2MB']     = [Machine('micro_memlat2mb.rcS', '512MB')]
-Benchmarks['ValMemLat8MB']     = [Machine('micro_memlat8mb.rcS', '512MB')]
-Benchmarks['ValMemLat']         = [Machine('micro_memlat8.rcS', '512MB')]
-Benchmarks['ValTlbLat']         = [Machine('micro_tlblat.rcS', '512MB')]
-Benchmarks['ValSysLat']         = [Machine('micro_syscall.rcS', '512MB')]
-Benchmarks['ValCtxLat']         = [Machine('micro_ctx.rcS', '512MB')]
-Benchmarks['ValStream']         = [Machine('micro_stream.rcS', '512MB')]
-Benchmarks['ValStreamScale']   = [Machine('micro_streamscale.rcS', '512MB')]
-Benchmarks['ValStreamCopy']    = [Machine('micro_streamcopy.rcS', '512MB')]
+    'ValAccDelay':     [SysConfig('devtime.rcS', '512MB')],
+    'ValAccDelay2':    [SysConfig('devtimewmr.rcS', '512MB')],
+    'ValMemLat':       [SysConfig('micro_memlat.rcS', '512MB')],
+    'ValMemLat2MB':    [SysConfig('micro_memlat2mb.rcS', '512MB')],
+    'ValMemLat8MB':    [SysConfig('micro_memlat8mb.rcS', '512MB')],
+    'ValMemLat':       [SysConfig('micro_memlat8.rcS', '512MB')],
+    'ValTlbLat':       [SysConfig('micro_tlblat.rcS', '512MB')],
+    'ValSysLat':       [SysConfig('micro_syscall.rcS', '512MB')],
+    'ValCtxLat':       [SysConfig('micro_ctx.rcS', '512MB')],
+    'ValStream':       [SysConfig('micro_stream.rcS', '512MB')],
+    'ValStreamScale':  [SysConfig('micro_streamscale.rcS', '512MB')],
+    'ValStreamCopy':   [SysConfig('micro_streamcopy.rcS', '512MB')],
 
-
-Benchmarks['bnAn']              = [Machine('/z/saidi/work/m5.newmem.head/configs/boot/bn-app.rcS', '128MB', '/z/saidi/work/bottleneck/bnimg.img')]
+    'bnAn': [SysConfig('/z/saidi/work/m5.newmem.head/configs/boot/bn-app.rcS',
+                       '128MB', '/z/saidi/work/bottleneck/bnimg.img')]
+}
 
 benchs = Benchmarks.keys()
 benchs.sort()
index 470dc88671536f2e1d2cf100755bd5071022b356..05888b10b575a8f80f5b7dbb50ffe0ea8f964cf8 100644 (file)
@@ -49,7 +49,7 @@ def makeLinuxAlphaSystem(mem_mode, mdesc = None):
     self = LinuxAlphaSystem()
     if not mdesc:
         # generic system
-        mdesc = Machine()
+        mdesc = SysConfig()
     self.readfile = mdesc.script()
     self.iobus = Bus(bus_id=0)
     self.membus = Bus(bus_id=1)
index 460fb68fb961bab9171a5bfd5d5ef86cde23cb9e..200b0b52207803d37e18e2533ce9d8602bd4ee48 100644 (file)
@@ -64,53 +64,50 @@ if args:
     print "Error: script doesn't take any positional arguments"
     sys.exit(1)
 
+# client system CPU is always simple... note this is an assignment of
+# a class, not an instance.
+ClientCPUClass = AtomicSimpleCPU
+client_mem_mode = 'atomic'
+
 if options.detailed:
-    cpu = DerivO3CPU()
-    cpu2 = DerivO3CPU()
-    mem_mode = 'timing'
+    ServerCPUClass = DerivO3CPU
+    server_mem_mode = 'timing'
 elif options.timing:
-    cpu = TimingSimpleCPU()
-    cpu2 = TimingSimpleCPU()
-    mem_mode = 'timing'
+    ServerCPUClass = TimingSimpleCPU
+    server_mem_mode = 'timing'
 else:
-    cpu = AtomicSimpleCPU()
-    cpu2 = AtomicSimpleCPU()
-    mem_mode = 'atomic'
+    ServerCPUClass = AtomicSimpleCPU
+    server_mem_mode = 'atomic'
 
-cpu.clock = '2GHz'
-cpu2.clock = '2GHz'
-cpu.cpu_id = 0
-cpu2.cpu_id = 0
+ServerCPUClass.clock = '2GHz'
+ClientCPUClass.clock = '2GHz'
 
 if options.benchmark:
-    if options.benchmark not in Benchmarks:
+    try:
+        bm = Benchmarks[options.benchmark]
+    except KeyError:
         print "Error benchmark %s has not been defined." % options.benchmark
         print "Valid benchmarks are: %s" % DefinedBenchmarks
         sys.exit(1)
-
-    bm = Benchmarks[options.benchmark]
 else:
     if options.dual:
-        bm = [Machine(), Machine()]
+        bm = [SysConfig(), SysConfig()]
     else:
-        bm = [Machine()]
+        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
 
 if len(bm) == 2:
-    s1 = makeLinuxAlphaSystem(mem_mode, bm[0])
-    s1.cpu = cpu
-    cpu.connectMemPorts(s1.membus)
-    cpu.mem = s1.physmem
-    s2 = makeLinuxAlphaSystem(mem_mode, bm[1])
-    s2.cpu = cpu2
-    cpu2.connectMemPorts(s2.membus)
-    cpu2.mem = s2.physmem
-    root = makeDualRoot(s1, s2, options.etherdump)
+    client_sys = makeLinuxAlphaSystem(client_mem_mode, bm[1])
+    client_sys.cpu = ClientCPUClass(cpu_id=0)
+    client_sys.cpu.connectMemPorts(client_sys.membus)
+    client_sys.cpu.mem = client_sys.physmem
+    root = makeDualRoot(server_sys, client_sys, options.etherdump)
 elif len(bm) == 1:
-    root = Root(clock = '1THz',
-                system = makeLinuxAlphaSystem(mem_mode, bm[0]))
-    root.system.cpu = cpu
-    cpu.connectMemPorts(root.system.membus)
-    cpu.mem = root.system.physmem
+    root = Root(clock = '1THz', system = server_sys)
 else:
     print "Error I don't know how to create more than 2 systems."
     sys.exit(1)