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

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
File size: 2.6 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
10namespace morpheo {
11namespace behavioural {
12namespace core {
13namespace multi_front_end {
14namespace front_end {
15namespace prediction_unit {
16namespace prediction_unit_glue {
17
18
19#undef  FUNCTION
20#define FUNCTION "Prediction_unit_Glue::Parameters"
21  Parameters::Parameters (uint32_t   nb_context     ,
22                          uint32_t   size_address   ,
23                          uint32_t * nb_instruction ,
24                          uint32_t * size_depth     ,
25                          uint32_t   nb_inst_predict,
26                          uint32_t   nb_inst_decod  ,
27                          uint32_t   nb_inst_update )
28  {
29    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
30
31    _nb_context                = nb_context             ;
32    _size_address              = size_address           ;
33    _nb_instruction            = nb_instruction         ;
34    _size_depth                = size_depth             ;
35    _nb_inst_predict           = nb_inst_predict        ;
36    _nb_inst_decod             = nb_inst_decod          ;
37    _nb_inst_update            = nb_inst_update         ;
38
39    _size_context_id           = log2(_nb_context);
40    _size_inst_ifetch_ptr      = new uint32_t [_nb_context];
41
42    _have_port_context_id      = (_size_context_id>0);
43    _have_port_depth           = new bool [_nb_context];
44    _have_port_inst_ifetch_ptr = new bool [_nb_context];
45
46    for (uint32_t i=0; i<_nb_context; i++)
47      {
48        _size_inst_ifetch_ptr      [i] = log2(_nb_instruction [i]);
49        _have_port_depth           [i] = (_size_depth [i] > 0);
50        _have_port_inst_ifetch_ptr [i] = (_size_inst_ifetch_ptr [i] > 0);
51      }
52
53    test();
54    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
55  };
56 
57// #undef  FUNCTION
58// #define FUNCTION "Prediction_unit_Glue::Parameters (copy)"
59//   Parameters::Parameters (Parameters & param)
60//   {
61//     log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
62//     test();
63//     log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
64//   };
65
66#undef  FUNCTION
67#define FUNCTION "Prediction_unit_Glue::~Parameters"
68  Parameters::~Parameters () 
69  {
70    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"Begin");
71    delete  [] _size_inst_ifetch_ptr     ;
72    delete  [] _have_port_depth          ;
73    delete  [] _have_port_inst_ifetch_ptr;
74    log_printf(FUNC,Prediction_unit_Glue,FUNCTION,"End");
75  };
76
77}; // end namespace prediction_unit_glue
78}; // end namespace prediction_unit
79}; // end namespace front_end
80}; // end namespace multi_front_end
81}; // end namespace core
82
83}; // end namespace behavioural
84}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.