I have a python script which looks like:
if options.benchmark == 'perlbench':
process = Mybench.perlbench
elif options.benchmark == 'bzip2':
process = Mybench.bzip2
elif options.benchmark == 'gcc':
process = Mybench.gcc
....
np = 1
....
for i in xrange(np):
...
system.cpu[i].workload = process[i]
However I get this error:
system.cpu[i].workload = process[i]
NameError: name 'process' is not defined
Any idea on how to fix that? I am not an expert in python.
The snippet you’ve posted appears to be from the
cmp.pyscript posted here (link currently down).This script is being run on the command line and requires a valid value to be specified for
-bor--benchmark. You are either not specifying one or are specifying an invalid one.The script may be modified by adding an
elsecase to display a more useful error, but it still won’t work unless you use an appropriate value.For example, you could try this: