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 return notifyWork(e);
62}
63
64bool
65Sensitivity::ofMethod()
66{
67 return process->procKind() == sc_core::SC_METHOD_PROC_;
68}
69

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

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

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

289 SensitivityEvent(p, signal ? &signal->value_changed_event() : nullptr),
290 _signal(signal)
291{
292 if (signal && signal->read() == val())
293 process->signalReset(true, sync());
294}
295
296bool
297ResetSensitivitySignal::notifyWork(Event *e)
298{
299 process->signalReset(_signal->read() == val(), sync());
300 return true;
301}
302
303void
304ResetSensitivityPort::setSignal(const ::sc_core::sc_signal_in_if<bool> *signal)
305{
306 _signal = signal;
307 event = &_signal->value_changed_event();
308 addToEvent(event);
309 if (signal->read() == val())
310 process->signalReset(true, sync());
311}
312
313} // namespace sc_gem5