Re: [gem5-users] Calling a C++ function in Python

2014-01-04 Thread Alex Tomala
Subject: Re: [gem5-users] Calling a C++ function in Python No, VectorParams are typed just like scalar params:    example_int = Param.Int("Description")    example_vector = VectorParam.Int("Description") Steve On Thu, Jan 2, 2014 at 5:02 PM, Alex Tomala wrote: Hello, >

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Steve Reinhardt
Alex Tomala > *Cc:* gem5 mailing list > *Sent:* Thursday, January 2, 2014 7:47:47 PM > > *Subject:* Re: [gem5-users] Calling a C++ function in Python > > Yea, you can't create the C++ versions of the objects until you've > finalized the topology in Python, and

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Alex Tomala
gem5 mailing list Sent: Thursday, January 2, 2014 7:47:47 PM Subject: Re: [gem5-users] Calling a C++ function in Python Yea, you can't create the C++ versions of the objects until you've finalized the topology in Python, and you obviously can't call a C++ method until the C++ ob

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Steve Reinhardt
> *Cc:* gem5 mailing list > *Sent:* Thursday, January 2, 2014 7:00:43 PM > > *Subject:* Re: [gem5-users] Calling a C++ function in Python > > OK, I think I see one potential problem... note that in SimObject.py where > you're getting the error we have this code: > >

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Alex Tomala
: Thursday, January 2, 2014 7:00:43 PM Subject: Re: [gem5-users] Calling a C++ function in Python OK, I think I see one potential problem... note that in SimObject.py where you're getting the error we have this code:         # If the attribute exists on the C++ object, transpar

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Steve Reinhardt
- > *From:* Steve Reinhardt > *To:* Alex Tomala > *Cc:* gem5 mailing list > *Sent:* Thursday, January 2, 2014 6:35:43 PM > > *Subject:* Re: [gem5-users] Calling a C++ function in Python > > And yet the addChild method is showing up in > build/*/python

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Alex Tomala
, 2014 6:35:43 PM Subject: Re: [gem5-users] Calling a C++ function in Python And yet the addChild method is showing up in build/*/python/m5/internal/param_ChildStates.i?  Is it also in the param_ChildStates.py file in that same directory? On Thu, Jan 2, 2014 at 3:29 PM, Alex Tomala wrote

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Steve Reinhardt
es' has no attribute 'getChild' > > This is the only method I tried, but I can't think of any other method to > get it done. > > One day I may add some information to the wiki, but I am a tad busy now. > > Best regards, > > Alex Tomala >

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Alex Tomala
Thursday, January 2, 2014 6:16:24 PM Subject: Re: [gem5-users] Calling a C++ function in Python I'm a little confused about where the 'getChild' call is coming from since 'addChild' is the method you added... are you leaving some parts out of the code you're po

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Steve Reinhardt
done. > > One day I may add some information to the wiki, but I am a tad busy now. > > Best regards, > > Alex Tomala > -- > *From:* Steve Reinhardt > *To:* Alex Tomala ; gem5 users mailing list < > gem5-users@gem5.org> > *Sent:* Thursday, January

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Alex Tomala
iki, but I am a tad busy now. Best regards, Alex Tomala From: Steve Reinhardt To: Alex Tomala ; gem5 users mailing list Sent: Thursday, January 2, 2014 5:22:47 PM Subject: Re: [gem5-users] Calling a C++ function in Python What have you tried and what probl

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Steve Reinhardt
What have you tried and what problems are you having? It should just be a matter of calling 'obj.addChild(x)' on your ChildStates object 'obj'. It looks like you've figured most of this out already, but a lot of the current mechanism was added in this changeset (see particularly the comments in t

Re: [gem5-users] Calling a C++ function in Python

2014-01-02 Thread Alex Tomala
Hello, I partially figure out the solution to the problem. I figured out that you can over ride the exports_method method from the sim object python file to add functions. Now my Python interfacing file looks like this:  from m5.params import * from m5.SimObject import SimObject from Controller

[gem5-users] Calling a C++ function in Python

2014-01-01 Thread Alex Tomala
Hello, I created a custom SimObject in C++ that has a function that I want to execute in Python. I am wondering how I can interface the function to Python as instance.function_name does not seem to work. The function I am using is called addChild and it takes a MachineID as an input. My curren