source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/include/Register_unit.h @ 131

Last change on this file since 131 was 131, checked in by rosiere, 15 years ago

1) add constant method
2) test with systemc 2.2.0

  • Property svn:keywords set to Id
File size: 8.6 KB
Line 
1#ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_register_unit_Register_unit_h
2#define morpheo_behavioural_core_multi_execute_loop_execute_loop_register_unit_Register_unit_h
3
4/*
5 * $Id: Register_unit.h 131 2009-07-08 18:40:08Z 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#include "Behavioural/include/Types.h"
19
20// Internal Component
21#include "Behavioural/Generic/RegisterFile/include/RegisterFile.h"
22#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/include/Register_unit_Glue.h"
23
24#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/include/Parameters.h"
25#ifdef STATISTICS
26#include "Behavioural/include/Stat.h"
27#endif
28#include "Behavioural/include/Component.h"
29#ifdef VHDL
30#include "Behavioural/include/Vhdl.h"
31#endif
32#include "Behavioural/include/Usage.h"
33
34namespace morpheo {
35namespace behavioural {
36namespace core {
37namespace multi_execute_loop {
38namespace execute_loop {
39namespace register_unit {
40
41
42  class Register_unit
43#if SYSTEMC
44    : public sc_module
45#endif
46  {
47    // -----[ fields ]----------------------------------------------------
48    // Parameters
49  protected : const std::string       _name;
50  protected : const Parameters * _param;
51  private   : const Tusage_t     _usage;
52
53#ifdef STATISTICS
54  public    : Stat                           * _stat;
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 "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67  public    : SC_IN (Tcontrol_t        )   **  in_GPR_READ_VAL                 ;
68  public    : SC_OUT(Tcontrol_t        )   ** out_GPR_READ_ACK                 ;
69  public    : SC_IN (Tcontext_t        )   **  in_GPR_READ_OOO_ENGINE_ID       ;
70  public    : SC_IN (Tgeneral_address_t)   **  in_GPR_READ_NUM_REG             ;
71  public    : SC_OUT(Tgeneral_data_t   )   ** out_GPR_READ_DATA                ;
72  public    : SC_OUT(Tcontrol_t        )   ** out_GPR_READ_DATA_VAL            ;
73
74    // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75  public    : SC_IN (Tcontrol_t        )   **  in_GPR_WRITE_VAL                ;
76  public    : SC_OUT(Tcontrol_t        )   ** out_GPR_WRITE_ACK                ;
77  public    : SC_IN (Tcontext_t        )   **  in_GPR_WRITE_OOO_ENGINE_ID      ;
78  public    : SC_IN (Tgeneral_address_t)   **  in_GPR_WRITE_NUM_REG            ;
79  public    : SC_IN (Tgeneral_data_t   )   **  in_GPR_WRITE_DATA               ;
80
81    // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82  public    : SC_IN (Tcontrol_t        )   **  in_SPR_READ_VAL                 ;
83  public    : SC_OUT(Tcontrol_t        )   ** out_SPR_READ_ACK                 ;
84  public    : SC_IN (Tcontext_t        )   **  in_SPR_READ_OOO_ENGINE_ID       ;
85  public    : SC_IN (Tspecial_address_t)   **  in_SPR_READ_NUM_REG             ;
86  public    : SC_OUT(Tspecial_data_t   )   ** out_SPR_READ_DATA                ;
87  public    : SC_OUT(Tcontrol_t        )   ** out_SPR_READ_DATA_VAL            ;
88
89    // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90  public    : SC_IN (Tcontrol_t        )   **  in_SPR_WRITE_VAL                ;
91  public    : SC_OUT(Tcontrol_t        )   ** out_SPR_WRITE_ACK                ;
92  public    : SC_IN (Tcontext_t        )   **  in_SPR_WRITE_OOO_ENGINE_ID      ;
93  public    : SC_IN (Tspecial_address_t)   **  in_SPR_WRITE_NUM_REG            ;
94  public    : SC_IN (Tspecial_data_t   )   **  in_SPR_WRITE_DATA               ;
95   
96    // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97  public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_VAL               ;
98  public    : SC_OUT(Tcontrol_t        )  *** out_INSERT_ROB_ACK               ;
99  public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_RD_USE            ;
100  public    : SC_IN (Tgeneral_address_t)  ***  in_INSERT_ROB_RD_NUM_REG        ; // use=1 : status[num_reg]<- 0
101  public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_RE_USE            ;
102  public    : SC_IN (Tspecial_address_t)  ***  in_INSERT_ROB_RE_NUM_REG        ;
103
104//     // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_VAL               ;
106//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_ACK               ;
107//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RD_OLD_USE        ;
108//   public    : SC_IN (Tgeneral_address_t)  ***  in_RETIRE_ROB_RD_OLD_NUM_REG    ; // old_use=1 : status[old_num_reg]<- 0
109//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RD_NEW_USE        ;
110//   public    : SC_IN (Tgeneral_address_t)  ***  in_RETIRE_ROB_RD_NEW_NUM_REG    ; // new_use=1 : status[new_num_reg]<- 1
111//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RE_OLD_USE        ;
112//   public    : SC_IN (Tspecial_address_t)  ***  in_RETIRE_ROB_RE_OLD_NUM_REG    ;
113//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RE_NEW_USE        ;
114//   public    : SC_IN (Tspecial_address_t)  ***  in_RETIRE_ROB_RE_NEW_NUM_REG    ;
115
116    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
117  protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_gpr       ;
118  protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_gpr_status;
119  protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_spr       ;
120  protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_spr_status;
121
122//   protected : morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::RegisterFile_Multi_Banked ** component_gpr       ;
123//   protected : morpheo::behavioural::generic::registerfile::registerfile_monolithic  ::RegisterFile_Monolithic  ::RegisterFile_Monolithic   ** component_gpr_status;
124//   protected : morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::RegisterFile_Multi_Banked ** component_spr       ;
125//   protected : morpheo::behavioural::generic::registerfile::registerfile_monolithic  ::RegisterFile_Monolithic  ::RegisterFile_Monolithic   ** component_spr_status;
126
127  protected : morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::register_unit_glue::Register_unit_Glue::Register_unit_Glue      * component_glue      ;
128
129    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
130
131    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
132#endif
133
134    // -----[ methods ]---------------------------------------------------
135
136#ifdef SYSTEMC
137    SC_HAS_PROCESS (Register_unit);
138#endif
139  public  :          Register_unit             
140  (
141#ifdef SYSTEMC
142   sc_module_name                                name,
143#else                                         
144   std::string                                        name,
145#endif                                         
146#ifdef STATISTICS
147   morpheo::behavioural::Parameters_Statistics * param_statistics,
148#endif
149   Parameters                                  * param,
150   morpheo::behavioural::Tusage_t                usage
151   );
152  public  :          ~Register_unit             (void);
153                                               
154  private : void     allocation                (
155#ifdef STATISTICS
156                                                morpheo::behavioural::Parameters_Statistics * param_statistics
157#else
158                                                void
159#endif
160                                                );
161  private : void     deallocation              (void);
162                                               
163#ifdef SYSTEMC                                 
164//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
165  public  : void     transition                (void);
166//#endif
167#endif                                         
168                                               
169#if VHDL                                       
170  public  : void     vhdl                      (void);
171  private : void     vhdl_declaration          (Vhdl * & vhdl);
172  private : void     vhdl_body                 (Vhdl * & vhdl);
173#endif                                         
174                                               
175#ifdef STATISTICS
176  public  : void        statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
177#endif
178#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
179  private : void        end_cycle                 (void);
180#endif
181  };
182
183
184}; // end namespace register_unit
185}; // end namespace execute_loop
186}; // end namespace multi_execute_loop
187}; // end namespace core
188
189}; // end namespace behavioural
190}; // end namespace morpheo             
191
192#endif
Note: See TracBrowser for help on using the repository browser.