Hi Tariq, You answered your own question :). DerivO3CPU inherits from BaseCPU (just not directly) in C++ and in Python.
What happens when the SimObject description file is parsed is that a new C++ class is created. In this case, there is a C++ class called DerivO3CPUParams. It inherits from BaseCPUParams since the Python SimObject inherits from BaseCPU. So, in C++, when you are constructing the DerivO3CPU, you pass the DerivO3CPU params variable to the super-class (BaseCPU, eventually) which uses those params as BaseCPUParams. Cheers, Jason On Fri, Mar 16, 2018 at 10:42 AM Tariq Slayer <[email protected]> wrote: > Thanks for your reply. I initially thought they were part of variable > defined in C++ source file, but now it makes sense that these are > set/changed in python script. > > One more thing, inside the O3CPU.py: > > class DerivO3CPU(BaseCPU): > type = 'DerivO3CPU' > cxx_header = 'cpu/o3/deriv.hh' > > The way it is defined is that Deriv03CPU inherits the BaseCPU class. > > However in the deriv.hh source, it is written such that: > > class DerivO3CPU : public FullO3CPU<O3CPUImpl> { ... > > which shows the DerivO3CPU inherits the FullO3CPU. Is this ok to define > this way if they are not matched? I know that FullO3CPU is derived from > Base03CPU, which is also a child of BaseCPU class. > > Thanks > > On Fri, Mar 16, 2018 at 11:11 AM, Jason Lowe-Power <[email protected]> > wrote: > >> Hi Tariq, >> >> The way SimObject parameters work is explained in Part 2 of Learning gem5 >> <http://learning.gem5.org/> here: >> http://learning.gem5.org/book/part2/parameters.html. It's a little >> convoluted (you have to go through python to set parameters), but it is >> incredibly flexible. >> >> The *defaults* for these parameters, specifically, can be found in >> src/cpu/o3/O3CPU.py. Of course, if you want to change these parameters you >> should do it in your Python config/run script. The best way is to derive a >> new class from DerivO3CPU and extend it with your own values for the >> parameters. Or, if you want to get fancy, you can add command-line >> parameters for the CPU parameters you want to change dynamically. >> >> Cheers, >> Jason >> >> On Fri, Mar 16, 2018 at 9:05 AM Tariq Slayer <[email protected]> >> wrote: >> >>> Hello, >>> >>> For O3CPU model, I have question regarding the parameters defined in in >>> DeriveO3CPU Params. Where are these params being defined? For example in >>> Fetch.cc source code, some of the arguments in the constructor's parameters >>> are listed like this: >>> >>> ... >>> decodeToFetchDelay(params->decodeToFetchDelay) >>> renameToFetchDelay(params->renameToFetchDelay), >>> iewToFetchDelay(params->iewToFetchDelay) >>> ... >>> >>> For each of these param-> var_name, Where are these variable (or >>> structure) defined? I know that these params are created in deriv.cc but I >>> couldn't find the variables listed above. (except for numThread). It is not >>> listed in BaseCPU class either. >>> >>> Also, I know there is a full documentation for InOrder CPU Model, but is >>> there full doc or tutorial for O3CPU as well? The wiki page of O3CPU looks >>> partially complete so I was hoping for any documentation that describes all >>> the pipeline stages and its internal organization inside the O3CPU. >>> >>> Thank you >>> _______________________________________________ >>> 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 >> > > _______________________________________________ > 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
