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

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 7.9 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 88 2008-12-10 18:31:39Z 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  protected : morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::register_unit_glue::Register_unit_Glue::Register_unit_Glue      * component_glue      ;
122
123    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
124
125    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
126#endif
127
128    // -----[ methods ]---------------------------------------------------
129
130#ifdef SYSTEMC
131    SC_HAS_PROCESS (Register_unit);
132#endif
133  public  :          Register_unit             
134  (
135#ifdef SYSTEMC
136   sc_module_name                                name,
137#else                                         
138   std::string                                        name,
139#endif                                         
140#ifdef STATISTICS
141   morpheo::behavioural::Parameters_Statistics * param_statistics,
142#endif
143   Parameters                                  * param,
144   morpheo::behavioural::Tusage_t                usage
145   );
146  public  :          ~Register_unit             (void);
147                                               
148  private : void     allocation                (
149#ifdef STATISTICS
150                                                morpheo::behavioural::Parameters_Statistics * param_statistics
151#else
152                                                void
153#endif
154                                                );
155  private : void     deallocation              (void);
156                                               
157#ifdef SYSTEMC                                 
158//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
159  public  : void     transition                (void);
160//#endif
161#endif                                         
162                                               
163#if VHDL                                       
164  public  : void     vhdl                      (void);
165  private : void     vhdl_declaration          (Vhdl * & vhdl);
166  private : void     vhdl_body                 (Vhdl * & vhdl);
167#endif                                         
168                                               
169#ifdef STATISTICS
170  public  : void        statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
171#endif
172#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
173  private : void        end_cycle                 (void);
174#endif
175  };
176
177
178}; // end namespace register_unit
179}; // end namespace execute_loop
180}; // end namespace multi_execute_loop
181}; // end namespace core
182
183}; // end namespace behavioural
184}; // end namespace morpheo             
185
186#endif
Note: See TracBrowser for help on using the repository browser.