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 --- 204 unchanged lines hidden (view full) --- 213 void setEventQueue(EventQueue *_eq) { eq = _eq; } 214 215 // Get the current time according to gem5. 216 Tick getCurTick() { return eq ? eq->getCurTick() : 0; } 217 218 Tick 219 delayed(const ::sc_core::sc_time &delay) 220 { |
221 return getCurTick() + delay.value(); |
222 } 223 224 // For scheduling delayed/timed notifications/timeouts. 225 void 226 schedule(ScEvent *event, const ::sc_core::sc_time &delay) 227 { 228 Tick tick = delayed(delay); 229 if (tick < getCurTick()) --- 278 unchanged lines hidden --- |