Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (16 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_decod.cpp

    r82 r88  
    2222  void Update_Prediction_Table::genMealy_decod (void)
    2323  {
    24     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
     24    log_begin(Update_Prediction_Table,FUNCTION);
     25    log_function(Update_Prediction_Table,FUNCTION,_name.c_str());
    2526   
     27    // WARNING : One branch per context per cycle
    2628    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    2729      {
    28         Tcontrol_t miss = PORT_READ(in_DECOD_MISS_DECOD [i]);
     30        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * DECOD [%d]",i);
    2931
    30         if (miss)
    31           {
    32             // miss : need a empty slot.
    33             Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
    34             uint32_t   top     = reg_TOP[context];
    35             internal_DECOD_ACK [i] = (reg_UPDATE_PREDICTION_TABLE [context][top]._state == UPDATE_PREDICTION_STATE_EMPTY);
    36           }
    37         else
    38           {
    39             internal_DECOD_ACK [i] = true;
    40           }
     32        Tcontext_t    context     = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
     33        bool          is_accurate = reg_IS_ACCURATE [context];
     34        event_state_t event_state = reg_EVENT_STATE [context];
     35        uint32_t      ptr_write   = reg_UPT_TOP     [context];
     36
     37        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * context     : %d",context    );
     38        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * is_accurate : %d",is_accurate);
     39        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * event_state : %s",toString(event_state).c_str());
     40        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ptr_write   : %d",ptr_write  );
     41        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * upt_state   : %s",toString(reg_UPDATE_PREDICTION_TABLE [context][ptr_write]._state).c_str());
     42
     43        // ack :
     44        //   * in all case (miss or hit), need empty slot
     45        //   * is_accurate
     46        //   * event_state : don't update upt
     47        internal_DECOD_ACK           [i] = ((reg_UPDATE_PREDICTION_TABLE [context][ptr_write]._state == UPDATE_PREDICTION_STATE_EMPTY) and
     48                                            is_accurate and
     49//                                             (
     50                                             (event_state == EVENT_STATE_OK            )//  or
     51//                                              (event_state == EVENT_STATE_FLUSH_UFPT    ) or
     52//                                              (event_state == EVENT_STATE_UPDATE_CONTEXT))
     53                                            );
     54        internal_DECOD_UPT_PTR_WRITE [i] = ptr_write;
     55
     56        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ack         : %d",internal_DECOD_ACK [i]);
    4157
    4258        PORT_WRITE(out_DECOD_ACK [i], internal_DECOD_ACK [i]);
    4359      }
    4460
    45     log_printf(FUNC,Update_Prediction_Table,FUNCTION,"End");
     61    log_end(Update_Prediction_Table,FUNCTION);
    4662  };
    4763
Note: See TracChangeset for help on using the changeset viewer.