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

Last change on this file since 86 was 86, checked in by rosiere, 16 years ago

Decod :

  • Correct selftest
  • Set Instruction address on (32/64)-2 bits,
  • Decod Custom Instruction : valid and tested. (add an test to verify the decod information)
  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1/*
2 * $Id: Parameters.cpp 86 2008-05-14 17:08:56Z 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) (uint32_t))
33  {
34    log_printf(FUNC,Decod,FUNCTION,"Begin");
35
36    _nb_context                    = nb_context                   ;
37    _nb_inst_fetch                 = nb_inst_fetch                ;
38    _nb_inst_decod                 = nb_inst_decod                ;
39    _nb_branch_speculated          = nb_branch_speculated         ;
40    _nb_context_select             = nb_context_select            ;
41    _size_branch_update_prediction = size_branch_update_prediction;
42    _size_general_data             = size_general_data            ;
43    _priority                      = priority                     ;
44    _load_balancing                = load_balancing               ;
45    _instruction_implemeted        = instruction_implemeted       ;
46
47    if (get_custom_information == NULL)
48      _get_custom_information = &(morpheo::behavioural::custom::default_get_custom_information);
49    else
50      _get_custom_information = get_custom_information;
51
52   
53    _max_nb_inst_fetch                     = max<uint32_t>(nb_inst_fetch,nb_context);
54
55    _size_address_inst                     = size_address-2;
56    _size_context_id                       = log2(nb_context          );
57    _size_depth                            = log2(nb_branch_speculated);
58    _size_inst_ifetch_ptr                  = log2(_max_nb_inst_fetch  );
59
60    _have_port_context_id                  = _size_context_id > 0;
61    _have_port_depth                       = _size_depth      > 0;
62    _have_port_branch_update_prediction_id = _size_branch_update_prediction > 0;
63    _have_port_inst_ifetch_ptr             = _size_inst_ifetch_ptr > 0;
64   
65    test();
66    log_printf(FUNC,Decod,FUNCTION,"End");
67  };
68 
69// #undef  FUNCTION
70// #define FUNCTION "Decod::Parameters (copy)"
71//   Parameters::Parameters (Parameters & param)
72//   {
73//     log_printf(FUNC,Decod,FUNCTION,"Begin");
74//     test();
75//     log_printf(FUNC,Decod,FUNCTION,"End");
76//   };
77
78#undef  FUNCTION
79#define FUNCTION "Decod::~Parameters"
80  Parameters::~Parameters () 
81  {
82    log_printf(FUNC,Decod,FUNCTION,"Begin");
83    log_printf(FUNC,Decod,FUNCTION,"End");
84  };
85
86}; // end namespace decod
87}; // end namespace decod_unit
88}; // end namespace front_end
89}; // end namespace multi_front_end
90}; // end namespace core
91
92}; // end namespace behavioural
93}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.