source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/include/Free_List_unit.h @ 123

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

1) Fix performance
2) add auto generation to SPECINT2000
3) add reset in genMoore and genMealy

  • Property svn:keywords set to Id
File size: 6.7 KB
Line 
1#ifndef morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_register_translation_unit_free_list_unit_Free_List_unit_h
2#define morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_register_translation_unit_free_list_unit_Free_List_unit_h
3
4/*
5 * $Id: Free_List_unit.h 123 2009-06-08 20:43:30Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11#ifdef SYSTEMC
12#include "systemc.h"
13#endif
14
15#include <iostream>
16#include <list>
17#include "Common/include/ToString.h"
18#include "Common/include/Debug.h"
19#include "Behavioural/include/Types.h"
20
21#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/include/Parameters.h"
22#ifdef STATISTICS
23#include "Behavioural/include/Stat.h"
24#endif
25#include "Behavioural/include/Component.h"
26#ifdef VHDL
27#include "Behavioural/include/Vhdl.h"
28#endif
29#include "Behavioural/include/Usage.h"
30
31#include "Behavioural/Generic/Priority/include/Priority.h"
32
33namespace morpheo {
34namespace behavioural {
35
36namespace core {
37namespace multi_ooo_engine {
38namespace ooo_engine {
39namespace rename_unit {
40namespace register_translation_unit {
41namespace free_list_unit {
42
43
44  class Free_List_unit
45#if SYSTEMC
46    : public sc_module
47#endif
48  {
49    // -----[ fields ]----------------------------------------------------
50    // Parameters
51  protected : const std::string  _name;
52  protected : const Parameters * _param;
53  private   : const Tusage_t     _usage;
54
55#ifdef STATISTICS
56  public    : Stat                           * _stat;
57  private   : counter_t                      * _stat_nb_inst_pop     ;
58  private   : counter_t                      * _stat_nb_inst_pop_gpr ;
59  private   : counter_t                      * _stat_nb_inst_pop_spr ;
60  private   : counter_t                      * _stat_nb_inst_push_gpr;
61  private   : counter_t                      * _stat_nb_inst_push_spr;
62  private   : counter_t                     ** _stat_bank_gpr_nb_elt ; //[nb_bank]
63  private   : counter_t                     ** _stat_bank_spr_nb_elt ; //[nb_bank]
64#endif
65
66  public    : Component                      * _component;
67  private   : Interfaces                     * _interfaces;
68
69#ifdef SYSTEMC
70    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71    // Interface
72  public    : SC_CLOCK                      *  in_CLOCK          ;
73  public    : SC_IN (Tcontrol_t)            *  in_NRESET         ;
74
75    // ~~~~~[ interface : "pop" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76  public    : SC_IN (Tcontrol_t)           **  in_POP_VAL        ;
77  public    : SC_OUT(Tcontrol_t)           ** out_POP_ACK        ;
78  public    : SC_IN (Tcontrol_t        )   **  in_POP_GPR_VAL    ; // write_rd
79  public    : SC_OUT(Tgeneral_address_t)   ** out_POP_GPR_NUM_REG; // num_reg_rd
80  public    : SC_IN (Tcontrol_t        )   **  in_POP_SPR_VAL    ; // write_re
81  public    : SC_OUT(Tspecial_address_t)   ** out_POP_SPR_NUM_REG; // num_reg_re
82
83    // ~~~~~[ interface : "push_gpr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84  public    : SC_IN (Tcontrol_t)           **  in_PUSH_GPR_VAL    ; // gpr_free (cf stat_list)
85  public    : SC_OUT(Tcontrol_t)           ** out_PUSH_GPR_ACK    ;
86  public    : SC_IN (Tgeneral_address_t)   **  in_PUSH_GPR_NUM_REG;
87
88    // ~~~~~[ interface : "push_spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89  public    : SC_IN (Tcontrol_t)           **  in_PUSH_SPR_VAL    ; // spr_free (cf stat_list)
90  public    : SC_OUT(Tcontrol_t)           ** out_PUSH_SPR_ACK    ;
91  public    : SC_IN (Tspecial_address_t)   **  in_PUSH_SPR_NUM_REG;
92
93    // ~~~~~[ interface : "info" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
94#ifdef DEBUG_TEST
95  public    : SC_OUT(uint32_t  )            * out_INFO_NB_GPR_FREE;
96  public    : SC_OUT(uint32_t  )            * out_INFO_NB_SPR_FREE;
97#endif
98
99    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
100  private   : generic::priority::Priority   * _priority_gpr;
101  private   : generic::priority::Priority   * _priority_spr;
102
103    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
104  private   : std::list<Tgeneral_address_t> * _gpr_list; //[nb_bank]
105  private   : std::list<Tspecial_address_t> * _spr_list; //[nb_bank]
106
107    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108  private   : Tcontrol_t                    * internal_POP_ACK      ; //[nb_pop]
109  private   : uint32_t                      * internal_POP_GPR_BANK ; //[nb_pop]
110  private   : uint32_t                      * internal_POP_SPR_BANK ; //[nb_pop]
111
112  private   : Tcontrol_t                    * internal_PUSH_GPR_ACK ; //[nb_push]
113  private   : Tcontrol_t                    * internal_PUSH_SPR_ACK ; //[nb_push]
114  private   : uint32_t                      * internal_PUSH_GPR_BANK; //[nb_push]
115  private   : uint32_t                      * internal_PUSH_SPR_BANK; //[nb_push]
116#endif
117
118    // -----[ Methods ]---------------------------------------------------
119
120#ifdef SYSTEMC
121    SC_HAS_PROCESS (Free_List_unit);
122#endif
123  public  :          Free_List_unit             
124  (
125#ifdef SYSTEMC
126   sc_module_name                                name,
127#else                                         
128   std::string                                   name,
129#endif                                         
130#ifdef STATISTICS
131   morpheo::behavioural::Parameters_Statistics * param_statistics,
132#endif
133   Parameters                                  * param,
134   morpheo::behavioural::Tusage_t                usage
135   );
136  public  :          ~Free_List_unit             (void);
137                                               
138  private : void        allocation                (
139#ifdef STATISTICS
140                                                   morpheo::behavioural::Parameters_Statistics * param_statistics
141#else
142                                                   void
143#endif
144                                                   );
145  private : void        deallocation              (void);
146                                               
147#ifdef SYSTEMC                                 
148  public  : void        transition                (void);
149#ifdef DEBUG_TEST
150  public  : void        genMoore                  (void);
151#endif
152  public  : void        genMealy_pop              (void);
153  public  : void        genMealy_push_gpr         (void);
154  public  : void        genMealy_push_spr         (void);
155#endif
156
157#if VHDL                                       
158  public  : void        vhdl                      (void);
159  private : void        vhdl_declaration          (Vhdl * & vhdl);
160  private : void        vhdl_body                 (Vhdl * & vhdl);
161#endif                                         
162
163#ifdef STATISTICS
164  public  : void        statistics_allocation     (morpheo::behavioural::Parameters_Statistics * param_statistics);
165  public  : void        statistics_deallocation   (void);
166#endif
167#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
168  private : void        end_cycle                 (void);
169#endif
170  };
171
172}; // end namespace free_list_unit
173}; // end namespace register_translation_unit
174}; // end namespace rename_unit
175}; // end namespace ooo_engine
176}; // end namespace multi_ooo_engine
177}; // end namespace core
178
179}; // end namespace behavioural
180}; // end namespace morpheo             
181
182#endif
Note: See TracBrowser for help on using the repository browser.