Deleted Added
sdiff udiff text old ( 13303:045f002c325c ) new ( 13317:36c574a4036e )
full compact
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/messages.hh"
41#include "systemc/ext/core/sc_main.hh"
42#include "systemc/ext/core/sc_module.hh"
43
44namespace sc_gem5
45{
46
47Event::Event(sc_core::sc_event *_sc_event, bool internal) :
48 Event(_sc_event, nullptr, internal)

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

74 }
75
76 std::string path = parent ? (std::string(parent->name()) + ".") : "";
77
78 if (original_name != "" && _basename != original_name) {
79 std::string message = path + original_name +
80 ". Latter declaration will be renamed to " +
81 path + _basename;
82 SC_REPORT_WARNING(sc_core::SC_ID_INSTANCE_EXISTS_,
83 message.c_str());
84 }
85
86 _name = path + _basename;
87 }
88
89 allEvents.emplace(allEvents.end(), _sc_event);
90
91 // Determine if we're in the hierarchy (created once initialization starts

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

156 pos++;
157 }
158 senses.resize(size);
159}
160
161void
162Event::notify()
163{
164 if (scheduler.inUpdate())
165 SC_REPORT_ERROR(sc_core::SC_ID_IMMEDIATE_NOTIFICATION_, "");
166
167 // An immediate notification overrides any pending delayed notification.
168 if (delayedNotify.scheduled())
169 scheduler.deschedule(&delayedNotify);
170
171 _triggeredStamp = scheduler.changeStamp();
172 notify(staticSenseMethod);
173 notify(dynamicSenseMethod);

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

185 scheduler.deschedule(&delayedNotify);
186 }
187 scheduler.schedule(&delayedNotify, t);
188}
189
190void
191Event::notifyDelayed(const sc_core::sc_time &t)
192{
193 if (delayedNotify.scheduled())
194 SC_REPORT_ERROR(sc_core::SC_ID_NOTIFY_DELAYED_, "");
195 notify(t);
196}
197
198void
199Event::cancel()
200{
201 if (delayedNotify.scheduled())
202 scheduler.deschedule(&delayedNotify);

--- 33 unchanged lines hidden ---