49 findObjectIn(
Objects &objects,
const std::string &
name)
52 for (it = objects.begin(); it != objects.end(); it++)
53 if (!strcmp((*it)->name(), name.c_str()))
62 objects->emplace(objects->end(), object);
66 popObject(
Objects *objects,
const std::string &name)
68 ObjectsIt it = findObjectIn(*objects, name);
69 assert(it != objects->end());
70 std::swap(objects->back(), *it);
75 nameIsUnique(
Objects *objects,
Events *events,
const std::string &name)
77 for (
auto obj: *objects)
78 if (!strcmp(obj->basename(), name.c_str()))
80 for (
auto event: *events)
81 if (!strcmp(
event->basename(), name.c_str()))
115 std::string path =
"";
117 path = std::string(sc_p->
basename()) + std::string(
".") + path;
122 std::string message = path + original_name +
123 ". Latter declaration will be renamed to " +
145 child->_gem5_object->parent =
nullptr;
149 for (
auto event: events)
162 return _name.c_str();
180 out <<
"name = " <<
name() <<
"\n";
252 return events.emplace(events.end(),
e);
258 EventsIt it = std::find(events.begin(), events.end(),
e);
259 assert(it != events.end());
260 std::swap(*it, events.back());
267 std::string seed =
base;
268 while (!nameIsUnique(&
children, &events, base))
280 std::string seed =
base;
300 ObjectsIt it = findObjectIn(allObjects, name);
301 return it == allObjects.end() ? nullptr : *it;
307 std::stack<sc_core::sc_object *> objParentStack;
314 if (!objParentStack.empty())
315 return objParentStack.top();
sc_core::sc_simcontext * simcontext() const
int num_attributes() const
sc_core::sc_object * get_parent_object() const
const std::string & name()
sc_core::sc_object * parent
sc_core::sc_attr_cltn & attr_cltn()
void print(std::ostream &=std::cout) const
const std::vector< sc_core::sc_object * > & get_child_objects() const
sc_core::sc_attr_base * get_attribute(const std::string &)
const char * sc_gen_unique_name(const char *seed)
sc_core::sc_object * findObject(const char *name, const Objects &objects)
std::string pickUniqueName(std::string name)
Object(sc_core::sc_object *_sc_obj)
sc_core::sc_attr_base * remove_attribute(const std::string &)
std::vector< sc_core::sc_object * > Objects
sc_attr_base * remove(const std::string &name)
#define SC_REPORT_WARNING(msg_type, msg)
sc_core::sc_object * _sc_obj
Object & operator=(const Object &)
std::string pickUniqueName(::sc_core::sc_object *parent, std::string base)
const char SC_ID_INSTANCE_EXISTS_[]
virtual const char * kind() const
sc_gem5::Object * _gem5_object
sc_object * get_parent_object() const
sc_core::sc_object * pickParentObj()
void pushParentObj(sc_core::sc_object *obj)
void delChildEvent(sc_core::sc_event *e)
sc_simcontext * sc_get_curr_simcontext()
sc_core::sc_attr_cltn cltn
const char * basename() const
Objects::iterator ObjectsIt
const std::vector< sc_core::sc_event * > & get_child_events() const
bool push_back(sc_attr_base *)
const char * basename() const
const std::vector< sc_core::sc_object * > & getTopLevelScObjects()
void dump(std::ostream &=std::cout) const
void remove_all_attributes()
EventsIt addChildEvent(sc_core::sc_event *e)
Events::iterator EventsIt
static Event * getFromScEvent(sc_core::sc_event *e)
const char * name() const
void finish(Object *this_obj)
static Object * getFromScObject(sc_core::sc_object *sc_obj)
bool add_attribute(sc_core::sc_attr_base &)