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

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

1) Add new algo in ifetch queue
2) Add Cancel bit
3) new config

  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1/*
2 * $Id: Parameters.cpp 136 2009-10-20 18:52:15Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/include/Parameters.h"
9
10namespace morpheo {
11namespace behavioural {
12namespace core {
13namespace multi_front_end {
14namespace front_end {
15namespace ifetch_unit {
16
17
18#undef  FUNCTION
19#define FUNCTION "Ifetch_unit::Parameters"
20  Parameters::Parameters (uint32_t size_queue                   ,
21                          ifetch_queue::Tifetch_queue_scheme_t
22                                   queue_scheme                 ,
23                          uint32_t nb_instruction               ,
24                          uint32_t size_branch_update_prediction,
25                          uint32_t size_address                 ,
26                          bool     is_toplevel
27                          )
28  {
29    log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin");
30
31    _size_queue                            = size_queue                   ;
32    _queue_scheme                          = queue_scheme                 ;
33    _nb_instruction                        = nb_instruction               ;
34//  _size_branch_update_prediction         = size_branch_update_prediction;
35//  _size_address                          = size_address                 ;
36
37    test();
38
39    _param_address_management = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::address_management::Parameters
40      (nb_instruction               ,
41       size_address                 ,
42       size_branch_update_prediction);
43    _param_ifetch_queue       = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::      Parameters
44      (size_queue                   ,
45       queue_scheme                 ,
46       nb_instruction               ,
47       size_branch_update_prediction,
48       size_address                 );
49    _param_ifetch_unit_glue   = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_unit_glue::  Parameters
50      (size_address);
51
52    if (is_toplevel)
53      {
54        _size_instruction_address   = size_address;
55        _size_ifetch_queue_ptr      = log2(size_queue);
56        _size_inst_ifetch_ptr       = log2(nb_instruction);
57        _size_depth                 = size_branch_update_prediction;
58
59        _have_port_ifetch_queue_ptr = _size_ifetch_queue_ptr > 0;
60        _have_port_inst_ifetch_ptr  = _size_inst_ifetch_ptr > 0;
61        _have_port_depth            = _size_depth > 0;
62
63        copy ();
64      }
65
66    log_printf(FUNC,Ifetch_unit,FUNCTION,"End");
67  };
68 
69// #undef  FUNCTION
70// #define FUNCTION "Ifetch_unit::Parameters (copy)"
71//   Parameters::Parameters (Parameters & param)
72//   {
73//     log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin");
74//     test();
75//     log_printf(FUNC,Ifetch_unit,FUNCTION,"End");
76//   };
77
78#undef  FUNCTION
79#define FUNCTION "Ifetch_unit::~Parameters"
80  Parameters::~Parameters () 
81  {
82    log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin");
83    delete _param_address_management;
84    delete _param_ifetch_queue      ;
85    delete _param_ifetch_unit_glue  ;
86    log_printf(FUNC,Ifetch_unit,FUNCTION,"End");
87  };
88
89#undef  FUNCTION
90#define FUNCTION "Ifetch_unit::copy"
91  void Parameters::copy (void) 
92  {
93    log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin");
94   
95    COPY(_param_address_management);
96    COPY(_param_ifetch_queue      );
97    COPY(_param_ifetch_unit_glue  );
98
99    log_printf(FUNC,Ifetch_unit,FUNCTION,"End");
100  };
101
102}; // end namespace ifetch_unit
103}; // end namespace front_end
104}; // end namespace multi_front_end
105}; // end namespace core
106
107}; // end namespace behavioural
108}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.