source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_transition.cpp @ 75

Last change on this file since 75 was 75, checked in by rosiere, 16 years ago

Update all component (except front_end) to :

  • new statistics model
  • no namespace std
File size: 1.4 KB
Line 
1#ifdef SYSTEMC
2//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
3/*
4 * $Id$
5 *
6 * [ Description ]
7 *
8 */
9
10#include "Behavioural/Generic/Queue/include/Queue.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace generic {
15namespace 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
55#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
56    end_cycle ();
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
Note: See TracBrowser for help on using the repository browser.