[67] | 1 | #ifdef SYSTEMC |
---|
| 2 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 3 | /* |
---|
| 4 | * $Id: Queue_transition.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 5 | * |
---|
| 6 | * [ Description ] |
---|
| 7 | * |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include "Behavioural/Generic/Queue/include/Queue.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace generic { |
---|
| 15 | namespace queue { |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | #undef FUNCTION |
---|
| 19 | #define FUNCTION "Queue::transition" |
---|
| 20 | void Queue::transition (void) |
---|
| 21 | { |
---|
| 22 | log_printf(FUNC,Queue,FUNCTION,"Begin"); |
---|
| 23 | |
---|
| 24 | if (PORT_READ(in_NRESET) == 0) |
---|
| 25 | { |
---|
| 26 | _queue_control->clear(); |
---|
| 27 | } |
---|
| 28 | else |
---|
| 29 | { |
---|
| 30 | // ***** PUSH to queue |
---|
| 31 | if ((PORT_READ(in_INSERT_VAL) == 1) and |
---|
| 32 | ( internal_INSERT_ACK == 1)) |
---|
| 33 | { |
---|
| 34 | log_printf(TRACE,Queue,FUNCTION,"PUSH"); |
---|
| 35 | |
---|
| 36 | // Write in reservation station |
---|
| 37 | uint32_t index = _queue_control->push(); |
---|
| 38 | |
---|
| 39 | log_printf(TRACE,Queue,FUNCTION," * index : %d",index); |
---|
| 40 | |
---|
| 41 | _queue_data[index] = PORT_READ(in_INSERT_DATA); |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | // ***** POP queue |
---|
| 45 | if (( internal_RETIRE_VAL == 1) and |
---|
| 46 | (PORT_READ(in_RETIRE_ACK) == 1)) |
---|
| 47 | { |
---|
| 48 | log_printf(TRACE,Queue,FUNCTION,"POP"); |
---|
| 49 | log_printf(TRACE,Queue,FUNCTION," * index : %d",(*_queue_control)[0]); |
---|
| 50 | |
---|
| 51 | _queue_control->pop(); |
---|
| 52 | } |
---|
| 53 | } |
---|
| 54 | |
---|
[75] | 55 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 56 | end_cycle (); |
---|
[67] | 57 | #endif |
---|
| 58 | |
---|
| 59 | log_printf(FUNC,Queue,FUNCTION,"End"); |
---|
| 60 | }; |
---|
| 61 | |
---|
| 62 | }; // end namespace queue |
---|
| 63 | }; // end namespace generic |
---|
| 64 | |
---|
| 65 | }; // end namespace behavioural |
---|
| 66 | }; // end namespace morpheo |
---|
| 67 | #endif |
---|
| 68 | //#endif |
---|