sc_module.cc (13292:0dc64d73b440) sc_module.cc (13296:7f0348c6e8cf)
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 808 unchanged lines hidden (view full) ---

817 wait();
818 while (s.read() == sc_dt::Log_1)
819 wait();
820}
821
822const char *
823sc_gen_unique_name(const char *seed)
824{
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 808 unchanged lines hidden (view full) ---

817 wait();
818 while (s.read() == sc_dt::Log_1)
819 wait();
820}
821
822const char *
823sc_gen_unique_name(const char *seed)
824{
825 if (!seed || seed[0] == '\0') {
826 SC_REPORT_ERROR(
827 "(E532) cannot generate unique name from null string", "");
828 seed = "unnamed";
829 }
830
825 auto mod = sc_gem5::pickParentModule();
826 if (mod)
827 return mod->uniqueName(seed);
831 auto mod = sc_gem5::pickParentModule();
832 if (mod)
833 return mod->uniqueName(seed);
834
828 sc_gem5::Process *p = sc_gem5::scheduler.current();
829 if (p)
830 return p->uniqueName(seed);
835 sc_gem5::Process *p = sc_gem5::scheduler.current();
836 if (p)
837 return p->uniqueName(seed);
838
831 return ::sc_gem5::nameGen.gen(seed);
832}
833
834bool
835sc_hierarchical_name_exists(const char *name)
836{
837 return sc_gem5::findEvent(name) != sc_gem5::allEvents.end() ||
838 ::sc_gem5::findObject(name, sc_gem5::allObjects);

--- 23 unchanged lines hidden ---
839 return ::sc_gem5::nameGen.gen(seed);
840}
841
842bool
843sc_hierarchical_name_exists(const char *name)
844{
845 return sc_gem5::findEvent(name) != sc_gem5::allEvents.end() ||
846 ::sc_gem5::findObject(name, sc_gem5::allObjects);

--- 23 unchanged lines hidden ---