1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Queue_genMoore.cpp 101 2009-01-15 17:19:08Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Generic/Queue/include/Queue.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace generic { |
---|
14 | namespace queue { |
---|
15 | |
---|
16 | #undef FUNCTION |
---|
17 | #define FUNCTION "Queue::genMoore" |
---|
18 | void Queue::genMoore (void) |
---|
19 | { |
---|
20 | log_printf(FUNC,Queue,FUNCTION,"Begin"); |
---|
21 | |
---|
22 | //--------------------------------------------- |
---|
23 | // Output |
---|
24 | //--------------------------------------------- |
---|
25 | internal_INSERT_ACK = not _queue_control->full(); |
---|
26 | internal_RETIRE_VAL = not _queue_control->empty(); |
---|
27 | |
---|
28 | PORT_WRITE(out_INSERT_ACK , internal_INSERT_ACK); |
---|
29 | PORT_WRITE(out_RETIRE_VAL , internal_RETIRE_VAL); |
---|
30 | PORT_WRITE(out_RETIRE_DATA,_queue_data[(*_queue_control)[0]]); |
---|
31 | |
---|
32 | //--------------------------------------------- |
---|
33 | // Slot |
---|
34 | //--------------------------------------------- |
---|
35 | // Note : Slot 0 is the same slot as retire interface. |
---|
36 | uint32_t nb_elt = _queue_control->nb_elt(); |
---|
37 | |
---|
38 | for (uint32_t i=0; i<_param->_nb_port_slot; ++i) |
---|
39 | { |
---|
40 | PORT_WRITE(out_SLOT_VAL [i], i<nb_elt); |
---|
41 | PORT_WRITE(out_SLOT_DATA [i],_queue_data[(*_queue_control)[i]]); |
---|
42 | } |
---|
43 | |
---|
44 | //--------------------------------------------- |
---|
45 | // Pointer |
---|
46 | //--------------------------------------------- |
---|
47 | if (_param->_have_port_ptr_write) |
---|
48 | PORT_WRITE(out_PTR_WRITE, _queue_control->ptr_push()); |
---|
49 | if (_param->_have_port_ptr_read ) |
---|
50 | PORT_WRITE(out_PTR_READ , _queue_control->ptr_pop ()); |
---|
51 | |
---|
52 | log_printf(FUNC,Queue,FUNCTION,"End"); |
---|
53 | }; |
---|
54 | |
---|
55 | }; // end namespace queue |
---|
56 | }; // end namespace generic |
---|
57 | |
---|
58 | }; // end namespace behavioural |
---|
59 | }; // end namespace morpheo |
---|
60 | #endif |
---|