event.cc (13260:4d18f1d20093) | event.cc (13268:9802f3e0a6ae) |
---|---|
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 --- 35 unchanged lines hidden (view full) --- 44{ 45 46Event::Event(sc_core::sc_event *_sc_event) : Event(_sc_event, nullptr) {} 47 48Event::Event(sc_core::sc_event *_sc_event, const char *_basename_cstr) : 49 _sc_event(_sc_event), _basename(_basename_cstr ? _basename_cstr : ""), 50 delayedNotify([this]() { this->notify(); }), _triggeredStamp(~0ULL) 51{ | 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 --- 35 unchanged lines hidden (view full) --- 44{ 45 46Event::Event(sc_core::sc_event *_sc_event) : Event(_sc_event, nullptr) {} 47 48Event::Event(sc_core::sc_event *_sc_event, const char *_basename_cstr) : 49 _sc_event(_sc_event), _basename(_basename_cstr ? _basename_cstr : ""), 50 delayedNotify([this]() { this->notify(); }), _triggeredStamp(~0ULL) 51{ |
52 Module *p = currentModule(); 53 | |
54 if (_basename == "" && ::sc_core::sc_is_running()) 55 _basename = ::sc_core::sc_gen_unique_name("event"); 56 | 52 if (_basename == "" && ::sc_core::sc_is_running()) 53 _basename = ::sc_core::sc_gen_unique_name("event"); 54 |
57 if (p) 58 parent = p->obj()->sc_obj(); 59 else if (scheduler.current()) 60 parent = scheduler.current(); 61 else 62 parent = nullptr; | 55 parent = pickParentObj(); |
63 64 std::string original_name = _basename; 65 _basename = pickUniqueName(parent, _basename); 66 67 if (parent) { 68 Object *obj = Object::getFromScObject(parent); 69 obj->addChildEvent(_sc_event); 70 } else { --- 153 unchanged lines hidden --- | 56 57 std::string original_name = _basename; 58 _basename = pickUniqueName(parent, _basename); 59 60 if (parent) { 61 Object *obj = Object::getFromScObject(parent); 62 obj->addChildEvent(_sc_event); 63 } else { --- 153 unchanged lines hidden --- |