source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/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: 2.8 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/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue/include/Parameters.h"
9#include "Common/include/BitManipulation.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace prediction_unit {
17namespace branch_target_buffer {
18namespace branch_target_buffer_glue {
19
20
21#undef  FUNCTION
22#define FUNCTION "Branch_Target_Buffer_Glue::Parameters"
23  Parameters::Parameters (uint32_t   max_nb_instruction,
24                          uint32_t   size_buffer       ,
25                          uint32_t   associativity     ,
26                          uint32_t   size_address      ,
27                          uint32_t   nb_inst_predict   ,
28                          uint32_t   nb_inst_decod     ,
29                          uint32_t   nb_inst_update    ,
30                          bool       is_toplevel)
31  {
32    log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"Begin");
33
34    _max_nb_instruction     = max_nb_instruction;
35    _size_buffer            = size_buffer       ;
36    _associativity          = associativity     ;
37//  _size_address           = size_address      ;
38    _nb_inst_predict        = nb_inst_predict   ;
39    _nb_inst_decod          = nb_inst_decod     ;
40    _nb_inst_update         = nb_inst_update    ;
41
42    _size_bank              = size_buffer/associativity;
43    _size_victim            = log2(associativity);
44    _size_victim_address    = log2(_size_bank);
45
46    _have_port_victim       = (_size_victim     > 0);
47    _is_full_associative    = _size_bank == 1;
48
49    _mask_bank              = gen_mask<Tgeneral_data_t> (_size_victim_address);
50    _shift_bank             = log2(max_nb_instruction)+2;
51
52    test();
53
54    if (is_toplevel)
55      {
56        _size_instruction_address = size_address;
57
58        copy();
59      }
60
61    log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"End");
62  };
63 
64// #undef  FUNCTION
65// #define FUNCTION "Branch_Target_Buffer_Glue::Parameters (copy)"
66//   Parameters::Parameters (Parameters & param)
67//   {
68//     log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"Begin");
69//     test();
70//     log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"End");
71//   };
72
73#undef  FUNCTION
74#define FUNCTION "Branch_Target_Buffer_Glue::~Parameters"
75  Parameters::~Parameters () 
76  {
77    log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"Begin");
78    log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"End");
79  };
80
81#undef  FUNCTION
82#define FUNCTION "Branch_Target_Buffer_Glue::copy"
83  void Parameters::copy (void) 
84  {
85    log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"Begin");
86    log_printf(FUNC,Branch_Target_Buffer_Glue,FUNCTION,"End");
87  };
88
89}; // end namespace branch_target_buffer_glue
90}; // end namespace branch_target_buffer
91}; // end namespace prediction_unit
92}; // end namespace front_end
93}; // end namespace multi_front_end
94}; // end namespace core
95
96}; // end namespace behavioural
97}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.