source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h @ 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: 5.0 KB
Line 
1#ifndef morpheo_behavioural_generic_registerfile_registerfile_monolithic_RegisterFile_Monolithic
2#define morpheo_behavioural_generic_registerfile_registerfile_monolithic_RegisterFile_Monolithic
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#ifdef SYSTEMC
12#include "systemc.h"
13#endif
14
15#include "Common/include/Debug.h"
16#include "Common/include/ToString.h"
17#include <iostream>
18
19#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h"
20#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h"
21#ifdef STATISTICS
22#include "Behavioural/include/Stat.h"
23#endif
24#include "Behavioural/include/Component.h"
25#ifdef VHDL
26#include "Behavioural/include/Vhdl.h"
27#endif
28#include "Behavioural/include/Usage.h"
29
30namespace morpheo                    {
31namespace behavioural                {
32namespace generic                    {
33namespace registerfile               {
34namespace registerfile_monolithic    {
35
36  typedef enum {RW_READ, RW_WRITE} rw_t;
37
38  class RegisterFile_Monolithic
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  public    : Stat                           * _stat;
51   
52  private   : counter_t                      * _stat_nb_read;
53  private   : counter_t                      * _stat_nb_write;
54  private   : counter_t                      * _stat_average_read ;
55  private   : counter_t                      * _stat_average_write;
56  private   : counter_t                      * _stat_percent_use_read ;
57  private   : counter_t                      * _stat_percent_use_write;
58#endif
59
60  public    : Component                      * _component;
61  private   : Interfaces                     * _interfaces;
62
63#ifdef SYSTEMC
64    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65    // Interface
66  public    : SC_CLOCK                      *  in_CLOCK        ;
67  public    : SC_IN       (Tcontrol_t)      *  in_NRESET       ;
68
69    // ----- Interface Read
70  public    : SC_IN       (Tcontrol_t)     **  in_READ_VAL     ;
71  public    : SC_OUT      (Tcontrol_t)     ** out_READ_ACK     ;
72  public    : SC_IN       (Taddress_t)     **  in_READ_ADDRESS ;
73  public    : SC_OUT      (Tdata_t)        ** out_READ_DATA    ;
74
75    // ----- Interface Write
76  public    : SC_IN       (Tcontrol_t)     **  in_WRITE_VAL    ;
77  public    : SC_OUT      (Tcontrol_t)     ** out_WRITE_ACK    ;
78  public    : SC_IN       (Taddress_t)     **  in_WRITE_ADDRESS;
79  public    : SC_IN       (Tdata_t)        **  in_WRITE_DATA   ;
80
81    // ----- Interface Read_Write
82  public    : SC_IN       (Tcontrol_t)     **  in_READ_WRITE_VAL    ;
83  public    : SC_OUT      (Tcontrol_t)     ** out_READ_WRITE_ACK    ;
84  public    : SC_IN       (Tcontrol_t)     **  in_READ_WRITE_RW     ;
85  public    : SC_IN       (Taddress_t)     **  in_READ_WRITE_ADDRESS;
86  public    : SC_OUT      (Tdata_t)        ** out_READ_WRITE_RDATA  ;
87  public    : SC_IN       (Tdata_t)        **  in_READ_WRITE_WDATA  ;
88
89    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
90  private   : SC_REGISTER (Tdata_t)        ** reg_DATA         ;
91
92    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93#endif
94
95    // -----[ methods ]---------------------------------------------------
96
97#ifdef SYSTEMC
98    SC_HAS_PROCESS (RegisterFile_Monolithic);
99#endif                                         
100  public  : RegisterFile_Monolithic
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=USE_ALL
112   );
113
114  public  :          ~RegisterFile_Monolithic  (void);
115                                               
116  private : void     allocation                (void);
117  private : void     deallocation              (void);
118                                               
119#ifdef SYSTEMC                                 
120  public  : void     transition                (void);
121//public  : void     genMoore                  (void) {/* empty */};
122  public  : void     genMealy_read             (void);
123#endif                                         
124
125#ifdef STATISTICS
126  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
127#endif                                         
128
129#if VHDL                                       
130  private : void     vhdl                      (void);
131  private : void     vhdl_declaration          (Vhdl * & vhdl);
132  private : void     vhdl_body                 (Vhdl * & vhdl);
133#endif                                         
134                                               
135#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
136  private : void     end_cycle                 (void);
137#endif
138  };
139
140}; // end namespace registerfile_monolithic
141}; // end namespace registerfile
142}; // end namespace generic
143}; // end namespace behavioural         
144}; // end namespace morpheo             
145
146#endif
Note: See TracBrowser for help on using the repository browser.