source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/include/Special_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: 7.2 KB
Line 
1#ifndef morpheo_behavioural_core_multi_ooo_engine_ooo_engine_special_register_unit_Special_Register_unit_h
2#define morpheo_behavioural_core_multi_ooo_engine_ooo_engine_special_register_unit_Special_Register_unit_h
3
4/*
5 * $Id: Special_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
16#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/include/Parameters.h"
17#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/include/Types.h"
18#ifdef STATISTICS
19#include "Behavioural/include/Stat.h"
20#endif
21#include "Behavioural/include/Component.h"
22#ifdef VHDL
23#include "Behavioural/include/Vhdl.h"
24#endif
25#include "Behavioural/include/Usage.h"
26
27#include "Common/include/ToString.h"
28#include "Common/include/Debug.h"
29
30#include <iostream>
31
32namespace morpheo {
33namespace behavioural {
34
35namespace core {
36namespace multi_ooo_engine {
37namespace ooo_engine {
38namespace special_register_unit {
39
40
41  class Special_Register_unit
42#if SYSTEMC
43    : public sc_module
44#endif
45  {
46    // -----[ fields ]----------------------------------------------------
47    // Parameters
48  protected : const std::string  _name;
49  protected : const Parameters * _param;
50  private   : const Tusage_t     _usage;
51
52#ifdef STATISTICS
53  public    : Stat                           * _stat;
54#endif
55
56  public    : Component                      * _component;
57  private   : Interfaces                     * _interfaces;
58
59#ifdef SYSTEMC
60    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62  public    : SC_CLOCK                      *  in_CLOCK        ;
63  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
64
65    // ~~~~~[ Interface : "spr_access" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66  public    : SC_IN (Tcontrol_t         )  **  in_SPR_ACCESS_VAL          ;//[nb_inst_reexecute]
67  public    : SC_OUT(Tcontrol_t         )  ** out_SPR_ACCESS_ACK          ;//[nb_inst_reexecute]
68  public    : SC_IN (Tcontext_t         )  **  in_SPR_ACCESS_FRONT_END_ID ;//[nb_inst_reexecute]
69  public    : SC_IN (Tcontext_t         )  **  in_SPR_ACCESS_CONTEXT_ID   ;//[nb_inst_reexecute]
70  public    : SC_IN (Tcontrol_t         )  **  in_SPR_ACCESS_WEN          ;//[nb_inst_reexecute]
71  public    : SC_IN (Tspr_address_t     )  **  in_SPR_ACCESS_NUM_GROUP    ;//[nb_inst_reexecute]
72  public    : SC_IN (Tspr_address_t     )  **  in_SPR_ACCESS_NUM_REG      ;//[nb_inst_reexecute]
73  public    : SC_IN (Tspr_t             )  **  in_SPR_ACCESS_WDATA        ;//[nb_inst_reexecute]
74  public    : SC_OUT(Tspr_t             )  ** out_SPR_ACCESS_RDATA        ;//[nb_inst_reexecute]
75  public    : SC_OUT(Tcontrol_t         )  ** out_SPR_ACCESS_INVALID      ;//[nb_inst_reexecute]
76
77    // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78  public    : SC_OUT(Tspr_t             ) *** out_SPR_READ_SR             ;//[nb_front_end][nb_context]
79
80    // ~~~~~[ Interface : "spr_commit" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81  public    : SC_IN (Tcontrol_t         ) ***  in_SPR_COMMIT_VAL          ;//[nb_front_end][nb_context]
82  public    : SC_OUT(Tcontrol_t         ) *** out_SPR_COMMIT_ACK          ;//[nb_front_end][nb_context]
83  public    : SC_IN (Tcontrol_t         ) ***  in_SPR_COMMIT_SR_F_VAL     ;//[nb_front_end][nb_context]
84  public    : SC_IN (Tcontrol_t         ) ***  in_SPR_COMMIT_SR_F         ;//[nb_front_end][nb_context]
85  public    : SC_IN (Tcontrol_t         ) ***  in_SPR_COMMIT_SR_CY_VAL    ;//[nb_front_end][nb_context]
86  public    : SC_IN (Tcontrol_t         ) ***  in_SPR_COMMIT_SR_CY        ;//[nb_front_end][nb_context]
87  public    : SC_IN (Tcontrol_t         ) ***  in_SPR_COMMIT_SR_OV_VAL    ;//[nb_front_end][nb_context]
88  public    : SC_IN (Tcontrol_t         ) ***  in_SPR_COMMIT_SR_OV        ;//[nb_front_end][nb_context]
89
90    // ~~~~~[ Interface "spr_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91  public    : SC_IN (Tcontrol_t        )  ***  in_SPR_EVENT_VAL           ;//[nb_front_end][nb_context]
92  public    : SC_OUT(Tcontrol_t        )  *** out_SPR_EVENT_ACK           ;//[nb_front_end][nb_context]
93  public    : SC_IN (Tspr_t            )  ***  in_SPR_EVENT_EPCR          ;//[nb_front_end][nb_context]
94  public    : SC_IN (Tcontrol_t        )  ***  in_SPR_EVENT_EEAR_WEN      ;//[nb_front_end][nb_context]
95  public    : SC_IN (Tspr_t            )  ***  in_SPR_EVENT_EEAR          ;//[nb_front_end][nb_context]
96  public    : SC_IN (Tcontrol_t        )  ***  in_SPR_EVENT_SR_DSX        ;//[nb_front_end][nb_context]
97  public    : SC_IN (Tcontrol_t        )  ***  in_SPR_EVENT_SR_TO_ESR     ;//[nb_front_end][nb_context]
98
99    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
100  private   : SPR                       ***** _spr                        ;//[nb_front_end][nb_context][NB_GROUP][NB_REG_GROUP]
101  private   : SPR_access_mode             *** _spr_access_mode            ;//[nb_front_end][nb_context]
102
103    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
104
105    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106  private   : Tcontrol_t                    * internal_SPR_ACCESS_ACK     ;//[nb_inst_reexecute]
107  private   : Tcontrol_t                   ** internal_SPR_COMMIT_ACK     ;//[nb_front_end][nb_context]
108  private   : Tcontrol_t                   ** internal_SPR_EVENT_ACK      ;//[nb_front_end][nb_context]
109#endif
110
111    // -----[ Methods ]---------------------------------------------------
112
113#ifdef SYSTEMC
114    SC_HAS_PROCESS (Special_Register_unit);
115#endif
116  public  :          Special_Register_unit             
117  (
118#ifdef SYSTEMC
119   sc_module_name                                name,
120#else                                         
121   std::string                                   name,
122#endif                                         
123#ifdef STATISTICS
124   morpheo::behavioural::Parameters_Statistics * param_statistics,
125#endif
126   Parameters                                  * param,
127   morpheo::behavioural::Tusage_t                usage
128   );
129  public  :          ~Special_Register_unit             (void);
130                                               
131  private : void        allocation                (
132#ifdef STATISTICS
133                                                   morpheo::behavioural::Parameters_Statistics * param_statistics
134#else
135                                                   void
136#endif
137                                                   );
138  private : void        deallocation              (void);
139                                               
140#ifdef SYSTEMC                                 
141  public  : void        constant                  (void);
142  public  : void        transition                (void);
143  public  : void        genMoore                  (void);
144  public  : void        genMealy_spr_access       (void);
145#endif                                         
146
147#if VHDL                                       
148  public  : void        vhdl                      (void);
149  private : void        vhdl_declaration          (Vhdl * & vhdl);
150  private : void        vhdl_body                 (Vhdl * & vhdl);
151#endif                                         
152
153#ifdef STATISTICS
154  public  : void        statistics_allocation     (morpheo::behavioural::Parameters_Statistics * param_statistics);
155  public  : void        statistics_deallocation   (void);
156#endif
157#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
158  private : void        end_cycle                 (void);
159#endif
160  };
161
162}; // end namespace special_register_unit
163}; // end namespace ooo_engine
164}; // end namespace multi_ooo_engine
165}; // end namespace core
166
167}; // end namespace behavioural
168}; // end namespace morpheo             
169
170#endif
Note: See TracBrowser for help on using the repository browser.