From 29e34a739b991af8d8e1eafe75ecb0904c324dc8 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Fri, 9 Jun 2006 23:01:31 -0400 Subject: Move main control from C++ into Python. User script now invokes initialization and simulation loop after building configuration. These functions are exported from C++ to Python using SWIG. SConstruct: Set up SWIG builder & scanner. Set up symlinking of source files into build directory (by not disabling the default behavior). configs/test/test.py: Rewrite to use new script-driven interface. Include a sample option. src/SConscript: Set up symlinking of source files into build directory (by not disabling the default behavior). Add SWIG-generated main_wrap.cc to source list. src/arch/SConscript: Set up symlinking of source files into build directory (by not disabling the default behavior). src/arch/alpha/ev5.cc: src/arch/alpha/isa/decoder.isa: src/cpu/o3/alpha_cpu_impl.hh: src/cpu/trace/opt_cpu.cc: src/cpu/trace/trace_cpu.cc: src/sim/pseudo_inst.cc: src/sim/root.cc: src/sim/serialize.cc: src/sim/syscall_emul.cc: SimExit() is now exitSimLoop(). src/cpu/base.cc: SimExitEvent is now SimLoopExitEvent src/python/SConscript: Add SWIG build command for main.i. Use python/m5 in build dir as source for zip archive... easy now with file duplication enabled. src/python/m5/__init__.py: - Move copyright notice back to C++ so we can print it right away, even for interactive sessions. - Get rid of argument parsing code; just provide default option descriptors for user script to call optparse with. - Don't clutter m5 namespace by sucking in all of m5.config and m5.objects. - Move instantiate() function here from config.py. src/python/m5/config.py: - Move instantiate() function to __init__.py. - Param.Foo deferred type lookups must use m5.objects namespace now (not m5). src/python/m5/objects/AlphaConsole.py: src/python/m5/objects/AlphaFullCPU.py: src/python/m5/objects/AlphaTLB.py: src/python/m5/objects/BadDevice.py: src/python/m5/objects/BaseCPU.py: src/python/m5/objects/BaseCache.py: src/python/m5/objects/Bridge.py: src/python/m5/objects/Bus.py: src/python/m5/objects/CoherenceProtocol.py: src/python/m5/objects/Device.py: src/python/m5/objects/DiskImage.py: src/python/m5/objects/Ethernet.py: src/python/m5/objects/Ide.py: src/python/m5/objects/IntrControl.py: src/python/m5/objects/MemObject.py: src/python/m5/objects/MemTest.py: src/python/m5/objects/Pci.py: src/python/m5/objects/PhysicalMemory.py: src/python/m5/objects/Platform.py: src/python/m5/objects/Process.py: src/python/m5/objects/Repl.py: src/python/m5/objects/Root.py: src/python/m5/objects/SimConsole.py: src/python/m5/objects/SimpleDisk.py: src/python/m5/objects/System.py: src/python/m5/objects/Tsunami.py: src/python/m5/objects/Uart.py: Fix up imports (m5 namespace no longer includes m5.config). src/sim/eventq.cc: src/sim/eventq.hh: Support for Python-called simulate() function: - Use IsExitEvent flag to signal events that want to exit the simulation loop gracefully (instead of calling exit() to terminate the process). - Modify interface to hand exit event object back to caller so it can be inspected for cause. src/sim/host.hh: Add MaxTick constant. src/sim/main.cc: Move copyright notice back to C++ so we can print it right away, even for interactive sessions. Use PYTHONPATH environment var to set module path (instead of clunky code injection method). Move main control from here into Python: - Separate initialization code and simulation loop into separate functions callable from Python. - Make Python interpreter invocation more pure (more like directly invoking interpreter). Add -i and -p flags (only options on binary itself; other options processed by Python). Import readline package when using interactive mode. src/sim/sim_events.cc: SimExitEvent is now SimLoopExitEvent, and uses IsSimExit flag to terminate loop (instead of exiting simulator process). src/sim/sim_events.hh: SimExitEvent is now SimLoopExitEvent, and uses IsSimExit flag to terminate loop (instead of exiting simulator process). Get rid of a few unused constructors. src/sim/sim_exit.hh: SimExit() is now exitSimLoop(). Get rid of unused functions. Add comments. --HG-- extra : convert_revision : 280b0d671516b25545a6f24cefa64a68319ff3d4 --- configs/test/test.py | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 75e832f5e..0c6359148 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -1,12 +1,40 @@ -from m5 import * +import os, optparse, sys +import m5 +from m5.objects import * -class HelloWorld(AlphaLiveProcess): - executable = '../configs/test/hello' - cmd = 'hello' +parser = optparse.OptionParser(option_list=m5.standardOptions) + +parser.add_option("-t", "--timing", action="store_true") + +(options, args) = parser.parse_args() + +if args: + print "Error: script doesn't take any positional arguments" + sys.exit(1) + +this_dir = os.path.dirname(__file__) + +process = AlphaLiveProcess() +process.executable = os.path.join(this_dir, 'hello') +process.cmd = 'hello' magicbus = Bus() mem = PhysicalMemory() -cpu = AtomicSimpleCPU(workload=HelloWorld(), mem=magicbus) -system = System(physmem=mem, cpu=cpu) -system.c1 = Connector(side_a=mem, side_b=magicbus) -root = Root(system=system) + +if options.timing: + cpu = TimingSimpleCPU() +else: + cpu = AtomicSimpleCPU() +cpu.workload = process +cpu.mem = magicbus + +system = System(physmem = mem, cpu = cpu) +system.c1 = Connector(side_a = mem, side_b = magicbus) +root = Root(system = system) + +m5.instantiate(root) + +exit_event = m5.simulate() + +print 'Exiting @', m5.curTick(), 'because', exit_event.getCause() + -- cgit v1.2.3 From cd6550473957258130a549ef74e2f18102b8c881 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sat, 10 Jun 2006 00:22:42 -0400 Subject: Update scripts for testing ALPHA_FS and MIPS_SE. Minor fixes to ALPHA_FS and SPARC_SE. SPARC_SE still does not compile... looks like there are unresolved issues with ExecContext -> ThreadContext rename/reorg. configs/test/fs.py: Port to new script interface/model. configs/test/test.py: Add support for running MIPS test(s) too via command-line option. src/arch/alpha/ev5.cc: Fix include file. src/arch/sparc/regfile.hh: Make Bit64 a ULL constant to avoid compiler error. --HG-- extra : convert_revision : c46c179758271c4f00171faaa579915846bf4624 --- configs/test/test.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 0c6359148..8bdea16ac 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -1,9 +1,17 @@ +# Simple test script +# +# Alpha: "m5 test.py" +# MIPS: "m5 test.py -a Mips -c hello_mips" + import os, optparse, sys import m5 from m5.objects import * +# parse command-line arguments parser = optparse.OptionParser(option_list=m5.standardOptions) +parser.add_option("-c", "--cmd", default="hello") +parser.add_option("-a", "--arch", choices=["Alpha", "Mips"], default="Alpha") parser.add_option("-t", "--timing", action="store_true") (options, args) = parser.parse_args() @@ -12,11 +20,15 @@ if args: print "Error: script doesn't take any positional arguments" sys.exit(1) +# build configuration this_dir = os.path.dirname(__file__) -process = AlphaLiveProcess() -process.executable = os.path.join(this_dir, 'hello') -process.cmd = 'hello' +print "arch =", options.arch +process_class = eval(options.arch + "LiveProcess") + +process = process_class() +process.executable = os.path.join(this_dir, options.cmd) +process.cmd = options.cmd magicbus = Bus() mem = PhysicalMemory() @@ -32,8 +44,10 @@ system = System(physmem = mem, cpu = cpu) system.c1 = Connector(side_a = mem, side_b = magicbus) root = Root(system = system) +# instantiate configuration m5.instantiate(root) +# simulate until program terminates exit_event = m5.simulate() print 'Exiting @', m5.curTick(), 'because', exit_event.getCause() -- cgit v1.2.3 From e0140202bd5f0d16d25e526283047e5a2ef5dc0c Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sun, 11 Jun 2006 21:49:46 -0400 Subject: Move LiveProcess::create() from arch-specific files bcak to main LiveProcess, then automatically select ISA based on object file type. Now simulation scripts no longer need to care about the ISA, as they can just call LiveProcess(). configs/test/test.py: Script no longer cares about ISA. src/arch/alpha/process.cc: src/arch/alpha/process.hh: src/arch/mips/process.cc: src/arch/mips/process.hh: src/arch/sparc/process.cc: src/arch/sparc/process.hh: src/sim/process.cc: src/sim/process.hh: Move create() from arch-specific files back to main LiveProcess, then automatically select ISA based on object file type. --HG-- extra : convert_revision : ef33ffdc79623b77000f5d68edd2026760b76ab6 --- configs/test/test.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 8bdea16ac..8c5b06e6a 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -11,7 +11,6 @@ from m5.objects import * parser = optparse.OptionParser(option_list=m5.standardOptions) parser.add_option("-c", "--cmd", default="hello") -parser.add_option("-a", "--arch", choices=["Alpha", "Mips"], default="Alpha") parser.add_option("-t", "--timing", action="store_true") (options, args) = parser.parse_args() @@ -23,10 +22,7 @@ if args: # build configuration this_dir = os.path.dirname(__file__) -print "arch =", options.arch -process_class = eval(options.arch + "LiveProcess") - -process = process_class() +process = LiveProcess() process.executable = os.path.join(this_dir, options.cmd) process.cmd = options.cmd -- cgit v1.2.3 From 72e4b98b8dd29b72415a1294e9e35387027d6cf9 Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Tue, 13 Jun 2006 14:15:24 -0400 Subject: Add in DetailedCPU to test. --HG-- extra : convert_revision : 98c67b45af239e1cf5bad6888da6577a4c3bb45d --- configs/test/test.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 8c5b06e6a..2ece9e675 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -6,12 +6,14 @@ import os, optparse, sys import m5 from m5.objects import * +from FullO3Config import * # parse command-line arguments parser = optparse.OptionParser(option_list=m5.standardOptions) parser.add_option("-c", "--cmd", default="hello") parser.add_option("-t", "--timing", action="store_true") +parser.add_option("-f", "--full", action="store_true") (options, args) = parser.parse_args() @@ -31,6 +33,8 @@ mem = PhysicalMemory() if options.timing: cpu = TimingSimpleCPU() +elif options.full: + cpu = DetailedCPU() else: cpu = AtomicSimpleCPU() cpu.workload = process -- cgit v1.2.3 From e981a97dec3df921f3800fd9ae5ec01ed4e9d2b1 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Tue, 13 Jun 2006 23:19:28 -0400 Subject: Move SimObject creation and Port connection loops into Python. Add Port and VectorPort objects and support for specifying port connections via assignment. The whole C++ ConfigNode hierarchy is gone now, as are C++ Connector objects. configs/test/fs.py: configs/test/test.py: Rewrite for new port connector syntax. src/SConscript: Remove unneeded files: - mem/connector.* - sim/config* src/dev/io_device.hh: src/mem/bridge.cc: src/mem/bridge.hh: src/mem/bus.cc: src/mem/bus.hh: src/mem/mem_object.hh: src/mem/physical.cc: src/mem/physical.hh: Allow getPort() to take an optional index to support vector ports (eventually). src/python/m5/__init__.py: Move SimObject construction and port connection operations into Python (with C++ calls). src/python/m5/config.py: Move SimObject construction and port connection operations into Python (with C++ calls). Add support for declaring and connecting MemObject ports in Python. src/python/m5/objects/Bus.py: src/python/m5/objects/PhysicalMemory.py: Add port declaration. src/sim/builder.cc: src/sim/builder.hh: src/sim/serialize.cc: src/sim/serialize.hh: ConfigNodes are gone; builder just gets the name of a .ini file section now. src/sim/main.cc: Move SimObject construction and port connection operations into Python (with C++ calls). Split remaining initialization operations into two parts, loadIniFile() and finalInit(). src/sim/param.cc: src/sim/param.hh: SimObject resolution done globally in Python now (not via ConfigNode hierarchy). src/sim/sim_object.cc: Remove unneeded #include. --HG-- extra : convert_revision : 2fa4001eaaec0c9a4231ef6e854f8e156d930dfe --- configs/test/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 2ece9e675..ae85af112 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -41,7 +41,7 @@ cpu.workload = process cpu.mem = magicbus system = System(physmem = mem, cpu = cpu) -system.c1 = Connector(side_a = mem, side_b = magicbus) +mem.port = magicbus.port root = Root(system = system) # instantiate configuration -- cgit v1.2.3 From 7cd362ca4e9394967f8680593b657b0bdd39d29e Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Wed, 14 Jun 2006 19:45:15 -0400 Subject: add cycle to exit message src/arch/mips/isa/formats/trap.isa: Take out fix that tried to fix trap instruction disassembly. It forces bad compile .. configs/test/test.py: add 'cycle' to exit message --HG-- extra : convert_revision : 568877797fd2806416b4cbb388cc3f7eb2492627 --- configs/test/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 2ece9e675..9ab5f6e00 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -50,5 +50,5 @@ m5.instantiate(root) # simulate until program terminates exit_event = m5.simulate() -print 'Exiting @', m5.curTick(), 'because', exit_event.getCause() +print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause() -- cgit v1.2.3 From 7b44630b958c942dca2b1de906ea9e719a3f6ff4 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Wed, 14 Jun 2006 19:53:36 -0400 Subject: change back, BK is acting up --HG-- extra : convert_revision : 11fd5ebbca0408b357e9186d1b3722eb571e874e --- configs/test/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 9ab5f6e00..2ece9e675 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -50,5 +50,5 @@ m5.instantiate(root) # simulate until program terminates exit_event = m5.simulate() -print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause() +print 'Exiting @', m5.curTick(), 'because', exit_event.getCause() -- cgit v1.2.3 From 1c55389578c0b17aa9a81f64887e7a6f02110ce4 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Wed, 14 Jun 2006 22:01:36 -0400 Subject: tried to undo change and it didnt work so might as well put it back --HG-- extra : convert_revision : 9793917e8a3e4d30f59ff469e4f08da96ce001f9 --- configs/test/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 2ece9e675..9ab5f6e00 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -50,5 +50,5 @@ m5.instantiate(root) # simulate until program terminates exit_event = m5.simulate() -print 'Exiting @', m5.curTick(), 'because', exit_event.getCause() +print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause() -- cgit v1.2.3 From baba18ab9214d1fe2236cd932c3bfca5ddfb06d6 Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Fri, 16 Jun 2006 17:08:47 -0400 Subject: Two updates that got combined into one ChangeSet accidentally. They're both pretty simple so they shouldn't cause any trouble. First: Rename FullCPU and its variants in the o3 directory to O3CPU to differentiate from the old model, and also to specify it's an out of order model. Second: Include build options for selecting the Checker to be used. These options make sure if the Checker is being used there is a CPU that supports it also being compiled. SConstruct: Add in option USE_CHECKER to allow for not compiling in checker code. The checker is enabled through this option instead of through the CPU_MODELS list. However it's still necessary to treat the Checker like a CPU model, so it is appended onto the CPU_MODELS list if enabled. configs/test/test.py: Name change for DetailedCPU to DetailedO3CPU. Also include option for max tick. src/base/traceflags.py: Add in O3CPU trace flag. src/cpu/SConscript: Rename AlphaFullCPU to AlphaO3CPU. Only include checker sources if they're necessary. Also add a list of CPUs that support the Checker, and only allow the Checker to be compiled in if one of those CPUs are also being included. src/cpu/base_dyn_inst.cc: src/cpu/base_dyn_inst.hh: Rename typedef to ImplCPU instead of FullCPU, to differentiate from the old FullCPU. src/cpu/cpu_models.py: src/cpu/o3/alpha_cpu.cc: src/cpu/o3/alpha_cpu.hh: src/cpu/o3/alpha_cpu_builder.cc: src/cpu/o3/alpha_cpu_impl.hh: Rename AlphaFullCPU to AlphaO3CPU to differentiate from old FullCPU model. src/cpu/o3/alpha_dyn_inst.hh: src/cpu/o3/alpha_dyn_inst_impl.hh: src/cpu/o3/alpha_impl.hh: src/cpu/o3/alpha_params.hh: src/cpu/o3/commit.hh: src/cpu/o3/cpu.hh: src/cpu/o3/decode.hh: src/cpu/o3/decode_impl.hh: src/cpu/o3/fetch.hh: src/cpu/o3/iew.hh: src/cpu/o3/iew_impl.hh: src/cpu/o3/inst_queue.hh: src/cpu/o3/lsq.hh: src/cpu/o3/lsq_impl.hh: src/cpu/o3/lsq_unit.hh: src/cpu/o3/regfile.hh: src/cpu/o3/rename.hh: src/cpu/o3/rename_impl.hh: src/cpu/o3/rob.hh: src/cpu/o3/rob_impl.hh: src/cpu/o3/thread_state.hh: src/python/m5/objects/AlphaO3CPU.py: Rename FullCPU to O3CPU to differentiate from old FullCPU model. src/cpu/o3/commit_impl.hh: src/cpu/o3/cpu.cc: src/cpu/o3/fetch_impl.hh: src/cpu/o3/lsq_unit_impl.hh: Rename FullCPU to O3CPU to differentiate from old FullCPU model. Also #ifdef the checker code so it doesn't need to be included if it's not selected. --HG-- rename : src/cpu/checker/o3_cpu_builder.cc => src/cpu/checker/o3_builder.cc rename : src/cpu/checker/cpu_builder.cc => src/cpu/checker/ozone_builder.cc rename : src/python/m5/objects/AlphaFullCPU.py => src/python/m5/objects/AlphaO3CPU.py extra : convert_revision : 86619baf257b8b7c8955efd447eba56e0d7acd6a --- configs/test/test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 2ece9e675..05fdb7786 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -14,6 +14,7 @@ parser = optparse.OptionParser(option_list=m5.standardOptions) parser.add_option("-c", "--cmd", default="hello") parser.add_option("-t", "--timing", action="store_true") parser.add_option("-f", "--full", action="store_true") +parser.add_option("-m", "--maxtick", type="int") (options, args) = parser.parse_args() @@ -34,7 +35,7 @@ mem = PhysicalMemory() if options.timing: cpu = TimingSimpleCPU() elif options.full: - cpu = DetailedCPU() + cpu = DetailedO3CPU() else: cpu = AtomicSimpleCPU() cpu.workload = process @@ -48,7 +49,10 @@ root = Root(system = system) m5.instantiate(root) # simulate until program terminates -exit_event = m5.simulate() +if options.maxtick: + exit_event = m5.simulate(options.maxtick) +else: + exit_event = m5.simulate() print 'Exiting @', m5.curTick(), 'because', exit_event.getCause() -- cgit v1.2.3 From aa1efe3e72e40526e1db3f99c1fbb69d3c12d28c Mon Sep 17 00:00:00 2001 From: Kevin Lim Date: Fri, 16 Jun 2006 18:04:34 -0400 Subject: Update this with the same option as single_fs.py --HG-- extra : convert_revision : 778d654f515b6af7c45165b0a9bc5ef0d60f0d19 --- configs/test/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 76791d9d7..2b5a6769f 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -13,7 +13,7 @@ parser = optparse.OptionParser(option_list=m5.standardOptions) parser.add_option("-c", "--cmd", default="hello") parser.add_option("-t", "--timing", action="store_true") -parser.add_option("-f", "--full", action="store_true") +parser.add_option("-d", "--detailed", action="store_true") parser.add_option("-m", "--maxtick", type="int") (options, args) = parser.parse_args() @@ -34,7 +34,7 @@ mem = PhysicalMemory() if options.timing: cpu = TimingSimpleCPU() -elif options.full: +elif options.detailed: cpu = DetailedO3CPU() else: cpu = AtomicSimpleCPU() -- cgit v1.2.3 From 4a9c0a7dfc8aa1fcd70ec2b194691adec9ce424e Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Sat, 17 Jun 2006 09:58:10 -0400 Subject: Add --outdir option. Didn't call it "-d" since that's already being used for "detailed cpu". Needed to add extra function for user script to pass parsed options back to m5 module. configs/test/fs.py: configs/test/test.py: Call setStandardOptions(). src/python/m5/__init__.py: Add --outdir option. Add setStandardOptions() so user script can pass parsed options back to m5 module. src/sim/main.cc: Add SWIG-wrappable function to set output dir. --HG-- extra : convert_revision : 1323bee69ca920c699a1cd1218e15b7b0875c1e5 --- configs/test/test.py | 1 + 1 file changed, 1 insertion(+) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 2b5a6769f..a570c1a08 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -17,6 +17,7 @@ parser.add_option("-d", "--detailed", action="store_true") parser.add_option("-m", "--maxtick", type="int") (options, args) = parser.parse_args() +m5.setStandardOptions(options) if args: print "Error: script doesn't take any positional arguments" -- cgit v1.2.3 From ca25e709077b8407fa378e2e19d273023fa0afa9 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Sun, 18 Jun 2006 15:58:14 -0400 Subject: use 'tick' instead of 'cycle' --HG-- extra : convert_revision : e7119d20ef95deab16081743c885979b0fa85548 --- configs/test/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index a570c1a08..48d43cee9 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -55,5 +55,5 @@ if options.maxtick: else: exit_event = m5.simulate() -print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause() +print 'Exiting @ tick', m5.curTick(), 'because', exit_event.getCause() -- cgit v1.2.3 From d80acd37bdbadb95f7f116e130f98c528ba93abe Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Mon, 26 Jun 2006 16:50:19 -0400 Subject: add python options for input file and command line options for live process --HG-- extra : convert_revision : 3db1e6d29846812378aa5174179a0686f0141580 --- configs/test/test.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index a570c1a08..738219d82 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -12,6 +12,8 @@ from FullO3Config import * parser = optparse.OptionParser(option_list=m5.standardOptions) parser.add_option("-c", "--cmd", default="hello") +parser.add_option("-o", "--options", default="") +parser.add_option("-i", "--input", default="") parser.add_option("-t", "--timing", action="store_true") parser.add_option("-d", "--detailed", action="store_true") parser.add_option("-m", "--maxtick", type="int") @@ -28,7 +30,9 @@ this_dir = os.path.dirname(__file__) process = LiveProcess() process.executable = os.path.join(this_dir, options.cmd) -process.cmd = options.cmd +process.cmd = options.cmd + " " + options.options +if options.input != "": + process.input = options.input magicbus = Bus() mem = PhysicalMemory() -- cgit v1.2.3 From 88c9b17cb927e5b789d883023db9516f878f526a Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 27 Jun 2006 14:58:46 -0400 Subject: Add help strings for options --HG-- extra : convert_revision : ebbafaf00c56a4d2ee65eea08a12d276f279135d --- configs/test/test.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 2047d65af..3095cd1d1 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -11,12 +11,19 @@ from FullO3Config import * # parse command-line arguments parser = optparse.OptionParser(option_list=m5.standardOptions) -parser.add_option("-c", "--cmd", default="hello") -parser.add_option("-o", "--options", default="") -parser.add_option("-i", "--input", default="") -parser.add_option("-t", "--timing", action="store_true") -parser.add_option("-d", "--detailed", action="store_true") -parser.add_option("-m", "--maxtick", type="int") +parser.add_option("-c", "--cmd", default="hello", + help="The binary to run in syscall emulation mode.") +parser.add_option("-o", "--options", default="", + help="The options to pass to the binary, use \" \" around the entire\ + string.") +parser.add_option("-i", "--input", default="", + help="A file of input to give to the binary.") +parser.add_option("-t", "--timing", action="store_true", + help="Use simple timing CPU.") +parser.add_option("-d", "--detailed", action="store_true", + help="Use detailed CPU.") +parser.add_option("-m", "--maxtick", type="int", + help="Set the maximum number of ticks to run for") (options, args) = parser.parse_args() m5.setStandardOptions(options) @@ -37,6 +44,10 @@ if options.input != "": magicbus = Bus() mem = PhysicalMemory() +if options.timing and options.detailed: + print "Error: you may only specify one cpu model"; + sys.exit(1) + if options.timing: cpu = TimingSimpleCPU() elif options.detailed: -- cgit v1.2.3 From 19083bc4ce379c03b39ba941c18b11a88b141e18 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Mon, 3 Jul 2006 01:10:19 -0400 Subject: Added hook to check for SMT workloads. SMT is identified by adding a semicolon between the workloads. Now SMT on the O3CPU can be invoked by "/ALPHA_SE/m5.debug ../configs/test/test.py -d --cmd="hello;hello" -i="file1;file2" I think I am a novice python magician now!!!!.... configs/test/test.py: Added hook to check for SMT workloads. SMT is identified by adding a semicolon between the workloads. Now SMT on the O3CPU can be invoked by "/ALPHA_SE/m5.debug ../configs/test/test.py -d --cmd="hello;hello" --input="file1;file2" (btw, We are back to working for this double hello world case) I am a novice python magician now!!!!.... --HG-- extra : convert_revision : b55e10dce33f5a9dc4c78f90409ec0912bad4292 --- configs/test/test.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'configs/test/test.py') diff --git a/configs/test/test.py b/configs/test/test.py index 3095cd1d1..625304a08 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -51,6 +51,25 @@ if options.timing and options.detailed: if options.timing: cpu = TimingSimpleCPU() elif options.detailed: + #check for SMT workload + workloads = options.cmd.split(';') + if len(workloads) > 1: + process = [] + smt_idx = 0 + inputs = [] + + if options.input != "": + inputs = options.input.split(';') + + for wrkld in workloads: + smt_process = LiveProcess() + smt_process.executable = os.path.join(this_dir, wrkld) + smt_process.cmd = wrkld + " " + options.options + if inputs and inputs[smt_idx]: + smt_process.input = inputs[smt_idx] + process += [smt_process, ] + smt_idx += 1 + cpu = DetailedO3CPU() else: cpu = AtomicSimpleCPU() -- cgit v1.2.3