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

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

1) Decod_queue : multi implementation (one_fifo, multi_fifo)
2) Issue_queue : multi implementation (in_order, out_of_order)
3) Direction : Add Meta predictor
4) Context_State : re add Branch_complete, More priority to Load miss (is not speculative)
5) Return_Address_Stack : update reg_PREDICT pointer on decod miss prediction
6) UPT : Fix bug in multi event
7) Prediction_glue : in read_stack case, insert in UPT pc_next
8) Rename select : when rob have an event (need flush), read_r{a,b,c} and write_r{d,e} is set at 0

  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1/*
2 * $Id: Parameters.cpp 111 2009-02-27 18:37:40Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/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 {
17
18
19#undef  FUNCTION
20#define FUNCTION "Decod_unit::Parameters"
21  Parameters::Parameters (uint32_t            nb_context                   ,
22                          uint32_t          * nb_inst_fetch                ,
23                          uint32_t            nb_inst_decod                ,
24                          uint32_t            size_queue                   ,
25                          decod_queue::Tdecod_queue_scheme_t
26                                              queue_scheme                 ,
27                          uint32_t            size_general_data            ,
28                          uint32_t          * nb_branch_speculated         ,
29//                        uint32_t          * size_branch_update_prediction,
30                          uint32_t            nb_context_select            ,
31                          Tpriority_t         select_priority              ,
32                          Tload_balancing_t   select_load_balancing        ,
33                          bool             ** instruction_implemeted       ,
34                          morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void),
35                          bool                is_toplevel                         
36                          )
37  {
38    log_begin(Decod_unit,FUNCTION);
39
40    _nb_context                    = nb_context                   ;
41    _nb_inst_fetch                 = nb_inst_fetch                ;
42    _nb_inst_decod                 = nb_inst_decod                ;
43    _size_queue                    = size_queue                   ;
44    _queue_scheme                  = queue_scheme                 ;
45//  _size_general_data             = size_general_data            ;
46    _nb_branch_speculated          = nb_branch_speculated         ;
47//  _size_branch_update_prediction = size_branch_update_prediction;
48    _nb_context_select             = nb_context_select            ;
49    _select_priority               = select_priority              ;
50    _select_load_balancing         = select_load_balancing        ;
51    _instruction_implemeted        = instruction_implemeted       ;
52    _get_custom_information        = get_custom_information       ;
53
54    _max_nb_inst_fetch                     = max<uint32_t>(_nb_inst_fetch,_nb_context);
55//  _size_address_inst                     = size_general_data-2;
56
57    test();
58
59    _param_decod = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::Parameters
60      (_nb_context                   ,
61       _nb_inst_fetch                ,
62       _nb_inst_decod                ,
63       _nb_branch_speculated,
64//     _size_branch_update_prediction,
65       _nb_context_select            ,
66        size_general_data            ,
67       _select_priority              ,
68       _select_load_balancing        ,
69       _instruction_implemeted       ,
70       _get_custom_information);
71
72    _param_decod_queue = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Parameters
73      (_nb_context          ,
74       _nb_inst_decod       ,
75       _size_queue          ,
76       _queue_scheme        ,
77        size_general_data   ,
78       _nb_branch_speculated);
79
80    if (is_toplevel)
81      {
82        _size_context_id                       = log2(_nb_context);
83        _size_depth                            = max<uint32_t>(_nb_branch_speculated,_nb_context);
84//      _size_branch_update_prediction_id      = max<uint32_t>(_size_branch_update_prediction,_nb_context);
85        _size_inst_ifetch_ptr                  = log2(max<uint32_t>(_nb_inst_fetch,_nb_context));
86        _size_nb_inst_decod                    = log2(_size_queue)+1;
87
88        _size_instruction_address              = size_general_data-2;
89        _size_general_data                     = size_general_data;
90
91        _have_port_context_id                  = _size_context_id > 0;
92        _have_port_depth                       = (_size_depth                       > 0);
93//      _have_port_branch_update_prediction_id = (_size_branch_update_prediction_id > 0);
94        _have_port_inst_ifetch_ptr             = (_size_inst_ifetch_ptr             > 0);
95
96        copy ();
97      }
98
99    log_end(Decod_unit,FUNCTION);
100  };
101 
102// #undef  FUNCTION
103// #define FUNCTION "Decod_unit::Parameters (copy)"
104//   Parameters::Parameters (Parameters & param)
105//   {
106//     log_begin(Decod_unit,FUNCTION);
107//     test();
108//     log_end(Decod_unit,FUNCTION);
109//   };
110
111#undef  FUNCTION
112#define FUNCTION "Decod_unit::~Parameters"
113  Parameters::~Parameters () 
114  {
115    log_begin(Decod_unit,FUNCTION);
116
117    delete    _param_decod;
118    delete    _param_decod_queue;
119
120    log_end(Decod_unit,FUNCTION);
121  };
122
123
124#undef  FUNCTION
125#define FUNCTION "Decod_unit::copy"
126  void Parameters::copy (void) 
127  {
128    log_begin(Decod_unit,FUNCTION);
129
130    COPY(_param_decod      );
131    COPY(_param_decod_queue);
132
133    log_end(Decod_unit,FUNCTION);
134  };
135
136}; // end namespace decod_unit
137}; // end namespace front_end
138}; // end namespace multi_front_end
139}; // end namespace core
140
141}; // end namespace behavioural
142}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.