Hi Everyone,

One of my colleagues just posted a couple of RFC patches [1, 2] that
introduce functionality to override SimObject param values from the
command line. These patches aim to solve the explosion of command line
arguments that tend to build up in example scripts when people want to
tune various parameters. I'd like to start a discussion around these
features and some feedback from the wider gem5 community.

There has been talk about adding this type of functionality, both on
the dev list and offline, for quite some time. I am of the opinion that
there should be a clear distinction between structural configuration
(instantiating objects and wiring ports) and parameter tuning. For that
reason, these changes don't provide a mechanism to instantiate new
SimObjects. Structural configuration is left to the configuration script.

It supports simple statements like "test_sys.cpu[0].socket_id = 2".
Unlike "normal" Python statements, you can operate on multiple
SimObjects at the same time using Python's slice syntax. For example,
"test_sys.cpu[0:3].socket_id = 2" sets the socket_id param on CPU 0-2.
In addition to slicing, it's posssible to select multiple indices:
"test_sys.cpu[0,1,2].socket_id = 2"

The current mini-language is a proof-of-concept and build uses a custom
Python eval environment to override parameters. The implementation
ensures that it only operates on SimObjects and Params. Other object
attributes cannot be overridden.

It would be really cool to have a richer language (e.g., something like
similar to XPath or ObjectPath[3]) to select objects with specific
properties. The current implementation tries to balance implementation
simplicity and usability by (ab)using eval in a limited environment. If
you know of a better way of doing this, please let us know.

Cheers,
Andreas

[1] https://gem5-review.googlesource.com/c/public/gem5/+/12984
[2] https://gem5-review.googlesource.com/c/public/gem5/+/12985
[3] http://objectpath.org/

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to