source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_branch_complete_pht_address.cpp @ 3

Last change on this file since 3 was 3, checked in by kane, 17 years ago

1) Ajout d'un "printer" XML pour la configuration de paramètres

2) Fin du composant "Two_Level_Branch_Predictor"

validation * systemc

  • vhdl
File size: 1.8 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
10#include "Include/BitManipulation.h"
11
12namespace morpheo {
13namespace behavioural {
14namespace stage_1_ifetch {
15namespace predictor {
16namespace meta_predictor {
17namespace two_level_branch_predictor {
18namespace two_level_branch_predictor_glue {
19
20  void Two_Level_Branch_Predictor_Glue::genMealy_branch_complete_pht_address (void)
21  {
22    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","Begin");
23
24    if (_param._have_pht)
25      for (uint32_t i=0; i<_param._nb_branch_complete; i++)
26        {
27          // Address
28          Taddress_t     address = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);
29          Tbht_history_t history = 0;
30         
31          if (_param._have_bht)
32            {
33              history = PORT_READ (in_BRANCH_COMPLETE_BHT_HISTORY [i]);
34              address = address << _param._pht_size_address_shift;
35            }
36
37          Taddress_t     pht_address = (history ^ address) & gen_mask<Taddress_t>(_param._pht_size_address);
38
39          log_printf(TRACE,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","out_BRANCH_COMPLETE_PHT_ADDRESS [%d]= %.8x xor %.8x<<%d = %.8x",i,history,PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]),_param._pht_size_address_shift, pht_address);
40         
41          PORT_WRITE (out_BRANCH_COMPLETE_PHT_ADDRESS [i], pht_address);
42        }
43   
44    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","End");
45  };
46
47}; // end namespace two_level_branch_predictor_glue
48}; // end namespace two_level_branch_predictor
49}; // end namespace meta_predictor
50}; // end namespace predictor
51}; // end namespace stage_1_ifetch
52}; // end namespace behavioural
53}; // end namespace morpheo             
54#endif
Note: See TracBrowser for help on using the repository browser.