you can add a parameter to your CPU object editing BaseCPU.py (src/cpu/*) or
TimingSimpleCPU.py (src/cpu/simple/*).

Then, you can add options to the configs/example/se.py to pass to the CPU
object.

A good example of this is how numthreads is added to the "CPUClass" object
in se.py. Maybe for you, you would add:
CPUClass.myparam = options.myparam

Then finally, in the constructor for the SimpleCPU, you can figure out a way
to pass that parameter  to the simple thread object. Note, your parameters
will be CPU visible via a "Params *p" (?) pointer that you should be able to
locate. Check the constructor for examples of how to use those too.



On Wed, Mar 9, 2011 at 12:25 PM, Griffin Wright <[email protected]> wrote:

> Hi,
>
> I'm working with making subtle changes in simple_thread.hh, and would like
> a way to toggle some code either on or off using a command line parameter so
> that I don't have to recompile everything each time.
>
> Is there a way to do this?  Trace flags won't do it, and adding parse
> options to Options.py doesn't seem to allow quite this functionality.  Of
> course, it's quite likely that it is possible and I've just not come to
> realize it yet.  I know this can be done with other simulators, but I don't
> know how to set that up with m5.
>
> Thanks,
> Griffin Wright
> _______________________________________________
> m5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
>



-- 
- Korey
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users

Reply via email to