Hi all,
I'd like to add a command "getparm" to Ruby in order to
get a certain parameter's value.
I want it to be used like "ruby0.getparam
g_NUMBER_PROCESSORS" and it return the value "2" to me.
I did these things as the document told:
1. Decide name of command, arguments,
etc. 2. Add an entry for your command to
module/commands.py. 3. Add a
RUBY_COMMAND([COMMAND_NAME]) macro in
module/ruby.c. 4. Update module/ruby.c's
ruby_session_set() function to check for the new
command. 5. Add a declaration of [FUNCTION_NAME] to
simics/commands.h. 6. Implement [FUNCTION_NAME] in
simics/commands.C.
Then I recompiled Ruby successful. But when I used
it in a python file like this:
run("ruby0.getparam g_NUMBER_PROCESSORS")
There is something wrong. It says:
sim_core.SimExc_IllegalValue: attribute getparam in
object ruby0: illegal value Failed executing Python file:
PyRun_File() failed
Can someone tell me how I should solve this
problem? Thanks a lot!
wmy
2010.12.13
|