Deleted Added
sdiff udiff text old ( 13260:4d18f1d20093 ) new ( 13262:ef4b783f84f7 )
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

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

53 process->satisfySensitivity(this);
54}
55
56bool
57Sensitivity::notify(Event *e)
58{
59 if (process->disabled())
60 return false;
61 satisfy();
62 return true;
63}
64
65bool
66Sensitivity::ofMethod()
67{
68 return process->procKind() == sc_core::SC_METHOD_PROC_;
69}
70

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

209
210
211DynamicSensitivityEventOrList::DynamicSensitivityEventOrList(
212 Process *p, const sc_core::sc_event_or_list *eol) :
213 Sensitivity(p), DynamicSensitivity(p), SensitivityEvents(p, eol->events)
214{}
215
216bool
217DynamicSensitivityEventOrList::notify(Event *e)
218{
219 if (process->disabled())
220 return false;
221
222 events.erase(e->sc_event());
223
224 // All the other events need this deleted from their lists since this
225 // sensitivity has been satisfied without them triggering.
226 for (auto le: events)
227 delFromEvent(le);
228
229 satisfy();
230 return true;
231}
232
233DynamicSensitivityEventAndList::DynamicSensitivityEventAndList(
234 Process *p, const sc_core::sc_event_and_list *eal) :
235 Sensitivity(p), DynamicSensitivity(p), SensitivityEvents(p, eal->events)
236{}
237
238bool
239DynamicSensitivityEventAndList::notify(Event *e)
240{
241 if (process->disabled())
242 return false;
243
244 events.erase(e->sc_event());
245
246 // This sensitivity is satisfied if all events have triggered.
247 if (events.empty())
248 satisfy();
249
250 return true;
251}

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

296 SensitivityEvent(p, signal ? &signal->value_changed_event() : nullptr),
297 _signal(signal)
298{
299 if (signal && signal->read() == val())
300 process->signalReset(true, sync());
301}
302
303bool
304ResetSensitivitySignal::notify(Event *e)
305{
306 process->signalReset(_signal->read() == val(), sync());
307 return true;
308}
309
310void
311ResetSensitivityPort::setSignal(const ::sc_core::sc_signal_in_if<bool> *signal)
312{
313 _signal = signal;
314 event = &_signal->value_changed_event();
315 addToEvent(event);
316 if (signal->read() == val())
317 process->signalReset(true, sync());
318}
319
320} // namespace sc_gem5