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 --- 41 unchanged lines hidden (view full) --- 50 51void 52Sensitivity::satisfy() 53{ 54 process->satisfySensitivity(this); 55} 56 57bool |
58Sensitivity::notifyWork(Event *e) 59{ 60 satisfy(); 61 return true; 62} 63 64bool |
65Sensitivity::notify(Event *e) 66{ |
67 if (scheduler.current() == process) { 68 static bool warned = false; 69 if (!warned) { 70 SC_REPORT_WARNING("(W536) immediate self-notification ignored " 71 "as of IEEE 1666-2011", process->name()); 72 warned = true; 73 } 74 return false; 75 } 76 |
77 if (process->disabled()) 78 return false; |
79 80 return notifyWork(e); |
81} 82 83bool 84Sensitivity::ofMethod() 85{ 86 return process->procKind() == sc_core::SC_METHOD_PROC_; 87} 88 --- 126 unchanged lines hidden (view full) --- 215 216 217DynamicSensitivityEventOrList::DynamicSensitivityEventOrList( 218 Process *p, const sc_core::sc_event_or_list *eol) : 219 Sensitivity(p), DynamicSensitivity(p), SensitivityEvents(p, eol->events) 220{} 221 222bool |
223DynamicSensitivityEventOrList::notifyWork(Event *e) |
224{ |
225 events.erase(e->sc_event()); 226 227 // All the other events need this deleted from their lists since this 228 // sensitivity has been satisfied without them triggering. 229 for (auto le: events) 230 delFromEvent(le); 231 232 satisfy(); 233 return true; 234} 235 236DynamicSensitivityEventAndList::DynamicSensitivityEventAndList( 237 Process *p, const sc_core::sc_event_and_list *eal) : 238 Sensitivity(p), DynamicSensitivity(p), SensitivityEvents(p, eal->events) 239{} 240 241bool |
242DynamicSensitivityEventAndList::notifyWork(Event *e) |
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} 252 253} // namespace sc_gem5 |