source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h @ 57

Last change on this file since 57 was 57, checked in by rosiere, 17 years ago
  • VHDL - RegisterFile_Multi_Banked (only partial_crossbar)
  • SystemC - modif Component, interface and co -> ajout du type Tusage_T pour instancier un coposant mais ne demander que le VHDL ou le systemC.
  • Séminaire interne
File size: 4.7 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>
18using namespace std;
19
20#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h"
21#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h"
22#ifdef STATISTICS
23#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h"
24#endif
25#include "Behavioural/include/Component.h"
26#ifdef VHDL
27#include "Behavioural/include/Vhdl.h"
28#endif
29#include "Behavioural/include/Usage.h"
30
31using namespace std;
32
33namespace morpheo                    {
34namespace behavioural                {
35namespace generic                    {
36namespace registerfile               {
37namespace registerfile_monolithic    {
38
39  typedef enum {RW_READ, RW_WRITE} rw_t;
40
41  class RegisterFile_Monolithic
42#if SYSTEMC
43    : public sc_module
44#endif
45  {
46    // -----[ fields ]----------------------------------------------------
47    // Parameters
48  protected : const string       _name;
49  protected : const Parameters * _param;
50  private   : const Tusage_t     _usage;
51
52#ifdef STATISTICS
53  private   : Statistics                     * _stat;
54   
55  private   : uint32_t                         _stat_nb_read;
56  private   : uint32_t                         _stat_nb_write;
57#endif
58
59  public    : Component                      * _component;
60  private   : Interfaces                     * _interfaces;
61
62#ifdef SYSTEMC
63    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64    // Interface
65  public    : SC_CLOCK                      *  in_CLOCK        ;
66  public    : SC_IN       (Tcontrol_t)      *  in_NRESET       ;
67
68    // ----- Interface Read
69  public    : SC_IN       (Tcontrol_t)     **  in_READ_VAL     ;
70  public    : SC_OUT      (Tcontrol_t)     ** out_READ_ACK     ;
71  public    : SC_IN       (Taddress_t)     **  in_READ_ADDRESS ;
72  public    : SC_OUT      (Tdata_t)        ** out_READ_DATA    ;
73
74    // ----- Interface Write
75  public    : SC_IN       (Tcontrol_t)     **  in_WRITE_VAL    ;
76  public    : SC_OUT      (Tcontrol_t)     ** out_WRITE_ACK    ;
77  public    : SC_IN       (Taddress_t)     **  in_WRITE_ADDRESS;
78  public    : SC_IN       (Tdata_t)        **  in_WRITE_DATA   ;
79
80    // ----- Interface Read_Write
81  public    : SC_IN       (Tcontrol_t)     **  in_READ_WRITE_VAL    ;
82  public    : SC_OUT      (Tcontrol_t)     ** out_READ_WRITE_ACK    ;
83  public    : SC_IN       (Tcontrol_t)     **  in_READ_WRITE_RW     ;
84  public    : SC_IN       (Taddress_t)     **  in_READ_WRITE_ADDRESS;
85  public    : SC_OUT      (Tdata_t)        ** out_READ_WRITE_RDATA  ;
86  public    : SC_IN       (Tdata_t)        **  in_READ_WRITE_WDATA  ;
87
88    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
89  private   : SC_REGISTER (Tdata_t)        ** reg_DATA         ;
90
91    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92#endif
93
94    // -----[ methods ]---------------------------------------------------
95
96#ifdef SYSTEMC
97    SC_HAS_PROCESS (RegisterFile_Monolithic);
98#endif                                         
99  public  : RegisterFile_Monolithic
100  (
101#ifdef SYSTEMC
102   sc_module_name                              name
103#else                                         
104   string                                      name
105#endif                                         
106#ifdef STATISTICS
107   ,morpheo::behavioural::Parameters_Statistics * param_statistics
108#endif
109   ,Parameters                                  * param
110   ,morpheo::behavioural::Tusage_t                usage=USE_ALL
111   );
112
113  public  :          ~RegisterFile_Monolithic  (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) {/* empty */};
121  public  : void     genMealy_read             (void);
122#endif                                         
123
124#ifdef STATISTICS
125  public  : string  statistics                 (uint32_t depth);
126#endif                                         
127#if VHDL                                       
128  private : void     vhdl                      (void);
129  private : void     vhdl_declaration          (Vhdl * & vhdl);
130  private : void     vhdl_body                 (Vhdl * & vhdl);
131#endif                                         
132                                               
133#ifdef VHDL_TESTBENCH                         
134  private : void     vhdl_testbench_transition (void);
135#endif
136
137  };
138
139}; // end namespace registerfile_monolithic
140}; // end namespace registerfile
141}; // end namespace generic
142}; // end namespace behavioural         
143}; // end namespace morpheo             
144
145#endif
Note: See TracBrowser for help on using the repository browser.