source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/src/Parameters.cpp @ 97

Last change on this file since 97 was 97, checked in by rosiere, 16 years ago

1) Update Prediction Table : statistics
2) Size instruction address on 30 bits
3) Change Log File
4) Add debug_level in simulation configuration file

  • Property svn:keywords set to Id
File size: 7.3 KB
Line 
1/*
2 * $Id: Parameters.cpp 97 2008-12-19 15:34:00Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/include/Parameters.h"
9#include "Common/include/Max.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace core {
14namespace multi_ooo_engine {
15namespace ooo_engine {
16namespace rename_unit {
17
18
19#undef  FUNCTION
20#define FUNCTION "Rename_unit::Parameters"
21  Parameters::Parameters (uint32_t             nb_front_end                     ,
22                          uint32_t           * nb_context                       ,
23                          uint32_t           * nb_inst_decod                    ,
24                          uint32_t             nb_inst_insert                   ,
25                          uint32_t             nb_inst_retire                   ,
26                          uint32_t             nb_load_store_queue              ,
27                          uint32_t           * size_store_queue                 ,
28                          uint32_t           * size_load_queue                  ,
29                          uint32_t          ** link_load_store_unit_with_thread ,
30                          Tpriority_t          rename_select_priority           ,
31                          Tload_balancing_t    rename_select_load_balancing     ,
32                          uint32_t             rename_select_nb_front_end_select,
33                          uint32_t             max_branch_speculated            ,
34                          uint32_t             size_general_data                ,
35                          uint32_t             nb_general_register              ,
36                          uint32_t             nb_special_register              ,
37                          uint32_t             nb_reg_free                      ,
38                          uint32_t             nb_bank                          ,
39                          uint32_t             size_read_counter                ,
40                          bool                 is_toplevel)
41  {
42    log_begin(Rename_unit,FUNCTION);
43
44    _nb_front_end                      = nb_front_end                     ;
45    _nb_context                        = nb_context                       ;
46    _nb_inst_decod                     = nb_inst_decod                    ;
47    _nb_inst_insert                    = nb_inst_insert                   ;
48    _nb_inst_retire                    = nb_inst_retire                   ;
49    _nb_load_store_queue               = nb_load_store_queue              ;
50    _size_store_queue                  = size_store_queue                 ;
51    _size_load_queue                   = size_load_queue                  ;
52    _link_load_store_unit_with_thread  = link_load_store_unit_with_thread ;
53    _rename_select_priority            = rename_select_priority           ;
54    _rename_select_load_balancing      = rename_select_load_balancing     ;
55    _rename_select_nb_front_end_select = rename_select_nb_front_end_select;
56    _max_branch_speculated             = max_branch_speculated            ;
57    _nb_general_register               = nb_general_register              ;
58    _nb_special_register               = nb_special_register              ;
59    _nb_reg_free                       = nb_reg_free                      ;
60    _nb_bank                           = nb_bank                          ;
61    _size_read_counter                 = size_read_counter                ;
62   
63    uint32_t size_special_register     = log2(_nb_special_register);
64
65    test();
66
67    log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_rename_select."));
68    _param_rename_select = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_select::Parameters
69      (
70       _nb_front_end         ,
71       _nb_context           ,
72       _max_branch_speculated,
73       _size_general_data    ,
74       _nb_inst_insert       ,
75       _nb_inst_decod        ,
76       _rename_select_nb_front_end_select  ,
77       _rename_select_priority             ,
78       _rename_select_load_balancing       
79       );
80
81    log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_register_translation_unit."));
82    _param_register_translation_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::Parameters
83      (
84       _nb_front_end          ,
85       _nb_context            ,
86       _nb_general_register   ,
87       _nb_special_register   ,
88       _nb_inst_insert        ,
89       _nb_inst_retire        ,
90       _nb_reg_free           ,
91       _nb_bank               ,
92       _size_read_counter     
93       );
94
95    log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_load_store_pointer_unit."));
96    _param_load_store_pointer_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::load_store_pointer_unit::Parameters
97      (
98       _nb_front_end                    ,
99       _nb_context                      ,
100       _nb_load_store_queue             ,
101       _size_store_queue                ,
102       _size_load_queue                 ,
103       _link_load_store_unit_with_thread,
104       _nb_inst_insert                  ,
105       _nb_inst_retire                 
106       );
107
108    log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_glue."));
109    _param_glue = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_unit_glue::Parameters
110      (
111       _nb_front_end         ,
112       _nb_context           ,
113       _nb_inst_insert       ,
114       _nb_inst_retire       ,
115       _size_general_data    ,
116       _size_special_register
117       );
118
119    if (is_toplevel)
120      {
121        _size_instruction_address          = size_general_data-2;
122        _size_front_end_id                 = log2(_nb_front_end);
123        _size_context_id                   = log2(max<uint32_t>(_nb_context,_nb_front_end));
124        _size_store_queue_ptr              = log2(max<uint32_t>(_size_store_queue,nb_load_store_queue));
125        _size_load_queue_ptr               = log2(max<uint32_t>(_size_load_queue ,nb_load_store_queue));
126        _size_general_register             = log2(_nb_general_register);
127        _size_special_register             = size_special_register;
128        _size_depth                        = log2(_max_branch_speculated);
129        _size_general_data                 = size_general_data                ;
130       
131        _have_port_front_end_id            = _size_front_end_id   > 0;
132        _have_port_context_id              = _size_context_id     > 0;
133        _have_port_load_queue_ptr          = _size_load_queue_ptr > 0;
134        _have_port_depth                   = _size_depth          > 0;
135       
136        copy();
137      }
138
139    log_end(Rename_unit,FUNCTION);
140  };
141 
142// #undef  FUNCTION
143// #define FUNCTION "Rename_unit::Parameters (copy)"
144//   Parameters::Parameters (Parameters & param)
145//   {
146//     log_begin(Rename_unit,FUNCTION);
147//     test();
148//     log_end(Rename_unit,FUNCTION);
149//   };
150
151#undef  FUNCTION
152#define FUNCTION "Rename_unit::~Parameters"
153  Parameters::~Parameters (void) 
154  {
155    log_begin(Rename_unit,FUNCTION);
156
157    delete _param_rename_select            ;
158    delete _param_register_translation_unit;
159    delete _param_load_store_pointer_unit  ;
160    delete _param_glue                     ;
161
162    log_end(Rename_unit,FUNCTION);
163  };
164
165#undef  FUNCTION
166#define FUNCTION "Rename_unit::copy"
167  void Parameters::copy (void) 
168  {
169    log_begin(Rename_unit,FUNCTION);
170
171    COPY(_param_rename_select            );
172    COPY(_param_register_translation_unit);
173    COPY(_param_load_store_pointer_unit  );
174    COPY(_param_glue                     );
175
176    log_end(Rename_unit,FUNCTION);
177  };
178
179}; // end namespace rename_unit
180}; // end namespace ooo_engine
181}; // end namespace multi_ooo_engine
182}; // end namespace core
183
184}; // end namespace behavioural
185}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.