There are many possible and optional choices in gem5. For example,I can through the command of --debug-help
show all the possible debug options for --debug-flags
assignment. But how can I know the optional choices for --cpu-type
assignment Are there some command like --cpu-type-help
to show the optional assignment for --cpu-type
? I ran the command of gem5.opt help
,I didn't see the introduction about --cpu-type
.
How can I know what are the optional choices for the gem5 command line options such as --cpu-type?
506 views Asked by Gerrie At
2
There are 2 answers
1
On
In addition to Ciro's answer, multiple times there is a command that lists the possible values for the object type without the need to provide a random value. For example, in the case of --cpu-type
, there is a --list-cpu-types
that does exactly what you want without requiring an extra (random) argument.
In general, these commands follow the format --list-x-types
, and their function callbacks are defined at the beginning of the file configs/common/Options.py (e.g., for CPU types it is _listCpuTypes
).
Adding more lists is as easy as adding a respective ObjectList
(configs/common/ObjectList.py) instance for a selected base class. For example, this patch ported the previous code for prefetchers to use ObjectList
.
For
--cpu-type
, if you type any wrong value on the CLI e.g.:the error message prints the possible choices:
This can also be easily seen from the source (configs/common/Options.py) as well:
where
cpu_list
is defined as (configs/common/ObjectList.py):from which we deduce that valid choices are
BaseCPU
derived classes.gem5 6bc2111c9674d0c8db22f6a6adcc00e49625aabd.