source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Counter.h @ 2

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 3.5 KB
Line 
1#ifndef morpheo_behavioural_generic_counter_Counter_h
2#define morpheo_behavioural_generic_counter_Counter_h
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#ifdef SYSTEMC
12#include "systemc.h"
13#endif
14
15#include <iostream>
16#include "Include/ToString.h"
17#include "Include/Debug.h"
18
19#include "Behavioural/Generic/Counter/include/Parameters.h"
20#include "Behavioural/Generic/Counter/include/Types.h"
21#ifdef STATISTICS
22#include "Behavioural/Generic/Counter/include/Statistics.h"
23#endif
24#ifdef VHDL
25#include "Behavioural/include/Vhdl.h"
26#endif
27#ifdef VHDL_TESTBENCH
28#include "Behavioural/include/Vhdl_Testbench.h"
29#endif
30
31using namespace std;
32
33namespace morpheo                    {
34namespace behavioural {
35namespace generic {
36namespace counter {
37
38
39  class Counter
40#if SYSTEMC
41    : public sc_module
42#endif
43  {
44    // -----[ fields ]----------------------------------------------------
45    // Parameters
46  protected : const string     _name;
47
48  protected : const Parameters _param;
49//#ifdef STATISTICS
50//  protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
51//#endif
52
53#ifdef STATISTICS
54  private   : Statistics                     * _stat;
55#endif
56
57#ifdef VHDL_TESTBENCH
58  private   : Vhdl_Testbench                 * _vhdl_testbench;
59#endif
60
61#ifdef SYSTEMC
62    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63    // Interface
64  public    : SC_CLOCK                      *  in_CLOCK        ;
65
66  public    : SC_IN (Tdata_t)              **  in_COUNTER_DATA         ;
67  public    : SC_IN (Tcontrol_t)           **  in_COUNTER_ADDSUB       ;
68  public    : SC_OUT(Tdata_t)              ** out_COUNTER_DATA         ;
69   
70    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
71
72    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
73
74    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75#endif
76
77    // -----[ methods ]---------------------------------------------------
78
79#ifdef SYSTEMC
80    SC_HAS_PROCESS (Counter);
81
82  public  :          Counter              (sc_module_name                              name,
83#else                                         
84  public  :          Counter              (string                                      name,
85#endif                                         
86#ifdef STATISTICS
87                                           morpheo::behavioural::Parameters_Statistics param_statistics,
88#endif
89                                           Parameters                                  param );
90                                               
91  public  :          Counter              (Parameters param );
92  public  :          ~Counter             (void);
93                                               
94#ifdef SYSTEMC                                 
95  private : void     allocation                (void);
96  private : void     deallocation              (void);
97                                               
98#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
99  public  : void     transition                (void);
100#endif
101  public  : void     genMealy                  (void);
102#endif                                         
103#ifdef STATISTICS
104  public  : string   statistics                (uint32_t depth);
105#endif
106                                               
107#if VHDL                                       
108  public  : void     vhdl                      (void);
109  private : void     vhdl_port                 (Vhdl & vhdl);
110  private : void     vhdl_declaration          (Vhdl & vhdl);
111  private : void     vhdl_body                 (Vhdl & vhdl);
112#endif                                         
113                                               
114#ifdef VHDL_TESTBENCH                         
115  private : void     vhdl_testbench_port       (void);
116  private : void     vhdl_testbench_transition (void);
117#endif
118  public  : void     vhdl_testbench_label      (string label);
119  };
120
121}; // end namespace counter
122}; // end namespace generic
123}; // end namespace behavioural
124}; // end namespace morpheo             
125
126#endif
Note: See TracBrowser for help on using the repository browser.