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

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

1) Context_state : Add statistics
2) Add configuration with multi front_end
3) Add optionnal pid at log filename

  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1/*
2 * $Id: Parameters.cpp 120 2009-05-26 19:01:47Z 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    _accurate_block_predict (false),
37    _accurate_block_decod   (false)
38  {
39    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
40
41    _nb_context              = nb_context             ;
42    _size_upt_queue          = size_upt_queue         ;
43    _size_ufpt_queue         = size_ufpt_queue        ;
44//  _size_address            = size_address           ;
45    _nb_inst_predict         = nb_inst_predict        ;
46    _nb_inst_decod           = nb_inst_decod          ;
47    _nb_inst_branch_complete = nb_inst_branch_complete;
48    _nb_inst_update          = nb_inst_update         ;
49    _size_history            = size_history           ;
50    _size_ras_index          = size_ras_index         ;
51    _nb_thread                           = nb_thread                          ;
52    _translate_num_context_to_num_thread = translate_num_context_to_num_thread;
53   
54    _max_size_ras_index      = max<uint32_t>(_size_ras_index,nb_context);
55
56    _have_port_history       = _size_history   > 0;
57
58    test();
59
60    ALLOC1(_have_thread,bool,_nb_thread);
61    for (uint32_t i=0; i<_nb_thread; i++)
62      _have_thread[i] = false;
63    for (uint32_t i=0; i<_nb_context; i++)
64      _have_thread[_translate_num_context_to_num_thread [i]] = true;
65
66    if (is_toplevel)
67      {
68        _size_instruction_address = size_address;
69        _size_context_id          = log2(nb_context);
70        _size_depth               = log2(max<uint32_t>(_size_upt_queue,_nb_context));
71
72        _have_port_context_id    = _size_context_id> 0;
73        _have_port_depth          = _size_depth > 0;
74
75        copy ();
76      }
77   
78    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
79  };
80 
81// #undef  FUNCTION
82// #define FUNCTION "Update_Prediction_Table::Parameters (copy)"
83//   Parameters::Parameters (Parameters & param)
84//   {
85//     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
86//     test();
87//     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
88//   };
89
90#undef  FUNCTION
91#define FUNCTION "Update_Prediction_Table::~Parameters"
92  Parameters::~Parameters () 
93  {
94    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
95    DELETE1(_have_thread     ,_nb_thread);
96//     delete [] _size_depth     ;
97//     delete [] _have_port_depth;
98    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
99  };
100
101#undef  FUNCTION
102#define FUNCTION "Update_Prediction_Table::copy"
103  void Parameters::copy (void) 
104  {
105    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
106    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
107  };
108
109}; // end namespace update_prediction_table
110}; // end namespace prediction_unit
111}; // end namespace front_end
112}; // end namespace multi_front_end
113}; // end namespace core
114
115}; // end namespace behavioural
116}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.