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/Decod_unit/Decod_queue/src/Decod_queue_transition.cpp

    r87 r88  
    2323  {
    2424    log_begin(Decod_queue,FUNCTION);
     25    log_function(Decod_queue,FUNCTION,_name.c_str());
    2526
    2627    if (PORT_READ(in_NRESET) == 0)
     
    3536        //--------------------------------------------------------------------
    3637        //-----[ DECOD_IN ]---------------------------------------------------
    37         //--------------------------------------------------------------------
    38         for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     38        //-------------------------------------------------------------------- 
     39        decod_queue_entry_t * entry = NULL;
     40        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    3941          {
    40             decod_queue_entry_t * entry = NULL;
    4142            if (PORT_READ(in_DECOD_IN_VAL [i]) and internal_DECOD_IN_ACK[i])
    4243              {
    43                 log_printf(TRACE,Decod_queue,FUNCTION,_("DECOD_IN  [%d]"),i);
     44                log_printf(TRACE,Decod_queue,FUNCTION,_("  * DECOD_IN  [%d]"),i);
    4445
    4546                if (entry == NULL)
    46                   entry = new decod_queue_entry_t (_param->_nb_inst_decod);
     47                 {
     48                   // Once creation and insert in queue
     49                   entry = new decod_queue_entry_t (_param->_nb_inst_decod);
     50                   reg_QUEUE->push_back(entry);
     51                 }
    4752
    4853                Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_IN_CONTEXT_ID [i]):0;
    4954
    50                 log_printf(TRACE,Decod_queue,FUNCTION,_("  * context : %d"),context);
     55                log_printf(TRACE,Decod_queue,FUNCTION,_("    * context : %d"),context);
    5156
    5257                entry->_val           [i] = 1;
     
    5560                entry->_type          [i] = PORT_READ(in_DECOD_IN_TYPE          [i]);
    5661                entry->_operation     [i] = PORT_READ(in_DECOD_IN_OPERATION     [i]);
     62                entry->_no_execute    [i] = PORT_READ(in_DECOD_IN_NO_EXECUTE    [i]);
    5763                entry->_is_delay_slot [i] = PORT_READ(in_DECOD_IN_IS_DELAY_SLOT [i]);
    5864                entry->_address       [i] = PORT_READ(in_DECOD_IN_ADDRESS       [i]);
     
    7076                entry->_num_reg_re    [i] = PORT_READ(in_DECOD_IN_NUM_REG_RE    [i]);
    7177                entry->_exception_use [i] = PORT_READ(in_DECOD_IN_EXCEPTION_USE [i]);
     78                entry->_exception     [i] = PORT_READ(in_DECOD_IN_EXCEPTION     [i]);
    7279
    7380                reg_NB_INST [context] ++;
    74                 reg_QUEUE->push_back(entry);
    7581
    76                 log_printf(TRACE,Decod_queue,FUNCTION,_("  * nb_inst : %d"),reg_NB_INST [context]);
    77                 log_printf(TRACE,Decod_queue,FUNCTION,_("  * PUSH queue"));
     82                log_printf(TRACE,Decod_queue,FUNCTION,_("    * nb_inst : %d"),reg_NB_INST [context]);
     83                log_printf(TRACE,Decod_queue,FUNCTION,_("    * PUSH queue"));
    7884              }
    7985          }
     
    9197                if (internal_DECOD_OUT_VAL [i] and internal_DECOD_OUT_ACK[i])
    9298                  {
    93                     log_printf(TRACE,Decod_queue,FUNCTION,_("DECOD_OUT [%d]"),i);
     99                    log_printf(TRACE,Decod_queue,FUNCTION,_("  * DECOD_OUT [%d]"),i);
    94100               
    95101                    reg_QUEUE->front()->_val [i] = 0;
    96102
    97103                    Tcontext_t context = reg_QUEUE->front()->_context_id [i];
    98                     log_printf(TRACE,Decod_queue,FUNCTION,_("  * context : %d"),context);
     104                    log_printf(TRACE,Decod_queue,FUNCTION,_("    * context : %d"),context);
    99105                   
    100106                    reg_NB_INST [context] --;
    101                     log_printf(TRACE,Decod_queue,FUNCTION,_("  * nb_inst : %d"),reg_NB_INST [context]);
     107                    log_printf(TRACE,Decod_queue,FUNCTION,_("    * nb_inst : %d"),reg_NB_INST [context]);
    102108                  }
    103109                // Test if slot is (again) valid, if yes, then have less one instruction in the entry
     
    108114            if (not find) // no valid instruction in current slot
    109115              {
    110                 log_printf(TRACE,Decod_queue,FUNCTION,_("  * POP  queue"));
     116                log_printf(TRACE,Decod_queue,FUNCTION,_("    * POP  queue"));
    111117
    112118                // can pop the slot
     
    117123      }
    118124
    119 #if (DEBUG >= DEBUG_TRACE) and (DEBUG_Decod_queue)
     125#if defined(DEBUG) and defined(DEBUG_Decod_queue) and (DEBUG >= DEBUG_TRACE)
     126    log_printf(TRACE,Decod_queue,FUNCTION,"  * Dump decod_queue");
    120127    uint32_t x=0;
    121128    for (std::list<decod_queue_entry_t*>::iterator it=reg_QUEUE->begin();
     
    123130         it++)
    124131      {
    125         log_printf(TRACE,Decod_queue,FUNCTION,"[%d] ",x);
     132        log_printf(TRACE,Decod_queue,FUNCTION,"    * [%d] ",x);
    126133
    127134        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    128135          {
    129136            if ((*it)->_val [i])
    130               log_printf(TRACE,Decod_queue,FUNCTION," * [%d] %d, %d %d, %d %d %d, 0x%x, %d 0x%x, %d %d, %d %d, %d %d, %d %d, %d %d, %d "
     137              log_printf(TRACE,Decod_queue,FUNCTION,"      * [%d] %d, %d %d, %d %d %d %d, 0x%x, %d 0x%x, %d %d, %d %d, %d %d, %d %d, %d %d, %d %d"
    131138                         ,i
    132139                         ,(*it)->_val           [i]
     
    135142                         ,(*it)->_type          [i]
    136143                         ,(*it)->_operation     [i]
     144                         ,(*it)->_no_execute    [i]
    137145                         ,(*it)->_is_delay_slot [i]
    138146                         ,(*it)->_address       [i]
     
    150158                         ,(*it)->_num_reg_re    [i]
    151159                         ,(*it)->_exception_use [i]
     160                         ,(*it)->_exception     [i]
    152161                         );
    153162            else
    154               log_printf(TRACE,Decod_queue,FUNCTION," * [%d] %d"
     163              log_printf(TRACE,Decod_queue,FUNCTION,"      * [%d] %d"
    155164                         ,i
    156165                         ,(*it)->_val           [i]
     
    163172   
    164173#ifdef STATISTICS
    165     for (uint32_t i=0; i<_param->_nb_context; i++)
    166       *(_stat_nb_inst [i]) += reg_NB_INST [i];
     174    if (usage_is_set(_usage,USE_STATISTICS))
     175      {
     176        *(_stat_use_queue) += reg_QUEUE->size();
     177        for (uint32_t i=0; i<_param->_nb_context; i++)
     178          *(_stat_nb_inst [i]) += reg_NB_INST [i];
     179      }
    167180#endif
    168181
Note: See TracChangeset for help on using the changeset viewer.