fs.py (6995:f2b4d8bea5d3) fs.py (7586:da93206873dc)
1# Copyright (c) 2010 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license
9# terms below provided that you ensure that this notice is replicated
10# unmodified and in its entirety in all distributions of the software,
11# modified or unmodified, in source code or in binary form.
12#
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

--- 42 unchanged lines hidden (view full) ---

51config_path = os.path.dirname(os.path.abspath(__file__))
52config_root = os.path.dirname(config_path)
53
54parser = optparse.OptionParser()
55
56# System options
57parser.add_option("--kernel", action="store", type="string")
58parser.add_option("--script", action="store", type="string")
13# Copyright (c) 2006-2007 The Regents of The University of Michigan
14# All rights reserved.
15#
16# Redistribution and use in source and binary forms, with or without
17# modification, are permitted provided that the following conditions are
18# met: redistributions of source code must retain the above copyright
19# notice, this list of conditions and the following disclaimer;
20# redistributions in binary form must reproduce the above copyright

--- 42 unchanged lines hidden (view full) ---

63config_path = os.path.dirname(os.path.abspath(__file__))
64config_root = os.path.dirname(config_path)
65
66parser = optparse.OptionParser()
67
68# System options
69parser.add_option("--kernel", action="store", type="string")
70parser.add_option("--script", action="store", type="string")
59
71if buildEnv['TARGET_ISA'] == "arm":
72 parser.add_option("--bare-metal", action="store_true",
73 help="Provide the raw system without the linux specific bits")
74 parser.add_option("--machine-type", action="store", type="choice",
75 choices=ArmMachineType.map.keys(), default="RealView_PBX")
60# Benchmark options
61parser.add_option("--dual", action="store_true",
62 help="Simulate two systems attached with an ethernet link")
63parser.add_option("-b", "--benchmark", action="store", type="string",
64 dest="benchmark",
65 help="Specify the benchmark to run. Available benchmarks: %s"\
66 % DefinedBenchmarks)
67

--- 39 unchanged lines hidden (view full) ---

107if buildEnv['TARGET_ISA'] == "alpha":
108 test_sys = makeLinuxAlphaSystem(test_mem_mode, bm[0])
109elif buildEnv['TARGET_ISA'] == "mips":
110 test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0])
111elif buildEnv['TARGET_ISA'] == "sparc":
112 test_sys = makeSparcSystem(test_mem_mode, bm[0])
113elif buildEnv['TARGET_ISA'] == "x86":
114 test_sys = makeLinuxX86System(test_mem_mode, np, bm[0])
76# Benchmark options
77parser.add_option("--dual", action="store_true",
78 help="Simulate two systems attached with an ethernet link")
79parser.add_option("-b", "--benchmark", action="store", type="string",
80 dest="benchmark",
81 help="Specify the benchmark to run. Available benchmarks: %s"\
82 % DefinedBenchmarks)
83

--- 39 unchanged lines hidden (view full) ---

