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

Last change on this file since 82 was 82, checked in by rosiere, 16 years ago
  • support locale (now must "just" translate)
  • update all component with new test format
  • update all component with usage
  • New component : decod queue and prediction_unit
File size: 3.1 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/include/Parameters.h"
9#include "Common/include/Max.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace prediction_unit {
17namespace prediction_unit_glue {
18
19
20#undef  FUNCTION
21#define FUNCTION "Prediction_unit_Glue::Parameters"
22  Parameters::Parameters (uint32_t   nb_context            ,
23                          uint32_t   nb_decod_unit         ,
24//                        uint32_t   nb_ooo_engine         ,
25                          uint32_t   size_address          ,
26                          uint32_t * nb_instruction        ,
27                          uint32_t * size_depth            ,
28                          uint32_t * nb_inst_decod         ,
29//                        uint32_t * nb_inst_update        ,
30                          uint32_t   nb_inst_branch_predict,
31                          uint32_t   nb_inst_branch_decod  ,
32                          uint32_t   nb_inst_branch_update )
33  {
34    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
35
36    _nb_context                = nb_context     ;
37    _size_address              = size_address   ;
38    _nb_instruction            = nb_instruction ;
39    _size_depth                = size_depth     ;
40    _nb_decod_unit             = nb_decod_unit  ;
41    _nb_inst_decod             = nb_inst_decod  ;
42//     _nb_ooo_engine             = nb_ooo_engine  ;
43//     _nb_inst_update            = nb_inst_update ;
44    _nb_inst_branch_predict    = nb_inst_branch_predict;
45    _nb_inst_branch_decod      = nb_inst_branch_decod  ;
46    _nb_inst_branch_update     = nb_inst_branch_update ;
47     
48    _size_context_id           = log2(_nb_context);
49    _size_inst_ifetch_ptr      = new uint32_t [_nb_context];
50    _max_size_depth            = max<uint32_t>(_size_depth,_nb_context);
51
52    _have_port_context_id      = (_size_context_id>0);
53    _have_port_max_depth       = (_max_size_depth>0);
54    _have_port_depth           = new bool [_nb_context];
55    _have_port_inst_ifetch_ptr = new bool [_nb_context];
56
57    for (uint32_t i=0; i<_nb_context; i++)
58      {
59        _size_inst_ifetch_ptr      [i] = log2(_nb_instruction [i]);
60        _have_port_depth           [i] = (_size_depth [i] > 0);
61        _have_port_inst_ifetch_ptr [i] = (_size_inst_ifetch_ptr [i] > 0);
62      }
63
64    test();
65    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
66  };
67 
68// #undef  FUNCTION
69// #define FUNCTION "Prediction_unit_Glue::Parameters (copy)"
70//   Parameters::Parameters (Parameters & param)
71//   {
72//     log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
73//     test();
74//     log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
75//   };
76
77#undef  FUNCTION
78#define FUNCTION "Prediction_unit_Glue::~Parameters"
79  Parameters::~Parameters () 
80  {
81    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
82    delete  [] _size_inst_ifetch_ptr     ;
83    delete  [] _have_port_depth          ;
84    delete  [] _have_port_inst_ifetch_ptr;
85    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
86  };
87
88}; // end namespace prediction_unit_glue
89}; // end namespace prediction_unit
90}; // end namespace front_end
91}; // end namespace multi_front_end
92}; // end namespace core
93
94}; // end namespace behavioural
95}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.