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

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

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

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