fs.py (6636:8c68656b8564) | fs.py (6654:4c84e771cca7) |
---|---|
1# Copyright (c) 2006-2007 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 12 unchanged lines hidden (view full) --- 21# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26# 27# Authors: Ali Saidi 28 | 1# Copyright (c) 2006-2007 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 12 unchanged lines hidden (view full) --- 21# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26# 27# Authors: Ali Saidi 28 |
29import optparse, os, sys | 29import optparse 30import os 31import sys |
30 31import m5 | 32 33import m5 |
34from m5.defines import buildEnv 35from m5.objects import * 36from m5.util import addToPath, fatal |
|
32 | 37 |
33if not m5.build_env['FULL_SYSTEM']: 34 m5.fatal("This script requires full-system mode (*_FS).") | 38if not buildEnv['FULL_SYSTEM']: 39 fatal("This script requires full-system mode (*_FS).") |
35 | 40 |
36from m5.objects import * 37m5.AddToPath('../common') | 41addToPath('../common') 42 |
38from FSConfig import * 39from SysPaths import * 40from Benchmarks import * 41import Simulation 42from Caches import * 43 44# Get paths we might need. It's expected this file is in m5/configs/example. 45config_path = os.path.dirname(os.path.abspath(__file__)) --- 47 unchanged lines hidden (view full) --- 93else: 94 if options.dual: 95 bm = [SysConfig(), SysConfig()] 96 else: 97 bm = [SysConfig()] 98 99np = options.num_cpus 100 | 43from FSConfig import * 44from SysPaths import * 45from Benchmarks import * 46import Simulation 47from Caches import * 48 49# Get paths we might need. It's expected this file is in m5/configs/example. 50config_path = os.path.dirname(os.path.abspath(__file__)) --- 47 unchanged lines hidden (view full) --- 98else: 99 if options.dual: 100 bm = [SysConfig(), SysConfig()] 101 else: 102 bm = [SysConfig()] 103 104np = options.num_cpus 105 |
101if m5.build_env['TARGET_ISA'] == "alpha": | 106if buildEnv['TARGET_ISA'] == "alpha": |
102 test_sys = makeLinuxAlphaSystem(test_mem_mode, bm[0]) | 107 test_sys = makeLinuxAlphaSystem(test_mem_mode, bm[0]) |
103elif m5.build_env['TARGET_ISA'] == "mips": | 108elif buildEnv['TARGET_ISA'] == "mips": |
104 test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0]) | 109 test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0]) |
105elif m5.build_env['TARGET_ISA'] == "sparc": | 110elif buildEnv['TARGET_ISA'] == "sparc": |
106 test_sys = makeSparcSystem(test_mem_mode, bm[0]) | 111 test_sys = makeSparcSystem(test_mem_mode, bm[0]) |
107elif m5.build_env['TARGET_ISA'] == "x86": | 112elif buildEnv['TARGET_ISA'] == "x86": |
108 test_sys = makeLinuxX86System(test_mem_mode, np, bm[0]) 109else: | 113 test_sys = makeLinuxX86System(test_mem_mode, np, bm[0]) 114else: |
110 m5.fatal("incapable of building non-alpha or non-sparc full system!") | 115 fatal("incapable of building non-alpha or non-sparc full system!") |
111 112if options.kernel is not None: 113 test_sys.kernel = binary(options.kernel) 114 115if options.script is not None: 116 test_sys.readfile = options.script 117 118if options.l2cache: --- 18 unchanged lines hidden (view full) --- 137 if options.l2cache: 138 test_sys.cpu[i].connectMemPorts(test_sys.tol2bus) 139 else: 140 test_sys.cpu[i].connectMemPorts(test_sys.membus) 141 142 if options.fastmem: 143 test_sys.cpu[i].physmem_port = test_sys.physmem.port 144 | 116 117if options.kernel is not None: 118 test_sys.kernel = binary(options.kernel) 119 120if options.script is not None: 121 test_sys.readfile = options.script 122 123if options.l2cache: --- 18 unchanged lines hidden (view full) --- 142 if options.l2cache: 143 test_sys.cpu[i].connectMemPorts(test_sys.tol2bus) 144 else: 145 test_sys.cpu[i].connectMemPorts(test_sys.membus) 146 147 if options.fastmem: 148 test_sys.cpu[i].physmem_port = test_sys.physmem.port 149 |
145if m5.build_env['TARGET_ISA'] == 'mips': | 150if buildEnv['TARGET_ISA'] == 'mips': |
146 setMipsOptions(TestCPUClass) 147 148if len(bm) == 2: | 151 setMipsOptions(TestCPUClass) 152 153if len(bm) == 2: |
149 if m5.build_env['TARGET_ISA'] == 'alpha': | 154 if buildEnv['TARGET_ISA'] == 'alpha': |
150 drive_sys = makeLinuxAlphaSystem(drive_mem_mode, bm[1]) | 155 drive_sys = makeLinuxAlphaSystem(drive_mem_mode, bm[1]) |
151 elif m5.build_env['TARGET_ISA'] == 'mips': | 156 elif buildEnv['TARGET_ISA'] == 'mips': |
152 drive_sys = makeLinuxMipsSystem(drive_mem_mode, bm[1]) | 157 drive_sys = makeLinuxMipsSystem(drive_mem_mode, bm[1]) |
153 elif m5.build_env['TARGET_ISA'] == 'sparc': | 158 elif buildEnv['TARGET_ISA'] == 'sparc': |
154 drive_sys = makeSparcSystem(drive_mem_mode, bm[1]) | 159 drive_sys = makeSparcSystem(drive_mem_mode, bm[1]) |
155 elif m5.build.env['TARGET_ISA'] == 'x86': | 160 elif buildEnv['TARGET_ISA'] == 'x86': |
156 drive_sys = makeX86System(drive_mem_mode, np, bm[1]) 157 drive_sys.cpu = DriveCPUClass(cpu_id=0) 158 drive_sys.cpu.connectMemPorts(drive_sys.membus) 159 if options.fastmem: 160 drive_sys.cpu.physmem_port = drive_sys.physmem.port 161 if options.kernel is not None: 162 drive_sys.kernel = binary(options.kernel) 163 164 root = makeDualRoot(test_sys, drive_sys, options.etherdump) 165elif len(bm) == 1: 166 root = Root(system=test_sys) 167else: 168 print "Error I don't know how to create more than 2 systems." 169 sys.exit(1) 170 171Simulation.run(options, root, test_sys, FutureClass) | 161 drive_sys = makeX86System(drive_mem_mode, np, bm[1]) 162 drive_sys.cpu = DriveCPUClass(cpu_id=0) 163 drive_sys.cpu.connectMemPorts(drive_sys.membus) 164 if options.fastmem: 165 drive_sys.cpu.physmem_port = drive_sys.physmem.port 166 if options.kernel is not None: 167 drive_sys.kernel = binary(options.kernel) 168 169 root = makeDualRoot(test_sys, drive_sys, options.etherdump) 170elif len(bm) == 1: 171 root = Root(system=test_sys) 172else: 173 print "Error I don't know how to create more than 2 systems." 174 sys.exit(1) 175 176Simulation.run(options, root, test_sys, FutureClass) |