source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Queue.h @ 103

Last change on this file since 103 was 103, checked in by moulu, 15 years ago

1) write queue vhdl
2) bug fix : in generic queue

  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1#ifndef morpheo_behavioural_generic_queue_Queue_h
2#define morpheo_behavioural_generic_queue_Queue_h
3
4/*
5 * $Id: Queue.h 103 2009-01-16 16:55:32Z moulu $
6 *
7 * [ Description ]
8 *
9 */
10
11#ifdef SYSTEMC
12#include "systemc.h"
13#endif
14
15#include <iostream>
16#include "Common/include/ToString.h"
17#include "Common/include/Debug.h"
18
19#include "Behavioural/Generic/Queue_Control/include/Queue_Control.h"
20
21#include "Behavioural/Generic/Queue/include/Types.h"
22#include "Behavioural/Generic/Queue/include/Parameters.h"
23#ifdef STATISTICS
24#include "Behavioural/include/Stat.h"
25#endif
26#include "Behavioural/include/Component.h"
27#ifdef VHDL
28#include "Behavioural/include/Vhdl.h"
29#endif
30#include "Behavioural/include/Usage.h"
31
32namespace morpheo {
33namespace behavioural {
34namespace generic {
35namespace queue {
36
37
38  class Queue
39#if SYSTEMC
40    : public sc_module
41#endif
42  {
43    // -----[ fields ]----------------------------------------------------
44    // Parameters
45  protected : const std::string       _name;
46  protected : const Parameters * _param;
47  private   : const Tusage_t     _usage;
48
49//#ifdef STATISTICS
50//  protected : const morpheo::behavioural::Parameters_Statistics * _param_statistics;
51//#endif
52
53#ifdef STATISTICS
54  public    : Stat                           * _stat;
55#endif
56
57  public    : Component                      * _component;
58  private   : Interfaces                     * _interfaces;
59
60#ifdef SYSTEMC
61    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62    // Interface
63  public    : SC_CLOCK                      *  in_CLOCK        ;
64  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
65
66    // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67  public    : SC_IN (Tcontrol_t)            *  in_INSERT_VAL;
68  public    : SC_OUT(Tcontrol_t)            * out_INSERT_ACK;
69  public    : SC_IN (Tdata_t   )            *  in_INSERT_DATA;
70
71    // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72  public    : SC_OUT(Tcontrol_t)            * out_RETIRE_VAL;
73  public    : SC_IN (Tcontrol_t)            *  in_RETIRE_ACK;
74  public    : SC_OUT(Tdata_t   )            * out_RETIRE_DATA;
75
76    // ~~~~~[ Interface "slot" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77  public    : SC_OUT(Tcontrol_t)           ** out_SLOT_VAL ; //[nb_port_slot]
78  public    : SC_OUT(Tdata_t   )           ** out_SLOT_DATA; //[nb_port_slot]
79
80    // ~~~~~[ Interface "ptr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81  public    : SC_OUT(Tptr_t    )            * out_PTR_WRITE;
82  public    : SC_OUT(Tptr_t    )            * out_PTR_READ ;
83
84    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
85  protected : morpheo::behavioural::generic::queue_control::Queue_Control * _queue_control;
86
87    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
88  protected : Tdata_t                       * _queue_data;
89
90    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91  protected : Tcontrol_t                      internal_INSERT_ACK;
92  protected : Tcontrol_t                      internal_RETIRE_VAL;
93#endif
94
95    // -----[ methods ]---------------------------------------------------
96
97#ifdef SYSTEMC
98    SC_HAS_PROCESS (Queue);
99#endif
100  public  :          Queue             
101  (
102#ifdef SYSTEMC
103   sc_module_name                                name,
104#else                                         
105   std::string                                   name,
106#endif                                         
107#ifdef STATISTICS
108   morpheo::behavioural::Parameters_Statistics * param_statistics,
109#endif
110   Parameters                                  * param,
111   morpheo::behavioural::Tusage_t                usage
112   );
113  public  :          ~Queue             (void);
114                                               
115  private : void     allocation                (void);
116  private : void     deallocation              (void);
117                                               
118#ifdef SYSTEMC                                 
119  public  : void     transition                (void);
120  public  : void     genMoore                  (void);
121#endif                                         
122
123#ifdef STATISTICS
124  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
125#endif
126                                               
127#if VHDL                                       
128  public  : void     vhdl                      (void);
129  private : void     vhdl_declaration          (Vhdl * & vhdl);
130  private : void     vhdl_body                 (Vhdl * & vhdl);
131#endif                                         
132
133#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
134  private : void     end_cycle                 (void);
135#endif
136  };
137
138}; // end namespace queue
139}; // end namespace generic
140
141}; // end namespace behavioural
142}; // end namespace morpheo             
143
144#endif
Note: See TracBrowser for help on using the repository browser.