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

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

1) decod_queue : add reg_LAST_SLOT.
2) Commit : insert on event -> to pop decod_queue. Head test : add information (speculative or not)
3) Context State / UPT : Branch miss and Load miss in same cycle.
4) Free List : Bank is on LSB not MSB.
5) Platforms : move data

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