4 # MIPS: "m5 test.py -c hello_mips"
7 import os
, optparse
, sys
8 m5
.AddToPath('../common')
11 this_dir
= os
.path
.dirname(__file__
)
13 process
= LiveProcess()
14 process
.executable
= os
.path
.join(this_dir
, options
.cmd
)
15 process
.cmd
= options
.cmd
+ " " + options
.options
16 if options
.input != "":
17 process
.input = options
.input
20 #check for SMT workload
21 workloads
= options
.cmd
.split(';')
22 if len(workloads
) > 1:
27 if options
.input != "":
28 inputs
= options
.input.split(';')
30 for wrkld
in workloads
:
31 smt_process
= LiveProcess()
32 smt_process
.executable
= os
.path
.join(this_dir
, wrkld
)
33 smt_process
.cmd
= wrkld
+ " " + options
.options
34 if inputs
and inputs
[smt_idx
]:
35 smt_process
.input = inputs
[smt_idx
]
36 process
+= [smt_process
, ]
39 cpu
.workload
= process
41 # instantiate configuration
44 # simulate until program terminates
46 exit_event
= m5
.simulate(options
.maxtick
)
48 exit_event
= m5
.simulate()
50 print 'Exiting @ tick', m5
.curTick(), 'because', exit_event
.getCause()