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

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:keywords set to Id
File size: 5.2 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 81 2008-04-15 18:40:01Z 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
29namespace morpheo {
30namespace behavioural {
31namespace generic {
32namespace registerfile {
33namespace registerfile_multi_banked {
34
35
36  class RegisterFile_Multi_Banked
37#if SYSTEMC
38    : public sc_module
39#endif
40  {
41    // -----[ fields ]----------------------------------------------------
42    // Parameters
43  protected : const std::string       _name;
44
45  protected : const Parameters * _param;
46
47#ifdef STATISTICS
48  public    : Stat                           * _stat;
49#endif
50
51  public    : Component                      * _component;
52  private   : Interfaces                     * _interfaces;
53
54#ifdef SYSTEMC
55    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56    // Interface
57  public    : SC_CLOCK                      *  in_CLOCK        ;
58  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
59
60    // ----- Interface Read
61  public    : SC_IN       (Tcontrol_t)     **  in_READ_VAL     ;
62  public    : SC_OUT      (Tcontrol_t)     ** out_READ_ACK     ;
63  public    : SC_IN       (Taddress_t)     **  in_READ_ADDRESS ;
64  public    : SC_OUT      (Tdata_t)        ** out_READ_DATA    ;
65
66    // ----- Interface Write
67  public    : SC_IN       (Tcontrol_t)     **  in_WRITE_VAL    ;
68  public    : SC_OUT      (Tcontrol_t)     ** out_WRITE_ACK    ;
69  public    : SC_IN       (Taddress_t)     **  in_WRITE_ADDRESS;
70  public    : SC_IN       (Tdata_t)        **  in_WRITE_DATA   ;
71
72    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
73
74    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
75  private   : Tdata_t ** reg_DATA;
76
77    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78  private   : bool                          * internal_WRITE_VAL;
79  private   : Taddress_t                    * internal_WRITE_BANK;
80  private   : Taddress_t                    * internal_WRITE_NUM_REG;
81
82        // function pointer
83  public    : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_transition    ) (void);
84  public    : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_genMealy_read ) (void);
85  public    : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_genMealy_write) (void);
86#endif
87
88    // -----[ methods ]---------------------------------------------------
89
90#ifdef SYSTEMC
91    SC_HAS_PROCESS (RegisterFile_Multi_Banked);
92#endif
93  public  :          RegisterFile_Multi_Banked              (
94#ifdef SYSTEMC
95                                              sc_module_name                                name,
96#else                                         
97                                              std::string                                   name,
98#endif                                         
99#ifdef STATISTICS
100                                              morpheo::behavioural::Parameters_Statistics * param_statistics,
101#endif
102                                              Parameters                                  * param );
103                                               
104  public  :          ~RegisterFile_Multi_Banked             (void);
105                                               
106#ifdef SYSTEMC                                 
107  private : void     allocation                (void);
108  private : void     deallocation              (void);
109                                               
110  private : Taddress_t address_bank                 (Taddress_t address);
111  private : Taddress_t address_num_reg              (Taddress_t address);
112
113  public  : void     transition                     (void);
114  public  : void     genMealy_read                  (void);
115  public  : void     genMealy_write                 (void);
116
117  public  : void     full_crossbar_transition       (void);
118  public  : void     full_crossbar_genMealy_read    (void);
119  public  : void     full_crossbar_genMealy_write   (void);
120
121  public  : void     partial_crossbar_transition    (void);
122  public  : void     partial_crossbar_genMealy_read (void);
123  public  : void     partial_crossbar_genMealy_write(void);
124#endif                                         
125                                               
126#if VHDL                                       
127  public  : void     vhdl                      (void);
128  private : void     vhdl_declaration          (Vhdl * & vhdl);
129  private : void     vhdl_body                 (Vhdl * & vhdl);
130#endif                                         
131                                               
132#ifdef STATISTICS
133  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
134#endif
135#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
136  private : void     end_cycle                 (void);
137#endif
138  };
139
140}; // end namespace registerfile_multi_banked
141}; // end namespace registerfile
142}; // end namespace generic
143
144}; // end namespace behavioural
145}; // end namespace morpheo             
146
147#endif
Note: See TracBrowser for help on using the repository browser.