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

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

1) OOO_egine : add stat to depiste low perf source
2) Commit : add stat
3) LSU_Pointer : retire - always ack (else combinatory loop). insert - max nb_inst_memory
4) TopLevel? : add debug_idle_time to stop combinatory loop.
5) Issue_queue : add reexecute_queue, new implementation (routage after issue_queue)
6) Decod / Predictor : add "can_continue"

  • Property svn:keywords set to Id
File size: 6.4 KB
Line 
1/*
2 * $Id: Parameters.cpp 110 2009-02-19 16:31:47Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Parameters.h"
9#include "Behavioural/include/Allocation.h"
10#include "Common/include/Max.h"
11#include "Common/include/BitManipulation.h"
12
13namespace morpheo {
14namespace behavioural {
15namespace core {
16namespace multi_ooo_engine {
17namespace ooo_engine {
18namespace commit_unit {
19
20
21#undef  FUNCTION
22#define FUNCTION "Commit_unit::Parameters"
23  Parameters::Parameters (uint32_t            nb_front_end                       ,
24                          uint32_t          * nb_context                         ,
25                          uint32_t            nb_rename_unit                     ,
26                          uint32_t            size_queue                         ,
27                          uint32_t            nb_bank                            ,
28                          uint32_t          * nb_inst_insert                     ,
29                          uint32_t          * nb_inst_retire                     ,
30                          uint32_t            nb_inst_commit                     ,
31                          uint32_t            nb_inst_reexecute                  ,
32                          uint32_t            nb_inst_branch_complete            ,
33                          uint32_t         ** nb_branch_speculated               ,
34                          uint32_t            size_nb_inst_decod                 ,
35                          uint32_t            size_general_data                  ,
36                          uint32_t            size_store_queue_ptr               ,
37                          uint32_t            size_load_queue_ptr                ,
38                          uint32_t            size_general_register              ,
39                          uint32_t            size_special_register              ,
40                          Tpriority_t         priority                           ,
41                          Tload_balancing_t   load_balancing                     ,
42                          uint32_t            nb_rename_unit_select              ,
43                          uint32_t            nb_thread                          ,
44                          uint32_t         ** translate_num_context_to_num_thread,
45                          bool                is_toplevel):
46    _nb_bank_access_commit (1              ),
47    _retire_ooo            (RETIRE_IN_ORDER)
48  {
49    log_begin(Commit_unit,FUNCTION);
50
51    _nb_front_end                        = nb_front_end                       ;
52    _nb_context                          = nb_context                         ;
53    _nb_rename_unit                      = nb_rename_unit                     ;
54    _size_queue                          = size_queue                         ;
55    _nb_bank                             = nb_bank                            ;
56    _nb_inst_insert                      = nb_inst_insert                     ;
57    _nb_inst_retire                      = nb_inst_retire                     ;
58    _nb_inst_commit                      = nb_inst_commit                     ;
59    _nb_inst_reexecute                   = nb_inst_reexecute                  ;
60    _nb_inst_branch_complete             = nb_inst_branch_complete            ;
61    _nb_branch_speculated                = nb_branch_speculated               ;
62    _priority                            = priority                           ;
63    _load_balancing                      = load_balancing                     ;
64    _nb_rename_unit_select               = nb_rename_unit_select              ;
65    _nb_thread                           = nb_thread                          ;
66    _translate_num_context_to_num_thread = translate_num_context_to_num_thread;
67
68    _size_rename_unit_id      = log2(_nb_rename_unit);
69    _max_nb_context           = max<uint32_t>(_nb_context,_nb_front_end);
70    _max_nb_inst_insert       = max<uint32_t>(_nb_inst_insert,_nb_rename_unit);
71    _max_nb_inst_retire       = max<uint32_t>(_nb_inst_retire,_nb_rename_unit);
72    _size_bank                = _size_queue/_nb_bank;
73    _shift_num_bank           = log2(_size_bank);
74    _mask_size_bank           = gen_mask<Tpacket_t>(log2(_size_bank));
75
76    _have_port_rename_unit_id = _size_rename_unit_id > 0;
77
78    ALLOC2(_array_size_depth,uint32_t,_nb_front_end,_nb_context [it1]);
79    for (uint32_t i=0; i<_nb_front_end; i++)
80      for (uint32_t j=0; j<_nb_context [i]; j++)
81        _array_size_depth      [i][j] = (_nb_branch_speculated [i][j] == 0)?0:log2(_nb_branch_speculated [i][j]);
82
83    test();
84
85    ALLOC1(_have_thread,bool,_nb_thread);
86    for (uint32_t i=0; i<_nb_thread; i++)
87      _have_thread[i] = false;
88    for (uint32_t i=0; i<_nb_front_end; i++)
89      for (uint32_t j=0; j<_nb_context [i]; j++)
90        _have_thread[_translate_num_context_to_num_thread [i][j]] = true;
91
92    if (is_toplevel)
93      {
94        _size_front_end_id        = log2(_nb_front_end);
95        _size_context_id          = log2(_max_nb_context);
96        _size_rob_ptr             = log2(_nb_bank)+log2(_size_bank);
97        _size_instruction_address = size_general_data-2;
98        _size_store_queue_ptr     = size_store_queue_ptr   ;
99        _size_load_queue_ptr      = size_load_queue_ptr    ;
100        _size_general_data        = size_general_data      ;
101        _size_general_register    = size_general_register  ;
102        _size_special_register    = size_special_register  ;
103        _size_depth               = max<uint32_t>(_array_size_depth,_nb_front_end,_nb_context);
104        _size_nb_inst_commit      = log2(_size_queue)+1;
105        _size_nb_inst_decod       = size_nb_inst_decod;
106       
107        _have_port_front_end_id   = _size_front_end_id   > 0;
108        _have_port_context_id     = _size_context_id     > 0;
109        _have_port_rob_ptr        = _size_rob_ptr        > 0;
110        _have_port_load_queue_ptr = _size_load_queue_ptr > 0;
111        _have_port_depth          = _size_depth          > 0;
112       
113        copy();
114      }
115
116    log_end(Commit_unit,FUNCTION);
117  };
118 
119// #undef  FUNCTION
120// #define FUNCTION "Commit_unit::Parameters (copy)"
121//   Parameters::Parameters (Parameters & param)
122//   {
123//     log_begin(Commit_unit,FUNCTION);
124//     test();
125//     log_end(Commit_unit,FUNCTION);
126//   };
127
128#undef  FUNCTION
129#define FUNCTION "Commit_unit::~Parameters"
130  Parameters::~Parameters (void) 
131  {
132    log_begin(Commit_unit,FUNCTION);
133
134    DELETE1(_have_thread     ,_nb_thread);
135    DELETE2(_array_size_depth,_nb_front_end,_nb_context [it1]);
136
137    log_end(Commit_unit,FUNCTION);
138  };
139
140#undef  FUNCTION
141#define FUNCTION "Commit_unit::copy"
142  void Parameters::copy (void) 
143  {
144    log_begin(Commit_unit,FUNCTION);
145    log_end(Commit_unit,FUNCTION);
146  };
147
148}; // end namespace commit_unit
149}; // end namespace ooo_engine
150}; // end namespace multi_ooo_engine
151}; // end namespace core
152
153}; // end namespace behavioural
154}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.