sensitivity.cc (13288:f1c04129f709) | sensitivity.cc (13304:893e724efd57) |
---|---|
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 | 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 |
|
58Sensitivity::notify(Event *e) 59{ | 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 |
|
60 if (process->disabled()) 61 return false; | 77 if (process->disabled()) 78 return false; |
62 satisfy(); 63 return true; | 79 80 return notifyWork(e); |
64} 65 66bool 67Sensitivity::ofMethod() 68{ 69 return process->procKind() == sc_core::SC_METHOD_PROC_; 70} 71 --- 126 unchanged lines hidden (view full) --- 198 199 200DynamicSensitivityEventOrList::DynamicSensitivityEventOrList( 201 Process *p, const sc_core::sc_event_or_list *eol) : 202 Sensitivity(p), DynamicSensitivity(p), SensitivityEvents(p, eol->events) 203{} 204 205bool | 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 |
206DynamicSensitivityEventOrList::notify(Event *e) | 223DynamicSensitivityEventOrList::notifyWork(Event *e) |
207{ | 224{ |
208 if (process->disabled()) 209 return false; 210 | |
211 events.erase(e->sc_event()); 212 213 // All the other events need this deleted from their lists since this 214 // sensitivity has been satisfied without them triggering. 215 for (auto le: events) 216 delFromEvent(le); 217 218 satisfy(); 219 return true; 220} 221 222DynamicSensitivityEventAndList::DynamicSensitivityEventAndList( 223 Process *p, const sc_core::sc_event_and_list *eal) : 224 Sensitivity(p), DynamicSensitivity(p), SensitivityEvents(p, eal->events) 225{} 226 227bool | 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 |
228DynamicSensitivityEventAndList::notify(Event *e) | 242DynamicSensitivityEventAndList::notifyWork(Event *e) |
229{ | 243{ |
230 if (process->disabled()) 231 return false; 232 | |
233 events.erase(e->sc_event()); 234 235 // This sensitivity is satisfied if all events have triggered. 236 if (events.empty()) 237 satisfy(); 238 239 return true; 240} 241 242} // namespace sc_gem5 | 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 |