From dfa8cbeb06b7556753c26b97978924c1f4a24699 Mon Sep 17 00:00:00 2001 From: Brad Beckmann Date: Sun, 6 Feb 2011 22:14:19 -0800 Subject: m5: added work completed monitoring support --- configs/common/FSConfig.py | 19 ++++++++++++++++++- configs/common/Options.py | 14 ++++++++++++++ configs/example/fs.py | 2 +- configs/example/ruby_fs.py | 2 +- 4 files changed, 34 insertions(+), 3 deletions(-) (limited to 'configs') diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py index 9b94e7ffa..e94818312 100644 --- a/configs/common/FSConfig.py +++ b/configs/common/FSConfig.py @@ -405,7 +405,8 @@ def makeX86System(mem_mode, numCPUs = 1, mdesc = None, self = None, Ruby = False for i in range(3, 15): assignISAInt(i, i) -def makeLinuxX86System(mem_mode, numCPUs = 1, mdesc = None, Ruby = False): +def makeLinuxX86System(mem_mode, options, mdesc = None, Ruby = False): + numCPUs = options.num_cpus self = LinuxX86System() # Build up the x86 system and then specialize it for Linux @@ -415,6 +416,22 @@ def makeLinuxX86System(mem_mode, numCPUs = 1, mdesc = None, Ruby = False): # just to avoid corner cases. assert(self.physmem.range.second.getValue() >= 0x200000) + # set work count options + if options.work_item_id != None: + self.work_item_id = options.work_item_id + if options.work_begin_cpu_id_exit != None: + self.work_begin_cpu_id_exit = options.work_begin_cpu_id_exit + if options.work_end_exit_count != None: + self.work_end_exit_count = options.work_end_exit_count + if options.work_end_checkpoint_count != None: + self.work_end_ckpt_count = options.work_end_checkpoint_count + if options.work_begin_exit_count != None: + self.work_begin_exit_count = options.work_begin_exit_count + if options.work_begin_checkpoint_count != None: + self.work_begin_ckpt_count = options.work_begin_checkpoint_count + if options.work_cpus_checkpoint_count != None: + self.work_cpus_ckpt_count = options.work_cpus_checkpoint_count + # Mark the first megabyte of memory as reserved self.e820_table.entries.append(X86E820Entry( addr = 0, diff --git a/configs/common/Options.py b/configs/common/Options.py index 42e1585d7..7605c7d0d 100644 --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -54,6 +54,14 @@ parser.add_option("-m", "--maxtick", type="int", default=m5.MaxTick, parser.add_option("--maxtime", type="float") parser.add_option("--maxinsts", type="int") parser.add_option("--prog_intvl", type="int") +parser.add_option("--work-item-id", action="store", type="int", + help="the specific work id for exit & checkpointing") +parser.add_option("--work-begin-cpu-id-exit", action="store", type="int", + help="exit when work starts on the specified cpu") +parser.add_option("--work-end-exit-count", action="store", type="int", + help="exit at specified work end count") +parser.add_option("--work-begin-exit-count", action="store", type="int", + help="exit at specified work begin count") # Checkpointing options @@ -69,6 +77,12 @@ parser.add_option("-r", "--checkpoint-restore", action="store", type="int", help="restore from checkpoint ") parser.add_option("--checkpoint-at-end", action="store_true", help="take a checkpoint at end of run") +parser.add_option("--work-begin-checkpoint-count", action="store", type="int", + help="checkpoint at specified work begin count") +parser.add_option("--work-end-checkpoint-count", action="store", type="int", + help="checkpoint at specified work end count") +parser.add_option("--work-cpus-checkpoint-count", action="store", type="int", + help="checkpoint and exit when active cpu count is reached") # CPU Switching - default switch model goes from a checkpoint diff --git a/configs/example/fs.py b/configs/example/fs.py index 1a052e282..a097c4138 100644 --- a/configs/example/fs.py +++ b/configs/example/fs.py @@ -131,7 +131,7 @@ elif buildEnv['TARGET_ISA'] == "mips": elif buildEnv['TARGET_ISA'] == "sparc": test_sys = makeSparcSystem(test_mem_mode, bm[0]) elif buildEnv['TARGET_ISA'] == "x86": - test_sys = makeLinuxX86System(test_mem_mode, np, bm[0]) + test_sys = makeLinuxX86System(test_mem_mode, options, bm[0]) elif buildEnv['TARGET_ISA'] == "arm": test_sys = makeLinuxArmSystem(test_mem_mode, bm[0], bare_metal=options.bare_metal, machine_type=options.machine_type) diff --git a/configs/example/ruby_fs.py b/configs/example/ruby_fs.py index 721315c9f..6f35f02cd 100644 --- a/configs/example/ruby_fs.py +++ b/configs/example/ruby_fs.py @@ -116,7 +116,7 @@ if buildEnv['TARGET_ISA'] == "alpha": system.piobus, system.dma_devices) elif buildEnv['TARGET_ISA'] == "x86": - system = makeLinuxX86System(test_mem_mode, options.num_cpus, bm[0], True) + system = makeLinuxX86System(test_mem_mode, options, bm[0], True) system.ruby = Ruby.create_system(options, system, system.piobus) -- cgit v1.2.3