Hi Balls,

You can use SimObject::find for that purpose. You can get the name of 
SimObjects from m5out/config.ini.
You could also implement a search-by-type template method that returns a vector 
of matching SimObjects.
Something like:

static template <typename T>
std::vector<T*> findSimObjects() {
    std::vector<T*> ret;
    for(auto so_ptr: simObjectList) {
         if (dynamic_cast<T*>(so_ptr)) ret.emplace_back(so_ptr);
    }
    return ret;
}

As to where are these SimObjects created? They are all on the heap. The 
corresponding pointers all go into SimObject::SimObjectList. The SimObject that 
are explicitely listed in a python SimObject subclass also go to the 
corresponding C++ parameter structure. You can then do whatever you want with 
these pointers in gem5. Note that SimObjetcs are never deleted if I believe my 
experiments and I would advice you no to try to delete them either ;)

Best,
Gabriel
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to