config: support outputing a pickle of the configuration tree
Review Request #930 - Created Dec. 16, 2011 and submitted
| Information | |
|---|---|
| Ali Saidi | |
| gem5 | |
| Reviewers | |
| Default | |
config: support outputing a pickle of the configuration tree This is useful as an input potential input to power models and visualization tools.
Sorry to be pedantic. I just hate duplicated code. :) It's not so bad that I require the change and I don't need to review it again if you choose to make the changes I suggest. Finally, why do you want the pickle format? I ask because json might be more generally useful. basically replace pickle.dump with json.dump and then a lot more stuff could suck in the json. (Someone could build a pretty javascript thing with canvas for displaying the configuration :)
-
src/python/m5/SimObject.py (Diff revision 1) -
This seems to be a massive repeat of the print_ini code. Could you build the ini_file code on top of this code? Also, the name ini_str is pretty outdated, is it still necessary? does str() work? We could also separate __str__ and __repr__ (though that could certainly be a separate change.
-
src/python/m5/SimObject.py (Diff revision 1) -
remove newline :P
-
src/python/m5/main.py (Diff revision 1) -
how about --pickle-config or --pickle-conf. Not sure if people know what pkl would mean
-
src/python/m5/simulate.py (Diff revision 1) -
Seems that you could use the get_dict() class here and keep the ini specific code all right here.
Posted (Jan. 4, 2012, 8:38 a.m.)
Finally figured out why reviewboard confuses me sometimes... you can't comment on a patch and reply to a previous comment at the same time, you have to do it as two separate operations (even though you can have both the original comment and a reply in progress at the same time, leading to seemingly redundant sets of edit/discard/publish buttons).
-
src/python/m5/SimObject.py (Diff revision 1) -
I'm not fond of this name... it's pretty ambiguous. I'd prefer something more descriptive like 'get_config_as_dict()'.
-
src/python/m5/simulate.py (Diff revision 1) -
This copy-and-paste comment should be updated or deleted or something.
-
src/python/m5/simulate.py (Diff revision 1) -
Doesn't this create a bunch of redundant data, since you're iterating through all the objects with root.descendants() but each object's dict recursively includes all its children too? I was expecting you to just pickle root.get_dict() and that's it.
