diff options
author | Ciro Santilli <ciro.santilli@arm.com> | 2018-09-13 14:54:34 +0100 |
---|---|---|
committer | Ciro Santilli <ciro.santilli@arm.com> | 2018-10-19 17:12:35 +0000 |
commit | 3cceef1316f75366ca0ddbbe0f86eb0342529df3 (patch) | |
tree | 48fbbc22921bbf384317f2c287fbc0c359df6d0f /src/arch/null/isa_traits.hh | |
parent | fcc379674201ea8eb23b2cfc9bf22d7d0925f65c (diff) | |
download | gem5-3cceef1316f75366ca0ddbbe0f86eb0342529df3.tar.xz |
python: Add utility function to override config parameters
Add a utility method, SimObject.apply_config that can be used to
implement SimObject param overrides from the command line. This
function provides safe and convenient semantics for CLI assignment:
* The override expression is evaluated in a restricted environment. The
only global variables are the child objects and params from the root
object.
* Only params can be overridden. For example, calling methods or setting
attributes on SimObjects isn't possible.
* Vectors use non-standard list semantics which enable something similar
to glob expansion on the shell. For example, setting:
root.system.cpu[0:2].numThreads = 2
will override numThreads for cpu 0 and 1 and:
root.system.cpus[0,2].numThreads = 2
sets it for cpus 0 and 2.
The intention is that the helper method is called to override default
values before calling m5.instantiate.
Change-Id: I73f99da21d6d8ce1ff2ec8db2bb34338456f6799
Reviewed-on: https://gem5-review.googlesource.com/c/12984
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/arch/null/isa_traits.hh')
0 files changed, 0 insertions, 0 deletions