Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00013 #ifndef ASYNC_EVENT_QUEUE_H
00014 #define ASYNC_EVENT_QUEUE_H
00015
00016 #include <systemc>
00017 #include "thread-queue.h"
00018
00025 class async_event_queue : public sc_core::sc_prim_channel {
00026 public:
00027
00028
00029
00030
00031 void async_notify_event(sc_core::sc_event &e) {
00032 m_event_queue.push(&e);
00033 async_request_update();
00034 }
00035
00036 private:
00037 void update() {
00038 sc_core::sc_event *e = NULL;
00039 while (m_event_queue.try_pop_front(e)) {
00040 e->notify(sc_core::SC_ZERO_TIME);
00041 }
00042 }
00043 thread_queue<sc_core::sc_event *> m_event_queue;
00044 };
00045
00046 #endif // ASYNC_EVENT_QUEUE_H