source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_genMoore.cpp @ 123

Last change on this file since 123 was 123, checked in by rosiere, 15 years ago

1) Fix performance
2) add auto generation to SPECINT2000
3) add reset in genMoore and genMealy

  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Queue_genMoore.cpp 123 2009-06-08 20:43:30Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/Queue/include/Queue.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace 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    if (PORT_READ(in_NRESET))
23      {
24    //---------------------------------------------
25    // Output
26    //---------------------------------------------
27    internal_INSERT_ACK = not _queue_control->full();
28    internal_RETIRE_VAL = not _queue_control->empty();
29   
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    else
53      {
54        // Reset
55        internal_INSERT_ACK = 0;
56        internal_RETIRE_VAL = 0;
57
58        for (uint32_t i=0; i<_param->_nb_port_slot; ++i)
59          PORT_WRITE(out_SLOT_VAL  [i], 0);
60      }
61
62    // Write output
63    PORT_WRITE(out_INSERT_ACK , internal_INSERT_ACK);
64    PORT_WRITE(out_RETIRE_VAL , internal_RETIRE_VAL);
65
66
67    log_printf(FUNC,Queue,FUNCTION,"End");
68  };
69
70}; // end namespace queue
71}; // end namespace generic
72
73}; // end namespace behavioural
74}; // end namespace morpheo             
75#endif
Note: See TracBrowser for help on using the repository browser.