config: Add hooks to enable new config sys
Review Request #2246 - Created April 23, 2014 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10266:2fef80691ed3 --------------------------- config: Add hooks to enable new config sys This patch adds helper functions to SimObject.py, params.py and simulate.py to enable the new configuration system. Functions like enumerateParams() in SimObject lets the config system auto-generate command line options for simobjects to be modified on the command line. Params in params.py have __call__() added to their definition to allow the argparse module to use them as a type to check command input is in the proper format.
Posted (May 4, 2014, 4:56 p.m.)
Overall this looks pretty interesting. Some minor quibbles below, but no major objections (other than the 'if hasattr()' stuff at the end). I would like to see some examples of what a command-line setting looks like though to help me understand the enumerateParams() method and the ParamInfo class a little better though.
-
src/python/m5/SimObject.py (Diff revision 1) -
comment please? i don't understand the condition here, or why it's elif and not a separate if
-
src/python/m5/SimObject.py (Diff revision 1) -
Should it live in params.py? Seems like that would be more appropriate. Can it be folded in with ParamDesc?
-
src/python/m5/SimObject.py (Diff revision 1) -
This seems kind of complicated, but I'm going to wait for a higher-level description of what it's doing before I dig into it.
-
src/python/m5/SimObject.py (Diff revision 1) -
this comment seems 90% redundant with the one above... if you just move the one line of code up under this one: self._values = multidict(ancestor._values) then I think it would be self-explanatory
-
src/python/m5/SimObject.py (Diff revision 1) -
this obviously parallels the if/elif above, except for the proxy check (is it correct to skip that here?)... and like above, it could use a comment
-
src/python/m5/params.py (Diff revision 1) -
this seems clunky... would it be easier to list the classes that *can't* be set on the command line?
-
src/python/m5/params.py (Diff revision 1) -
how does printing the entire map here help? self.vals is the list of keys, I believe, which should be all that's relevant for this error message
-
src/python/m5/simulate.py (Diff revision 1) -
for all these 'if hasattr()' changes (here and below, and in simulate.py): seems like it would be much cleaner to make sure whatever dummy objects are being inserted into the config tree support dummy versions of these calls rather than add all these distributed checks all over the place. Maybe create a special DummySimObject class or something? I don't fully understand the use case here or perhaps I could be more specific.
Review request changed
Updated (July 27, 2014, 10:49 p.m.)
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+297 -8) |
Posted (Aug. 8, 2014, 2:40 a.m.)
Any final comments on this one and http://reviews.gem5.org/r/2318/?
Ship It!
