Hi Wu:
I thought the following steps might help you for this modification.
In the header file of AtomicCPU: add your variable (eg. bool
new_member) as an member of this class
in the AtomicSimpleCPU.py" file add your parameter (e.g
new_python_member= Param.Bool(False,"test a new member") )/"Bool" type
is just an example/
in the corresponding cpp file, initialize your variable in the constructor:
AtomicSimpleCPU::AtomicSimpleCPU(AtomicSimpleCPUParams *p)
........................................
new_member(p->new_python_member)
Finally, in the python script, you could chang this variable as
AtomicSimpleCPU(new_python_member==true)
Shaoming
On 7/25/2013 11:24 AM, Zheng Wu wrote:
Hi All,
I've added a new data member to AtomicSimpleCPU and I want to initialize this
member in the constructor. However, I want the user to specify the value from
the python script and pass this value to the c++ constructor.
I am looking at the code and getting quite confused about how this works. There
are various snippets of code in different locations that I think is involved in
this process:
-There is a "AtomicSimpleCPUParams" struct which is used in the constructor of
AtomicCPU
-There is "AtomicSimpleCPU.py" file
-There are all the configuration scripts in python (options.py, main.py etc)
-There are the *.i SWIG related interface files
Can some one please give me an example on how to do this? I don't know what are
the steps involved, which file do I need to change and how? Please help!
Many Thanks,
Zheng Wu
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users