source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/src/Branch_Target_Buffer_Register_genMealy_decod.cpp @ 78

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

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 2.0 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/include/Branch_Target_Buffer_Register.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_register {
19
20#undef  FUNCTION
21#define FUNCTION "Branch_Target_Buffer_Register::genMealy_decod"
22  void Branch_Target_Buffer_Register::genMealy_decod (void)
23  {
24    log_printf(FUNC,Branch_Target_Buffer_Register,FUNCTION,"Begin");
25
26    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
27      {
28        Tcontext_t      context   = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID  [i]):0;
29        Tgeneral_data_t address   = PORT_READ(in_DECOD_ADDRESS_SRC [i]);
30
31        Tcontrol_t      hit       = false;
32        uint32_t        num_bank  = (address>>_param->_shift_bank)&_param->_mask_bank;
33        uint32_t        num_entry = 0;
34       
35        if (PORT_READ(in_DECOD_VAL [i]))
36          for (;num_entry < _param->_associativity; num_entry ++)
37            {
38              hit = ((reg_BTB[num_bank][num_entry]._val         == 1      ) and
39                     (reg_BTB[num_bank][num_entry]._context     == context) and
40                     (reg_BTB[num_bank][num_entry]._address_src == address));
41
42              if (hit)
43                break;
44            }
45
46        internal_DECOD_HIT       [i] = hit      ;
47        internal_DECOD_NUM_BANK  [i] = num_bank ;
48        internal_DECOD_NUM_ENTRY [i] = num_entry;
49
50        PORT_WRITE(out_DECOD_HIT       [i], hit);
51        if (_param->_have_port_victim)
52        PORT_WRITE(out_DECOD_HIT_INDEX [i], num_entry);
53      }
54
55    log_printf(FUNC,Branch_Target_Buffer_Register,FUNCTION,"End");
56  };
57
58}; // end namespace branch_target_buffer_register
59}; // end namespace branch_target_buffer
60}; // end namespace prediction_unit
61}; // end namespace front_end
62}; // end namespace multi_front_end
63}; // end namespace core
64
65}; // end namespace behavioural
66}; // end namespace morpheo             
67#endif
Note: See TracBrowser for help on using the repository browser.