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

Last change on this file since 71 was 71, checked in by rosiere, 16 years ago

Modification of Statisctics
Add a new systemC component : Load_Store_Queue (tested with one benchmark and one configuration). Store don't supported the Data Buss Error (Load is supported)

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