source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Parameters.cpp @ 88

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 4.0 KB
Line 
1/*
2 * $Id: Parameters.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Parameters.h"
9#include "Common/include/Max.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace decod_unit {
17namespace decod {
18
19
20#undef  FUNCTION
21#define FUNCTION "Decod::Parameters"
22  Parameters::Parameters (uint32_t            nb_context                   ,
23                          uint32_t          * nb_inst_fetch                ,
24                          uint32_t            nb_inst_decod                ,
25                          uint32_t          * nb_branch_speculated         ,
26//                        uint32_t          * size_branch_update_prediction,
27                          uint32_t            nb_context_select            ,
28                          uint32_t            size_general_data            ,
29                          Tpriority_t         priority                     ,
30                          Tload_balancing_t   load_balancing               ,
31                          bool             ** instruction_implemeted       ,
32                          morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void),
33                          bool                is_toplevel
34                          )
35  {
36    log_printf(FUNC,Decod,FUNCTION,"Begin");
37
38    _nb_context                    = nb_context                   ;
39    _nb_inst_fetch                 = nb_inst_fetch                ;
40    _nb_inst_decod                 = nb_inst_decod                ;
41    _nb_branch_speculated          = nb_branch_speculated         ;
42    _nb_context_select             = nb_context_select            ;
43//  _size_branch_update_prediction = size_branch_update_prediction;
44//  _size_general_data             = size_general_data            ;
45    _priority                      = priority                     ;
46    _load_balancing                = load_balancing               ;
47    _instruction_implemeted        = instruction_implemeted       ;
48
49    if (get_custom_information == NULL)
50      _get_custom_information = &(morpheo::behavioural::custom::default_get_custom_information);
51    else
52      _get_custom_information = get_custom_information;
53
54   
55    _max_nb_inst_fetch                        = max<uint32_t>(nb_inst_fetch,nb_context);
56                                             
57//  _size_address_inst                        = size_general_data-2;
58
59    test();
60
61    if (is_toplevel)
62      {
63        _size_context_id                      = log2(nb_context          );
64        _size_depth                           = log2(max<uint32_t>(_nb_branch_speculated,_nb_context));
65//      _size_branch_update_prediction_id     = max<uint32_t>(_size_branch_update_prediction,_nb_context);
66        _size_inst_ifetch_ptr                 = log2(_max_nb_inst_fetch  );
67        _size_instruction_address             = size_general_data-2;
68        _size_general_data                    = size_general_data;
69
70        _have_port_context_id                 = _size_context_id > 0;
71        _have_port_depth                      = _size_depth                       > 0;
72//      _have_port_branch_update_prediction_id= _size_branch_update_prediction_id > 0;
73        _have_port_inst_ifetch_ptr            = _size_inst_ifetch_ptr             > 0;
74
75        copy ();
76      }
77
78    log_printf(FUNC,Decod,FUNCTION,"End");
79  };
80 
81// #undef  FUNCTION
82// #define FUNCTION "Decod::Parameters (copy)"
83//   Parameters::Parameters (Parameters & param)
84//   {
85//     log_printf(FUNC,Decod,FUNCTION,"Begin");
86//     test();
87//     log_printf(FUNC,Decod,FUNCTION,"End");
88//   };
89
90#undef  FUNCTION
91#define FUNCTION "Decod::~Parameters"
92  Parameters::~Parameters () 
93  {
94    log_printf(FUNC,Decod,FUNCTION,"Begin");
95
96    log_printf(FUNC,Decod,FUNCTION,"End");
97  };
98
99#undef  FUNCTION
100#define FUNCTION "Decod::copy"
101  void Parameters::copy (void) 
102  {
103    log_printf(FUNC,Decod,FUNCTION,"Begin");
104
105    log_printf(FUNC,Decod,FUNCTION,"End");
106  };
107
108}; // end namespace decod
109}; // end namespace decod_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.