misc: Fix order of object construction in the CxxConfigManager
Review Request #3778 - Created Jan. 9, 2017 and submitted
| Information | |
|---|---|
| Christian Menard | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
The CxxConfigManager schould create objects by traversing the object tree starting from the root object. However, currently objects are created in aplphabetical order, which only works if the root object alphabetically comes before any system object (e.g. 'root' < 'system'. Otherwise (e.g. 'a_system' < 'root'), object construction may fail. The reason for this behaviour is, that the call to findObject() in the sorting code also constructs the object if it is not yet existent. Then findTraversalOrder() calls findObject("root") and subseqeuently calls findObject() on all the children, and so on. However, the call to findTraversalOrder() is redundant, since all objects are already created in alphabetical order. This patch simply removes the alphabetical ordering, leading to the objects being created starting from 'root'.
Summary: |
|
|---|
Tested this and saving/loading checkpoints still seems to work just fine.
Comment below is just in case anyone else was confused, like I was, as to how it's possible to remove the findObject() call.
Minor: The commit message doesn't conform to the style guide.
-
src/sim/cxx_manager.cc (Diff revision 1) -
In case anyone else is confused as to how this works: in findTraversalOrder, first it calls findObject("root"), then it calls findObject() on each of root's children, and so on. So there wasn't any need for the findObject call here.
Summary: |
|
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
Ship It!
