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

Last change on this file since 67 was 67, checked in by rosiere, 17 years ago

Ajout d'un nouveau composant : fifo generic (un port lecture et un port ecriture).

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#ifdef STATISTICS
56    _stat->add();
57#endif   
58
59#ifdef VHDL_TESTBENCH
60    vhdl_testbench_transition ();
61#endif
62
63    log_printf(FUNC,Queue,FUNCTION,"End");
64  };
65
66}; // end namespace queue
67}; // end namespace generic
68
69}; // end namespace behavioural
70}; // end namespace morpheo             
71#endif
72//#endif
Note: See TracBrowser for help on using the repository browser.