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/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_transition.cpp

    r85 r88  
    2222  void Ifetch_queue::transition (void)
    2323  {
    24     log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin");
     24    log_begin(Ifetch_queue,FUNCTION);
    2525
    2626    if (PORT_READ(in_NRESET) == 0)
     
    3434    else
    3535      {
    36         log_printf(NONE,Ifetch_queue,FUNCTION," * KANE address : 0x%x",PORT_READ(in_ADDRESS_INSTRUCTION_ADDRESS));
    37    
    38 
    3936        // ==========================================================
    4037        // =====[ ADDRESS ]==========================================
     
    4744             
    4845#ifdef STATISTICS
    49             (*_sum_transaction_address) ++;
     46            if (usage_is_set(_usage,USE_STATISTICS))
     47              (*_sum_transaction_address) ++;
    5048#endif
    5149
     
    5452                Tcontrol_t enable = PORT_READ(in_ADDRESS_INSTRUCTION_ENABLE [i]);
    5553#ifdef STATISTICS
    56                 (*_sum_inst_enable) += enable;
     54                if (usage_is_set(_usage,USE_STATISTICS))
     55                  (*_sum_inst_enable) += enable;
    5756#endif
    5857                _queue[reg_PTR_WRITE]->_instruction_enable [i]      = enable;
     
    6059
    6160            _queue[reg_PTR_WRITE]->_address                     = PORT_READ(in_ADDRESS_INSTRUCTION_ADDRESS        );
    62             _queue[reg_PTR_WRITE]->_inst_ifetch_ptr             = (_param->_have_port_instruction_ptr)?PORT_READ(in_ADDRESS_INST_IFETCH_PTR            ):0;
     61            _queue[reg_PTR_WRITE]->_inst_ifetch_ptr             = (_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_ADDRESS_INST_IFETCH_PTR            ):0;
    6362            _queue[reg_PTR_WRITE]->_branch_state                = PORT_READ(in_ADDRESS_BRANCH_STATE               );
    64             _queue[reg_PTR_WRITE]->_branch_update_prediction_id = (_param->_have_port_branch_update_prediction_id)?PORT_READ(in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID):0;
     63            _queue[reg_PTR_WRITE]->_branch_update_prediction_id = (_param->_have_port_depth)?PORT_READ(in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID):0;
    6564           
    6665            reg_PTR_WRITE = (reg_PTR_WRITE+1)%_param->_size_queue;
     
    9594        if (PORT_READ(in_ICACHE_RSP_VAL) and internal_ICACHE_RSP_ACK)
    9695          {
    97             Tpacket_t ptr = (_param->_have_port_queue_ptr)?PORT_READ(in_ICACHE_RSP_PACKET_ID):0;
     96            Tpacket_t ptr = (_param->_have_port_ifetch_queue_ptr)?PORT_READ(in_ICACHE_RSP_PACKET_ID):0;
    9897           
    9998            for (uint32_t i=0; i<_param->_nb_instruction; i++)
     
    137136          }
    138137
    139 #if DEBUG >= DEBUG_TRACE
    140         log_printf(TRACE,Ifetch_queue,FUNCTION,"Dump ifetch_queue");
    141         log_printf(TRACE,Ifetch_queue,FUNCTION," * reg_PTR_WRITE : %d",reg_PTR_WRITE);
    142         log_printf(TRACE,Ifetch_queue,FUNCTION," * reg_PTR_READ  : %d",reg_PTR_READ );
     138#if defined(DEBUG) and (DEBUG >= DEBUG_TRACE)
     139        log_printf(TRACE,Ifetch_queue,FUNCTION,"  * Dump ifetch_queue");
     140        log_printf(TRACE,Ifetch_queue,FUNCTION,"    * reg_PTR_WRITE : %d",reg_PTR_WRITE);
     141        log_printf(TRACE,Ifetch_queue,FUNCTION,"    * reg_PTR_READ  : %d",reg_PTR_READ );
    143142        for (uint32_t i=0; i<_param->_size_queue; i++)
    144143          {
    145             log_printf(TRACE,Ifetch_queue,FUNCTION," * [%d] %s %.8x %d - %d %d %d", i, toString(_queue [i]->_state).c_str(), _queue [i]->_address,_queue [i]->_inst_ifetch_ptr,_queue [i]->_branch_state,_queue [i]->_branch_update_prediction_id,_queue [i]->_exception);
     144            log_printf(TRACE,Ifetch_queue,FUNCTION,"    * [%d] %s %.8x %d - %d %d %d", i, toString(_queue [i]->_state).c_str(), _queue [i]->_address,_queue [i]->_inst_ifetch_ptr,_queue [i]->_branch_state,_queue [i]->_branch_update_prediction_id,_queue [i]->_exception);
    146145           
    147146            for (uint32_t j=0; j<_param->_nb_instruction; j++)
    148               log_printf(TRACE,Ifetch_queue,FUNCTION,"    * %d %.8x", _queue [i]->_instruction_enable[j], _queue [i]->_instruction[j]);
     147              log_printf(TRACE,Ifetch_queue,FUNCTION,"      * %d %.8x", _queue [i]->_instruction_enable[j], _queue [i]->_instruction[j]);
    149148          }
    150149#endif
    151150
    152151#ifdef STATISTICS
    153         for (uint32_t i=0; i<_param->_size_queue; i++)
    154           switch (_queue[i]->_state)
    155             {
    156             case IFETCH_QUEUE_STATE_EMPTY          : break;
    157             case IFETCH_QUEUE_STATE_WAIT_RSP       : (*_sum_use_queue_wait_rsp      ) ++; break;
    158             case IFETCH_QUEUE_STATE_HAVE_RSP       : (*_sum_use_queue_have_rsp      ) ++; break;
    159             case IFETCH_QUEUE_STATE_ERROR_WAIT_RSP : (*_sum_use_queue_error_wait_rsp) ++; break;
    160             default : break;
    161             }
     152        if (usage_is_set(_usage,USE_STATISTICS))
     153          for (uint32_t i=0; i<_param->_size_queue; i++)
     154            switch (_queue[i]->_state)
     155              {
     156              case IFETCH_QUEUE_STATE_EMPTY          : break;
     157              case IFETCH_QUEUE_STATE_WAIT_RSP       : (*_sum_use_queue_wait_rsp      ) ++; break;
     158              case IFETCH_QUEUE_STATE_HAVE_RSP       : (*_sum_use_queue_have_rsp      ) ++; break;
     159              case IFETCH_QUEUE_STATE_ERROR_WAIT_RSP : (*_sum_use_queue_error_wait_rsp) ++; break;
     160              default : break;
     161              }
    162162#endif
    163163      }
    164 
     164   
    165165#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    166166    end_cycle ();
    167167#endif
    168168
    169     log_printf(FUNC,Ifetch_queue,FUNCTION,"End");
     169    log_end(Ifetch_queue,FUNCTION);
    170170  };
    171171
Note: See TracChangeset for help on using the changeset viewer.