[Gems-users] Question about adding a command to Ruby


Date: Mon, 13 Dec 2010 19:28:10 +0800
From: "wmyhome"<wmyhome@xxxxxxxxx>
Subject: [Gems-users] Question about adding a command to Ruby
Title: Mail
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

wmyhome,wmyhome@xxxxxxxxx
2010-12-13
[← Prev in Thread] Current Thread [Next in Thread→]
  • [Gems-users] Question about adding a command to Ruby, wmyhome <=