63a64,109
> def get_processes(options):
> """Interprets provided options and returns a list of processes"""
>
> multiprocesses = []
> inputs = []
> outputs = []
> errouts = []
> pargs = []
>
> workloads = options.cmd.split(';')
> if options.input != "":
> inputs = options.input.split(';')
> if options.output != "":
> outputs = options.output.split(';')
> if options.errout != "":
> errouts = options.errout.split(';')
> if options.options != "":
> pargs = options.options.split(';')
>
> idx = 0
> for wrkld in workloads:
> process = LiveProcess()
> process.executable = wrkld
>
> if len(pargs) > idx:
> process.cmd = [wrkld] + [" "] + [pargs[idx]]
> else:
> process.cmd = [wrkld]
>
> if len(inputs) > idx:
> process.input = inputs[idx]
> if len(outputs) > idx:
> process.output = outputs[idx]
> if len(errouts) > idx:
> process.errout = errouts[idx]
>
> multiprocesses.append(process)
> idx += 1
>
> if options.smt:
> assert(options.cpu_type == "detailed" or options.cpu_type == "inorder")
> return multiprocesses, idx
> else:
> return multiprocesses, 1
>
>
78c124
< apps = []
---
> numThreads = 1
97,100c143
< process = LiveProcess()
< process.executable = options.cmd
< process.cmd = [options.cmd] + options.options.split()
< multiprocesses.append(process)
---
> multiprocesses, numThreads = get_processes(options)
106,148d148
< if options.input != "":
< process.input = options.input
< if options.output != "":
< process.output = options.output
< if options.errout != "":
< process.errout = options.errout
<
<
< # By default, set workload to path of user-specified binary
< workloads = options.cmd
< numThreads = 1
<
< if options.cpu_type == "detailed" or options.cpu_type == "inorder":
< #check for SMT workload
< workloads = options.cmd.split(';')
< if len(workloads) > 1:
< process = []
< smt_idx = 0
< inputs = []
< outputs = []
< errouts = []
<
< if options.input != "":
< inputs = options.input.split(';')
< if options.output != "":
< outputs = options.output.split(';')
< if options.errout != "":
< errouts = options.errout.split(';')
<
< for wrkld in workloads:
< smt_process = LiveProcess()
< smt_process.executable = wrkld
< smt_process.cmd = wrkld + " " + options.options
< if inputs and inputs[smt_idx]:
< smt_process.input = inputs[smt_idx]
< if outputs and outputs[smt_idx]:
< smt_process.output = outputs[smt_idx]
< if errouts and errouts[smt_idx]:
< smt_process.errout = errouts[smt_idx]
< process += [smt_process, ]
< smt_idx += 1
< numThreads = len(workloads)
<
151c151
< CPUClass.numThreads = numThreads;
---
> CPUClass.numThreads = numThreads
153c153,155
< np = options.num_cpus
---
> # Check -- do not allow SMT with multiple CPUs
> if options.smt and options.num_cpus > 1:
> fatal("You cannot use SMT with multiple CPUs!")
154a157
> np = options.num_cpus
164c167,169
< if len(multiprocesses) == 1:
---
> if options.smt:
> system.cpu[i].workload = multiprocesses
> elif len(multiprocesses) == 1: