source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters.cpp @ 111

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

1) Decod_queue : multi implementation (one_fifo, multi_fifo)
2) Issue_queue : multi implementation (in_order, out_of_order)
3) Direction : Add Meta predictor
4) Context_State : re add Branch_complete, More priority to Load miss (is not speculative)
5) Return_Address_Stack : update reg_PREDICT pointer on decod miss prediction
6) UPT : Fix bug in multi event
7) Prediction_glue : in read_stack case, insert in UPT pc_next
8) Rename select : when rob have an event (need flush), read_r{a,b,c} and write_r{d,e} is set at 0

  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1/*
2 * $Id: Parameters.cpp 111 2009-02-27 18:37:40Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h"
9#include "Behavioural/include/Allocation.h"
10#include "Common/include/Max.h"
11
12namespace morpheo {
13namespace behavioural {
14namespace core {
15namespace multi_front_end {
16namespace front_end {
17namespace prediction_unit {
18namespace update_prediction_table {
19
20
21#undef  FUNCTION
22#define FUNCTION "Update_Prediction_Table::Parameters"
23  Parameters::Parameters (uint32_t   nb_context             ,
24                          uint32_t * size_upt_queue         ,
25                          uint32_t * size_ufpt_queue        ,
26                          uint32_t   size_address           ,
27                          uint32_t   nb_inst_predict        ,
28                          uint32_t   nb_inst_decod          ,
29                          uint32_t   nb_inst_branch_complete,
30                          uint32_t   nb_inst_update         ,
31                          uint32_t   size_history           ,
32                          uint32_t * size_ras_index         ,
33                          uint32_t   nb_thread                           ,
34                          uint32_t * translate_num_context_to_num_thread ,//[nb_context]
35                          bool       is_toplevel):
36    _not_accurate_block_predict (false)
37  {
38    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
39
40    _nb_context              = nb_context             ;
41    _size_upt_queue          = size_upt_queue         ;
42    _size_ufpt_queue         = size_ufpt_queue        ;
43//  _size_address            = size_address           ;
44    _nb_inst_predict         = nb_inst_predict        ;
45    _nb_inst_decod           = nb_inst_decod          ;
46    _nb_inst_branch_complete = nb_inst_branch_complete;
47    _nb_inst_update          = nb_inst_update         ;
48    _size_history            = size_history           ;
49    _size_ras_index          = size_ras_index         ;
50    _nb_thread                           = nb_thread                          ;
51    _translate_num_context_to_num_thread = translate_num_context_to_num_thread;
52   
53    _max_size_ras_index      = max<uint32_t>(_size_ras_index,nb_context);
54
55    _have_port_history       = _size_history   > 0;
56
57    test();
58
59    ALLOC1(_have_thread,bool,_nb_thread);
60    for (uint32_t i=0; i<_nb_thread; i++)
61      _have_thread[i] = false;
62    for (uint32_t i=0; i<_nb_context; i++)
63      _have_thread[_translate_num_context_to_num_thread [i]] = true;
64
65    if (is_toplevel)
66      {
67        _size_instruction_address = size_address;
68        _size_context_id          = log2(nb_context);
69        _size_depth               = log2(max<uint32_t>(_size_upt_queue,_nb_context));
70
71        _have_port_context_id    = _size_context_id> 0;
72        _have_port_depth          = _size_depth > 0;
73
74        copy ();
75      }
76   
77    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
78  };
79 
80// #undef  FUNCTION
81// #define FUNCTION "Update_Prediction_Table::Parameters (copy)"
82//   Parameters::Parameters (Parameters & param)
83//   {
84//     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
85//     test();
86//     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
87//   };
88
89#undef  FUNCTION
90#define FUNCTION "Update_Prediction_Table::~Parameters"
91  Parameters::~Parameters () 
92  {
93    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
94    DELETE1(_have_thread     ,_nb_thread);
95//     delete [] _size_depth     ;
96//     delete [] _have_port_depth;
97    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
98  };
99
100#undef  FUNCTION
101#define FUNCTION "Update_Prediction_Table::copy"
102  void Parameters::copy (void) 
103  {
104    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
105    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
106  };
107
108}; // end namespace update_prediction_table
109}; // end namespace prediction_unit
110}; // end namespace front_end
111}; // end namespace multi_front_end
112}; // end namespace core
113
114}; // end namespace behavioural
115}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.