From: Steve Reinhardt Date: Tue, 17 Oct 2006 18:08:49 +0000 (-0700) Subject: Rename 'Machine' to 'SysConfig'. X-Git-Tag: m5_2.0_beta2~73^2~15^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96737c8a9bcfc6c9c145d57439aaed2ce1de5fc5;p=gem5.git Rename 'Machine' to 'SysConfig'. Clean up a little. --HG-- extra : convert_revision : db5f36776209c76a593205c46b08aa147358f33a --- diff --git a/configs/common/Benchmarks.py b/configs/common/Benchmarks.py index bb1ac1ab5..1f272517a 100644 --- a/configs/common/Benchmarks.py +++ b/configs/common/Benchmarks.py @@ -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() diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py index 470dc8867..05888b10b 100644 --- a/configs/common/FSConfig.py +++ b/configs/common/FSConfig.py @@ -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) diff --git a/configs/example/fs.py b/configs/example/fs.py index 460fb68fb..200b0b522 100644 --- a/configs/example/fs.py +++ b/configs/example/fs.py @@ -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)