----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/2065/#review4777 -----------------------------------------------------------
The semantics for SimObjectVectors and parenting have always been a little shaky around the edges, particularly when you start modifying them post-creation. I've wrestled with this before (see for example http://repo.gem5.org/gem5/rev/6efc3672733b and http://repo.gem5.org/gem5/rev/9f34cf472451). So while I doubt this change makes things really robust, it seems like a reasonable hack which makes things a little saner in some circumstances. src/python/m5/SimObject.py <http://reviews.gem5.org/r/2065/#comment4501> Please add to this comment "because the elements in a SimObjectVector may not share the same parent" src/python/m5/params.py <http://reviews.gem5.org/r/2065/#comment4502> Can you put a check in here and print a warning if the new item already has a parent and you're overwriting it? (See SimObject.add_child() for a similar warning.) It's not obvious you want to overwrite the parent of an already-parented object, but I would guess the common case you're addressing here is where the new object doesn't have a parent uyet. - Steve Reinhardt On Oct. 17, 2013, 9:58 a.m., Ali Saidi wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/2065/ > ----------------------------------------------------------- > > (Updated Oct. 17, 2013, 9:58 a.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 9871:9d72fd83da40 > --------------------------- > simobject: Fix handling of parents for simobject vectors > > SimObjectVector objects did not provide the same interface to > the _parent attribute through get_parent() like a normal > SimObject. It also handled assigning a _parent incorrectly > if objects in a SimObjectVector were changed post-creation, > leading to errors later when the simulator tried to execute. > This patch fixes these two omissions. > > > Diffs > ----- > > src/python/m5/SimObject.py 13ffc0066b76 > src/python/m5/params.py 13ffc0066b76 > > Diff: http://reviews.gem5.org/r/2065/diff/ > > > Testing > ------- > > > Thanks, > > Ali Saidi > > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
