event.cc (13073:71fccb27bace) event.cc (13086:6a6fa249add7)
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

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

32#include <algorithm>
33#include <cstring>
34#include <utility>
35
36#include "base/logging.hh"
37#include "sim/core.hh"
38#include "systemc/core/module.hh"
39#include "systemc/core/scheduler.hh"
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

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

32#include <algorithm>
33#include <cstring>
34#include <utility>
35
36#include "base/logging.hh"
37#include "sim/core.hh"
38#include "systemc/core/module.hh"
39#include "systemc/core/scheduler.hh"
40#include "systemc/ext/core/sc_main.hh"
41#include "systemc/ext/core/sc_module.hh"
40
41namespace sc_gem5
42{
43
42
43namespace sc_gem5
44{
45
44Event::Event(sc_core::sc_event *_sc_event) : Event(_sc_event, "") {}
46Event::Event(sc_core::sc_event *_sc_event) : Event(_sc_event, nullptr) {}
45
47
46Event::Event(sc_core::sc_event *_sc_event, const char *_basename) :
47 _sc_event(_sc_event), _basename(_basename),
48Event::Event(sc_core::sc_event *_sc_event, const char *_basename_cstr) :
49 _sc_event(_sc_event), _basename(_basename_cstr ? _basename_cstr : ""),
48 delayedNotify([this]() { this->notify(); })
49{
50 Module *p = currentModule();
51
50 delayedNotify([this]() { this->notify(); })
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 (p)
53 parent = p->obj()->sc_obj();
54 else if (scheduler.current())
55 parent = scheduler.current();
56 else
57 parent = nullptr;
58
59 if (parent) {

--- 114 unchanged lines hidden ---
57 if (p)
58 parent = p->obj()->sc_obj();
59 else if (scheduler.current())
60 parent = scheduler.current();
61 else
62 parent = nullptr;
63
64 if (parent) {

--- 114 unchanged lines hidden ---