47findObjectIn(
Objects &objects,
const std::string &
name)
50 for (it = objects.begin(); it != objects.end(); it++)
51 if (!strcmp((*it)->name(),
name.c_str()))
60 objects->emplace(objects->end(),
object);
67 assert(it != objects->end());
68 std::swap(objects->back(), *it);
75 for (
auto obj: *objects)
76 if (!strcmp(obj->basename(),
name.c_str()))
78 for (
auto event: *events)
79 if (!strcmp(
event->basename(),
name.c_str()))
89 _sc_obj(_sc_obj), _basename(obj_name ? obj_name :
""), parent(nullptr)
113 std::string path =
"";
115 path = std::string(sc_p->
basename()) + std::string(
".") + path;
120 std::string message = path + original_name +
121 ". Latter declaration will be renamed to " +
129 Object(_sc_obj, arg._basename.c_str())
143 child->_gem5_object->parent =
nullptr;
160 return _name.c_str();
178 out <<
"name = " <<
name() <<
"\n";
257 assert(it !=
events.end());
258 std::swap(*it,
events.back());
265 std::string seed = base;
278 std::string seed = base;
299 return it ==
allObjects.end() ? nullptr : *it;
305std::stack<sc_core::sc_object *> objParentStack;
312 if (!objParentStack.empty())
313 return objParentStack.top();
bool push_back(sc_attr_base *)
sc_attr_base * remove(const std::string &name)
sc_object * get_parent_object() const
const char * basename() const
sc_gem5::Object * _gem5_object
virtual const char * kind() const
static Event * getFromScEvent(sc_core::sc_event *e)
sc_core::sc_attr_base * remove_attribute(const std::string &)
const char * name() const
EventsIt addChildEvent(sc_core::sc_event *e)
const std::vector< sc_core::sc_event * > & get_child_events() const
sc_core::sc_simcontext * simcontext() const
int num_attributes() const
Object & operator=(const Object &)
void delChildEvent(sc_core::sc_event *e)
const char * basename() const
sc_core::sc_object * get_parent_object() const
sc_core::sc_attr_cltn cltn
bool add_attribute(sc_core::sc_attr_base &)
sc_core::sc_object * _sc_obj
std::string pickUniqueName(std::string name)
void remove_all_attributes()
void dump(std::ostream &=std::cout) const
void print(std::ostream &=std::cout) const
sc_core::sc_object * parent
Object(sc_core::sc_object *_sc_obj)
const std::vector< sc_core::sc_object * > & get_child_objects() const
sc_core::sc_attr_cltn & attr_cltn()
static Object * getFromScObject(sc_core::sc_object *sc_obj)
sc_core::sc_attr_base * get_attribute(const std::string &)
const char SC_ID_INSTANCE_EXISTS_[]
sc_simcontext * sc_get_curr_simcontext()
const char * sc_gen_unique_name(const char *seed)
const std::vector< sc_core::sc_object * > & getTopLevelScObjects()
std::vector< sc_core::sc_event * > Events
std::string pickUniqueName(::sc_core::sc_object *parent, std::string base)
Events::iterator EventsIt
sc_core::sc_object * findObject(const char *name, const Objects &objects)
sc_core::sc_object * pickParentObj()
std::vector< sc_core::sc_object * > Objects
Objects::iterator ObjectsIt
void pushParentObj(sc_core::sc_object *obj)
#define SC_REPORT_WARNING(msg_type, msg)
const std::string & name()