On 12/18/18 10:03 AM, Yunxia Zhu wrote:
> Hello everyone,
>
> I have one question about how to passing parameters from python to c.
> For example, I got a string in se.py, then I want to use this string in
> exetrace.cc. What is the interface between them? Thanks for your help.
>
Certain Python classes (those derived from SimObject I think) are
automatically used to generate C++ files that do the parameter passing.
For example, by reading se.py, we see that --cmd goes into cpu.workload.
Then I "git grep workload", and the interesting match is BaseCPU.py
workload = VectorParam.Process([], "processes to run")
Then, the best way to understand what is going on is to go into the
build directory, and:
grep -ri workload
and you will see a generated .cc file that transmits the information.
I think here the one is:
build/ARM/python/_m5/param_BaseCPU.cc
which contains:
.def_readwrite("workload", &BaseCPUParams::workload)
and finally you have to learn pybind11 :-)
>
>
> with best regards
> Yunxia Zhu
>
> _______________________________________________
> 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