123if buildEnv['TARGET_ISA'] == "alpha":
124 test_sys = makeLinuxAlphaSystem(test_mem_mode, bm[0])
125elif buildEnv['TARGET_ISA'] == "mips":
126 test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0])
127elif buildEnv['TARGET_ISA'] == "sparc":
128 test_sys = makeSparcSystem(test_mem_mode, bm[0])
129elif buildEnv['TARGET_ISA'] == "x86":
130 test_sys = makeLinuxX86System(test_mem_mode, np, bm[0])
131elif buildEnv['TARGET_ISA'] == "arm":
132 test_sys = makeLinuxArmSystem(test_mem_mode, bm[0],
133 bare_metal=options.bare_metal, machine_type=options.machine_type)
115else:
116 fatal("incapable of building non-alpha or non-sparc full system!")
117
118if options.kernel is not None:
119 test_sys.kernel = binary(options.kernel)
120
121if options.script is not None:
122 test_sys.readfile = options.script
123
124test_sys.cpu = [TestCPUClass(cpu_id=i) for i in xrange(np)]
125
126CacheConfig.config_cache(options, test_sys)
127
128if options.caches or options.l2cache:
134else:
135 fatal("incapable of building non-alpha or non-sparc full system!")
136
137if options.kernel is not None:
138 test_sys.kernel = binary(options.kernel)
139
140if options.script is not None:
141 test_sys.readfile = options.script
142
143test_sys.cpu = [TestCPUClass(cpu_id=i) for i in xrange(np)]
144
145CacheConfig.config_cache(options, test_sys)
146
147if options.caches or options.l2cache:
148 if bm[0]:
149 mem_size = bm[0].mem()
150 else:
151 mem_size = SysConfig().mem()
129 test_sys.bridge.filter_ranges_a=[AddrRange(0, Addr.max)]
152 test_sys.bridge.filter_ranges_a=[AddrRange(0, Addr.max)]
130 test_sys.bridge.filter_ranges_b=[AddrRange(0, size='8GB')]
131 test_sys.iocache = IOCache(addr_range=AddrRange(0, size='8GB'))
153 test_sys.bridge.filter_ranges_b=[AddrRange(mem_size)]
154 test_sys.iocache = IOCache(addr_range=mem_size)
132 test_sys.iocache.cpu_side = test_sys.iobus.port
133 test_sys.iocache.mem_side = test_sys.membus.port
134
135for i in xrange(np):
136 if options.fastmem:
137 test_sys.cpu[i].physmem_port = test_sys.physmem.port
138
139if buildEnv['TARGET_ISA'] == 'mips':
140 setMipsOptions(TestCPUClass)
141
142if len(bm) == 2:
143 if buildEnv['TARGET_ISA'] == 'alpha':
144 drive_sys = makeLinuxAlphaSystem(drive_mem_mode, bm[1])
145 elif buildEnv['TARGET_ISA'] == 'mips':
146 drive_sys = makeLinuxMipsSystem(drive_mem_mode, bm[1])
147 elif buildEnv['TARGET_ISA'] == 'sparc':
148 drive_sys = makeSparcSystem(drive_mem_mode, bm[1])
149 elif buildEnv['TARGET_ISA'] == 'x86':
150 drive_sys = makeX86System(drive_mem_mode, np, bm[1])
155 test_sys.iocache.cpu_side = test_sys.iobus.port
156 test_sys.iocache.mem_side = test_sys.membus.port
157
158for i in xrange(np):
159 if options.fastmem:
160 test_sys.cpu[i].physmem_port = test_sys.physmem.port
161
162if buildEnv['TARGET_ISA'] == 'mips':
163 setMipsOptions(TestCPUClass)
164
165if len(bm) == 2:
166 if buildEnv['TARGET_ISA'] == 'alpha':
167 drive_sys = makeLinuxAlphaSystem(drive_mem_mode, bm[1])
168 elif buildEnv['TARGET_ISA'] == 'mips':
169 drive_sys = makeLinuxMipsSystem(drive_mem_mode, bm[1])
170 elif buildEnv['TARGET_ISA'] == 'sparc':
171 drive_sys = makeSparcSystem(drive_mem_mode, bm[1])
172 elif buildEnv['TARGET_ISA'] == 'x86':
173 drive_sys = makeX86System(drive_mem_mode, np, bm[1])
174 elif buildEnv['TARGET_ISA'] == 'arm':
175 drive_sys = makeLinuxArmSystem(drive_mem_mode, bm[1])
151 drive_sys.cpu = DriveCPUClass(cpu_id=0)
152 drive_sys.cpu.connectMemPorts(drive_sys.membus)
153 if options.fastmem:
154 drive_sys.cpu.physmem_port = drive_sys.physmem.port
155 if options.kernel is not None:
156 drive_sys.kernel = binary(options.kernel)
157
158 root = makeDualRoot(test_sys, drive_sys, options.etherdump)
159elif len(bm) == 1:
160 root = Root(system=test_sys)
161else:
162 print "Error I don't know how to create more than 2 systems."
163 sys.exit(1)
164
165Simulation.run(options, root, test_sys, FutureClass)
176 drive_sys.cpu = DriveCPUClass(cpu_id=0)
177 drive_sys.cpu.connectMemPorts(drive_sys.membus)
178 if options.fastmem:
179 drive_sys.cpu.physmem_port = drive_sys.physmem.port
180 if options.kernel is not None:
181 drive_sys.kernel = binary(options.kernel)
182
183 root = makeDualRoot(test_sys, drive_sys, options.etherdump)
184elif len(bm) == 1:
185 root = Root(system=test_sys)
186else:
187 print "Error I don't know how to create more than 2 systems."
188 sys.exit(1)
189
190Simulation.run(options, root, test_sys, FutureClass)