source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_predict.cpp @ 122

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

Modif for performance :
1) Load Store Unit : store send request to valid exeception
2) Commit_unit : retire can bypass store
3) Commit_unit : add stat to manage store instruction
4) Load Store Unit and Load Store Pointer Manager : add store_queue_ptr_read
5) Fix lot of bug

File size: 2.9 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/Update_Prediction_Table/include/Update_Prediction_Table.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace prediction_unit {
17namespace update_prediction_table {
18
19
20#undef  FUNCTION
21#define FUNCTION "Update_Prediction_Table::genMealy_predict"
22  void Update_Prediction_Table::genMealy_predict (void)
23  {
24    log_begin(Update_Prediction_Table,FUNCTION);
25    log_function(Update_Prediction_Table,FUNCTION,_name.c_str());
26
27    if (PORT_READ(in_NRESET) != 0)
28      {
29    // For each prediction
30    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
31      {
32        // Read information
33        Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0;
34        uint32_t   top     = reg_UFPT_TOP[context]; // not multi branch prediction
35
36        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"PREDICT [%d] (genMealy)",i);
37        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * context     : %d",context);
38        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * top         : %d",top);
39        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * state       : %s",toString(reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._state).c_str());
40        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * is accurate : %d",PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i]));
41//      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * need update : %d",reg_NB_ELT_NEED_UPDATE [context]);
42
43        bool is_accurate = (_param->_always_accurate_predict or
44                            (_param->_can_accurate_predict and reg_IS_ACCURATE [context]));
45
46        // Ack if :
47        //  * no previous event (ufpt and upt is ok)
48        //  * top slot is empty
49        //  * is_accurate
50        internal_PREDICT_ACK [i] = ((reg_UFPT_EVENT_STATE [context] == UFPT_EVENT_STATE_OK) and
51                                    (reg_UPT_EVENT_STATE  [context] == UPT_EVENT_STATE_OK ) and
52                                    (reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._state == UPDATE_FETCH_PREDICTION_STATE_EMPTY) and
53                                    is_accurate);
54
55        internal_PREDICT_UPDATE_PREDICTION_ID [i] = top;
56
57        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ACK         : %d",internal_PREDICT_ACK [i]);
58
59        PORT_WRITE(out_PREDICT_ACK                  [i], internal_PREDICT_ACK                  [i]);
60        if (_param->_have_port_depth)
61        PORT_WRITE(out_PREDICT_UPDATE_PREDICTION_ID [i], internal_PREDICT_UPDATE_PREDICTION_ID [i]);
62      }
63
64      }//don't reset
65
66    log_end(Update_Prediction_Table,FUNCTION);
67  };
68
69}; // end namespace update_prediction_table
70}; // end namespace prediction_unit
71}; // end namespace front_end
72}; // end namespace multi_front_end
73}; // end namespace core
74
75}; // end namespace behavioural
76}; // end namespace morpheo             
77#endif
Note: See TracBrowser for help on using the repository browser.