eventq_impl.hh (9983:2cce74fe359e) | eventq_impl.hh (12040:8cd9d09aac7a) |
---|---|
1/* 2 * Copyright (c) 2012 The Regents of The University of Michigan 3 * Copyright (c) 2012-2013 Mark D. Hill and David A. Wood 4 * Copyright (c) 2013 Advanced Micro Devices, Inc. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions are --- 45 unchanged lines hidden (view full) --- 54 // a total order amongst the global events. See global_event.{cc,hh} 55 // for more explanation. 56 if (inParallelMode && (this != curEventQueue() || global)) { 57 asyncInsert(event); 58 } else { 59 insert(event); 60 } 61 event->flags.set(Event::Scheduled); | 1/* 2 * Copyright (c) 2012 The Regents of The University of Michigan 3 * Copyright (c) 2012-2013 Mark D. Hill and David A. Wood 4 * Copyright (c) 2013 Advanced Micro Devices, Inc. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions are --- 45 unchanged lines hidden (view full) --- 54 // a total order amongst the global events. See global_event.{cc,hh} 55 // for more explanation. 56 if (inParallelMode && (this != curEventQueue() || global)) { 57 asyncInsert(event); 58 } else { 59 insert(event); 60 } 61 event->flags.set(Event::Scheduled); |
62 event->acquire(); |
|
62 63 if (DTRACE(Event)) 64 event->trace("scheduled"); 65} 66 67inline void 68EventQueue::deschedule(Event *event) 69{ --- 4 unchanged lines hidden (view full) --- 74 remove(event); 75 76 event->flags.clear(Event::Squashed); 77 event->flags.clear(Event::Scheduled); 78 79 if (DTRACE(Event)) 80 event->trace("descheduled"); 81 | 63 64 if (DTRACE(Event)) 65 event->trace("scheduled"); 66} 67 68inline void 69EventQueue::deschedule(Event *event) 70{ --- 4 unchanged lines hidden (view full) --- 75 remove(event); 76 77 event->flags.clear(Event::Squashed); 78 event->flags.clear(Event::Scheduled); 79 80 if (DTRACE(Event)) 81 event->trace("descheduled"); 82 |
82 if (event->flags.isSet(Event::AutoDelete)) 83 delete event; | 83 event->release(); |
84} 85 86inline void 87EventQueue::reschedule(Event *event, Tick when, bool always) 88{ 89 assert(when >= getCurTick()); 90 assert(always || event->scheduled()); 91 assert(event->initialized()); 92 assert(!inParallelMode || this == curEventQueue()); 93 | 84} 85 86inline void 87EventQueue::reschedule(Event *event, Tick when, bool always) 88{ 89 assert(when >= getCurTick()); 90 assert(always || event->scheduled()); 91 assert(event->initialized()); 92 assert(!inParallelMode || this == curEventQueue()); 93 |
94 if (event->scheduled()) | 94 if (event->scheduled()) { |
95 remove(event); | 95 remove(event); |
96 } else { 97 event->acquire(); 98 } |
|
96 97 event->setWhen(when, this); 98 insert(event); 99 event->flags.clear(Event::Squashed); 100 event->flags.set(Event::Scheduled); 101 102 if (DTRACE(Event)) 103 event->trace("rescheduled"); 104} 105 106#endif // __SIM_EVENTQ_IMPL_HH__ | 99 100 event->setWhen(when, this); 101 insert(event); 102 event->flags.clear(Event::Squashed); 103 event->flags.set(Event::Scheduled); 104 105 if (DTRACE(Event)) 106 event->trace("rescheduled"); 107} 108 109#endif // __SIM_EVENTQ_IMPL_HH__ |