I doubt this is related to your problem, but don't you want to be
initializing one set of CPUs to have switched_out=False?

Ryan Gambord
<gambo...@oregonstate.edu>



On Wed, Apr 17, 2019 at 4:47 PM Shyam Murthy <shyammurth...@gmail.com>
wrote:

> Hi Jason,
>
> I am trying to hit the start of the ROI for an application and then switch
> to the Detailed CPU. For this, I wrote my version of the run function in
> Simulation.py. I am able to successfully intercept the start of workbegin,
> however I am unable to successfully CPUs.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *def run1(options, root, testsys, cpu_call):    cptdir = getcwd()
> maxtick = m5.MaxTick    root.apply_config(options.param)    checkpoint_dir
> = None    m5.instantiate(checkpoint_dir)    # the number of cpus    np =
> options.num_cpus    switch_cpus = None    switch_cpus_1 = None
> switch_cpus = [TimingSimpleCPU(switched_out=True,
> cpu_id=(i))                   for i in xrange(np)]    switch_cpus_1 =
> [DerivO3CPU(switched_out=True, cpu_id=(i))                    for i in
> xrange(np)]    for i in xrange(np):        switch_cpus[i].system =
> testsys        switch_cpus_1[i].system =  testsys
> switch_cpus[i].workload = testsys.cpu[i].workload
> switch_cpus_1[i].workload = testsys.cpu[i].workload
> switch_cpus[i].clk_domain = testsys.cpu[i].clk_domain
> switch_cpus_1[i].clk_domain = testsys.cpu[i].clk_domain
> switch_cpus[i].isa = testsys.cpu[i].isa        switch_cpus_1[i].isa =
> testsys.cpu[i].isa    while True:        exit_event = m5.simulate()
> exit_cause = exit_event.getCause()        testsys.switch_cpus =
> switch_cpus_1        # testsys.switch_cpus_1 = switch_cpus_1
> switch_cpu_list = [(testsys.cpu[i], switch_cpus_1[i]) for i in
> xrange(np)]       # switch_cpu_list_1 = [(testsys.cpu[i], switch_cpus_1[i])
> for i in xrange(np)]        if exit_cause == "workbegin":
> print("Switched CPUS @ tick on hitting ROI %s" % (m5.curTick()))
> m5.switchCpus(testsys, switch_cpu_list)        elif exit_cause ==
> "workend":            print("Reached ROI end")            break
> print(exit_event.getCause())*
>
> The above is my function. It correctly captures the workbegin, however it
> throws an error related to the new CPU it tried to switch to:
>
>
>
>
>
>
>
>
>
>
>
>
>
> *  File "<string>", line 1, in <module>  File
> "/afs/cs.wisc.edu/u/s/h/shyamm/gem5_2/src/python/m5/main.py
> <http://cs.wisc.edu/u/s/h/shyamm/gem5_2/src/python/m5/main.py>", line 438,
> in main    exec(filecode, scope)  File "configs/example/se.py", line 274,
> in <module>    Simulation.run1(options, root, system, FutureClass)  File
> "/afs/cs.wisc.edu/u/s/h/shyamm/gem5_2/configs/common/Simulation.py
> <http://cs.wisc.edu/u/s/h/shyamm/gem5_2/configs/common/Simulation.py>",
> line 467, in run1    m5.switchCpus(testsys, switch_cpu_list)  File
> "/afs/cs.wisc.edu/u/s/h/shyamm/gem5_2/src/python/m5/simulate.py
> <http://cs.wisc.edu/u/s/h/shyamm/gem5_2/src/python/m5/simulate.py>", line
> 275, in switchCpus    if not new_cpu.switchedOut():  File
> "/afs/cs.wisc.edu/u/s/h/shyamm/gem5_2/src/python/m5/SimObject.py
> <http://cs.wisc.edu/u/s/h/shyamm/gem5_2/src/python/m5/SimObject.py>", line
> 1204, in __getattr__    raise AttributeError(err_string)AttributeError:
> object 'DerivO3CPU' has no attribute 'switchedOut'  (C++ object is not yet
> constructed, so wrapped C++ methods are unavailable.)*
>
>
> The python bind does happen in the BaseCPU.py file for switchedOut
> function, I was unable to follow why this exception is still being thrown.
> Anything I am missing Jason?
>
> Thanks,
> Shyam
> _______________________________________________
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to