summaryrefslogtreecommitdiff
path: root/src/systemc/core/object.hh
AgeCommit message (Collapse)Author
2018-10-16systemc: Centralize how object parents are chosen.Gabe Black
There's a lot of repeated code for this. Also, the sc_vector type needs to be able to artificially inject a parent for the objects it creates. Change-Id: I76f9b551632cd2cd70e26741b215290b35c382e9 Reviewed-on: https://gem5-review.googlesource.com/c/13194 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-09systemc: Report a warning if an event or object needs to be renamed.Gabe Black
Change-Id: I8085ba19fd7acd69d07a1e032f2fd18b6c5fed6f Reviewed-on: https://gem5-review.googlesource.com/c/12598 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-10-03systemc: Ensure all objects and events have unique names.Gabe Black
Change-Id: I59b78048849953773b80bb2dac9b834762625331 Reviewed-on: https://gem5-review.googlesource.com/c/12439 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Fix a couple memory errors.Gabe Black
Because events are held in vectors, it doesn't make sense to keep an iterator into the parent to keep track of where that event is for easy removal since the iterator becomes invalid when the vector is changed. The events need to be stored in a vector because systemc defines an accessor which returns that vector, and building a vector on the fly would be cumbersome. Also, make sure the Event parent pointer is set to nullptr if there isn't a parent. Change-Id: I63a676190e7747e60baaca50009161d47bfc1c54 Reviewed-on: https://gem5-review.googlesource.com/12039 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-11systemc: Make orphans top level objects instead of panic-ing.Gabe Black
When a simulation ends, the sc_objects it contains are destroyed one by one, not necessarily in hierarchy order. That means that a parent object can legitimately be destroyed before its children. Instead of panic-ing when that inevitably happens, this change makes gem5 turn those children into top level objects. Change-Id: Icad9c99310fbc3ddcadbbb4f8a990b4fbfe35bdf Reviewed-on: https://gem5-review.googlesource.com/12035 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Implement much of events, event lists and event exprs.Gabe Black
Three things aren't yet implemented, waking up processes which are sensitive to the event, triggering of events, and garbage collecting list objects which came from expression objects. The garbage collection aspect is problematic since there doesn't seem to be a correct way to implement it given the constraints in the spec, including the way that's implemented by Accellera. It's something that will need to be dealt with at some point, but in the interest of forward progress it's being ignored for now. Change-Id: Ic4e3c219ff482729f1f1302ab10181a798d48041 Reviewed-on: https://gem5-review.googlesource.com/11711 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
2018-09-05systemc: Implement most of sc_object.Gabe Black
To avoid making it hard to change sc_object's implementation in the future, this change keeps most of the data members out of sc_object and keeps them in a seperate Object which is managed independently but still matches to the sc_objects one to one. This change also moves away from the SystemC/sc_gem5 namespace pair in favor of sc_gem5. Having two namespaces with classes, etc, living in both was complicating things. Having to use a namespace that doesn't fit in one scheme or the other isn't great, but it's the lesser of two evils. Change-Id: Ib59c3c515ca98c7fe519c59e9fe9270304b71cc0 Reviewed-on: https://gem5-review.googlesource.com/11611 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>