source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h

Last change on this file was 137, checked in by rosiere, 14 years ago

Various modif (add test, and vhdl)

  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1#ifndef morpheo_behavioural_generic_registerfile_registerfile_multi_banked_RegisterFile_Multi_Banked_h
2#define morpheo_behavioural_generic_registerfile_registerfile_multi_banked_RegisterFile_Multi_Banked_h
3
4/*
5 * $Id: RegisterFile_Multi_Banked.h 137 2010-02-16 12:35:48Z rosiere $
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/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h"
20#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/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_multi_banked {
35
36
37  class RegisterFile_Multi_Banked
38#if SYSTEMC
39    : public sc_module
40#endif
41  {
42    // -----[ fields ]----------------------------------------------------
43    // Parameters
44  protected : const std::string  _name;
45  protected : const Parameters * _param;
46  private   : const Tusage_t     _usage;
47   
48#ifdef STATISTICS
49  public    : Stat                           * _stat;
50
51  private   : counter_t                      * _stat_nb_read;
52  private   : counter_t                      * _stat_nb_write;
53  private   : counter_t                      * _stat_nb_conflict_on_read;
54  private   : counter_t                      * _stat_nb_conflict_on_write;
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 Read
67  public    : SC_IN       (Tcontrol_t)     **  in_READ_VAL     ;
68  public    : SC_OUT      (Tcontrol_t)     ** out_READ_ACK     ;
69  public    : SC_IN       (Taddress_t)     **  in_READ_ADDRESS ;
70  public    : SC_OUT      (Tdata_t)        ** out_READ_DATA    ;
71
72    // ----- Interface Write
73  public    : SC_IN       (Tcontrol_t)     **  in_WRITE_VAL    ;
74  public    : SC_OUT      (Tcontrol_t)     ** out_WRITE_ACK    ;
75  public    : SC_IN       (Taddress_t)     **  in_WRITE_ADDRESS;
76  public    : SC_IN       (Tdata_t)        **  in_WRITE_DATA   ;
77
78    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
79
80    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
81  private   : Tdata_t ** reg_DATA;
82
83    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84  private   : bool                          * internal_WRITE_VAL;
85  private   : Taddress_t                    * internal_WRITE_BANK;
86  private   : Taddress_t                    * internal_WRITE_NUM_REG;
87
88#ifdef STATISTICS
89  private   : bool                          * internal_READ_VAL;
90//private   : Taddress_t                    * internal_READ_BANK;
91#endif
92
93        // function pointer
94  public    : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_transition    ) (void);
95  public    : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_genMealy_read ) (void);
96  public    : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_genMealy_write) (void);
97#endif
98
99    // -----[ methods ]---------------------------------------------------
100
101#ifdef SYSTEMC
102    SC_HAS_PROCESS (RegisterFile_Multi_Banked);
103#endif
104  public  :          RegisterFile_Multi_Banked              (
105#ifdef SYSTEMC
106                                              sc_module_name                                name,
107#else                                         
108                                              std::string                                   name,
109#endif                                         
110#ifdef STATISTICS
111                                              morpheo::behavioural::Parameters_Statistics * param_statistics,
112#endif
113                                              Parameters * param,
114                                              Tusage_t     usage);
115                                               
116  public  :          ~RegisterFile_Multi_Banked             (void);
117                                               
118  private : void     allocation                (void);
119  private : void     deallocation              (void);
120                                               
121#ifdef SYSTEMC                                 
122  private : Taddress_t address_bank                 (Taddress_t address);
123  private : Taddress_t address_num_reg              (Taddress_t address);
124
125  public  : void     transition                     (void);
126  public  : void     genMealy_read                  (void);
127  public  : void     genMealy_write                 (void);
128
129  public  : void     full_crossbar_transition       (void);
130  public  : void     full_crossbar_genMealy_read    (void);
131  public  : void     full_crossbar_genMealy_write   (void);
132
133  public  : void     partial_crossbar_transition    (void);
134  public  : void     partial_crossbar_genMealy_read (void);
135  public  : void     partial_crossbar_genMealy_write(void);
136#endif                                         
137                                               
138#if VHDL                                       
139  public  : void     vhdl                      (void);
140  private : void     vhdl_declaration          (Vhdl * & vhdl);
141  private : void     vhdl_body                 (Vhdl * & vhdl);
142#endif                                         
143                                               
144#ifdef STATISTICS
145  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
146#endif
147#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
148  private : void     end_cycle                 (void);
149#endif
150  };
151
152}; // end namespace registerfile_multi_banked
153}; // end namespace registerfile
154}; // end namespace generic
155
156}; // end namespace behavioural
157}; // end namespace morpheo             
158
159#endif
Note: See TracBrowser for help on using the repository browser.