Can you pass reference of a simobject as a parameter to another simobject
in the configuration ( config.py ) file? How?
For example, I have an independent simobject class like Center_Ctrl and a
class Cache. ( Center_Ctrl could not be a variable of the class object
Cache but Cache could have reference ( pointer) of center_ctrl to call some
demo function and vice versa) Now, I want something like this:
center_ ctrl = Center_Ctrl( parameters)
cache1 = Cache( parameters)
cache2=Cache(parameters)
cache1.cctrl = center_ctrl
cache2.cctrl = center_ctrl
and inside the Cache class, this cctrl variable will have the pointer or
reference to the center_ctrl simobject. How could I do that ?
You need to add an attribute to the Cache python SimObject class:
cctrl = Param.Center_Ctrl(“<description>”)
You will need to import Center_Ctrl from m5.objects before as well.
You can find hundreds of examples of this construct in most python SimObject classes.
Regards,
Gabriel