gem5 / gem5

The official repository for the gem5 computer-system architecture simulator.
http://www.gem5.org
BSD 3-Clause "New" or "Revised" License
1.71k stars 1.25k forks source link

Remove cyclic dependency of SimObjects and probes #1787

Open odanrc opened 1 week ago

odanrc commented 1 week ago

Remove SimObject pointer from ProbeManager, as it is only used to get the SimObject's name for improved debugging messages. This adds an unnecessary dependency, and since the name should not change throughout execution, it can be stored on construction instead by inheriting from the Named class.

Finally, we remove the ProbeListenerObject class, which is only supposed to act as a wrapper for SimObjects whose probe manager is the one of another object. This class was adding a cyclic dependency that complicated creating unit tests for SimObjects, and had little benefits. Thus, we instead explicitly call the object's manager on the code that needs it and remove the class.

giactra commented 1 week ago

Just wanted to flag this PR is conflicting with https://github.com/gem5/gem5/pull/1439

It would be nice if we could harmonize between them

BobbyRBruce commented 1 week ago

@studyztp : You're my expert on probes. Can you review this change and #1439?

studyztp commented 1 week ago

@studyztp : You're my expert on probes. Can you review this change and #1439?

Sure, I'll review them. For #1439, I was waiting for the update on the PR.