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_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_genMealy.cpp

    r81 r88  
    2222  void Rename_select::genMealy (void)
    2323  {
    24     log_printf(FUNC,Rename_select,FUNCTION,"Begin");
     24    log_begin(Rename_select,FUNCTION);
     25    log_function(Rename_select,FUNCTION,_name.c_str());
    2526
    26     Tcontrol_t ack [_param->_nb_front_end][_param->_max_nb_inst_decod];
     27    Tcontrol_t val                  [_param->_nb_inst_rename];
     28    Tcontrol_t ack                  [_param->_nb_front_end][_param->_max_nb_inst_decod];
     29    Tcontrol_t previous_transaction [_param->_nb_front_end];
     30
     31    for (uint32_t i=0; i<_param->_nb_inst_rename; ++i)
     32      val [i] = false;
    2733    for (uint32_t i=0; i<_param->_nb_front_end; i++)
    28       for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
    29         ack [i][j] = false;
    30    
    31     std::list<select_t>::iterator it=select.begin();
     34      {
     35        previous_transaction [i] = true;
     36        for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
     37          ack [i][j] = false;
     38      }
     39
     40    std::list<generic::priority::select_t> * select = _priority->select();
     41    std::list<generic::priority::select_t>::iterator it=select->begin();
    3242
    3343    for (uint32_t i=0; i<_param->_nb_inst_rename; i++)
    3444      {
    35         Tcontrol_t val = false;
     45        log_printf(TRACE,Rename_select,FUNCTION,"  * inst_rename [%d]",i);
    3646
    37         while ((it != select.end()) and (val == false))
     47        // Scan all instruction until find
     48        while ((it != select->end()) and (val [i] == false))
    3849          {
    39             Tcontext_t x = it->_front_end ;
    40             uint32_t   y = it->_inst_decod;
     50            Tcontext_t x = it->grp;
     51            uint32_t   y = it->elt;
    4152
    42             // Test if this instruction is valid
    43             if (PORT_READ(in_RENAME_IN_VAL[x][y]) == 1)
     53            log_printf(TRACE,Rename_select,FUNCTION,"    * front_end[%d].inst_decod[%d]",x,y);
     54            log_printf(TRACE,Rename_select,FUNCTION,"      * rename_in_val        : %d",PORT_READ(in_RENAME_IN_VAL[x][y]));
     55            log_printf(TRACE,Rename_select,FUNCTION,"      * previous_transaction : %d",previous_transaction[x]);
     56
     57            // Test if this instruction is valid and if all previous instruction of this front end is an valid transaction
     58            if (previous_transaction [x] and
     59                PORT_READ(in_RENAME_IN_VAL[x][y]))
    4460              {
    4561                // Find !!!
    46                 val        = true;
     62                val [i]    = true;
    4763                ack [x][y] = PORT_READ(in_RENAME_OUT_ACK [i]);
     64
     65                log_printf(TRACE,Rename_select,FUNCTION,"      * rename_out_ack       : %d",PORT_READ(in_RENAME_OUT_ACK[i]));
    4866
    4967                if (_param->_have_port_front_end_id)
     
    5573                PORT_WRITE(out_RENAME_OUT_TYPE         [i],PORT_READ(in_RENAME_IN_TYPE          [x][y]));
    5674                PORT_WRITE(out_RENAME_OUT_OPERATION    [i],PORT_READ(in_RENAME_IN_OPERATION     [x][y]));
     75                PORT_WRITE(out_RENAME_OUT_NO_EXECUTE   [i],PORT_READ(in_RENAME_IN_NO_EXECUTE    [x][y]));
     76                PORT_WRITE(out_RENAME_OUT_IS_DELAY_SLOT[i],PORT_READ(in_RENAME_IN_IS_DELAY_SLOT [x][y]));
    5777                PORT_WRITE(out_RENAME_OUT_ADDRESS      [i],PORT_READ(in_RENAME_IN_ADDRESS       [x][y]));
    5878                PORT_WRITE(out_RENAME_OUT_HAS_IMMEDIAT [i],PORT_READ(in_RENAME_IN_HAS_IMMEDIAT  [x][y]));
     
    6989                PORT_WRITE(out_RENAME_OUT_NUM_REG_RE   [i],PORT_READ(in_RENAME_IN_NUM_REG_RE    [x][y]));
    7090                PORT_WRITE(out_RENAME_OUT_EXCEPTION_USE[i],PORT_READ(in_RENAME_IN_EXCEPTION_USE [x][y]));
     91                PORT_WRITE(out_RENAME_OUT_EXCEPTION    [i],PORT_READ(in_RENAME_IN_EXCEPTION     [x][y]));
    7192              }
     93
     94            // ack = 1 if previous_transaction == true and rename_in_val == true and rename_out == true
     95            previous_transaction [x] = ack [x][y];
    7296
    7397            it ++;
    7498          }
    7599
    76         PORT_WRITE(out_RENAME_OUT_VAL [i], val);
    77100      }
     101
     102    for (uint32_t i=0; i<_param->_nb_inst_rename; ++i)
     103      PORT_WRITE(out_RENAME_OUT_VAL [i], val [i]);
    78104
    79105    for (uint32_t i=0; i<_param->_nb_front_end; i++)
     
    81107        PORT_WRITE(out_RENAME_IN_ACK [i][j], ack [i][j]);
    82108
    83     log_printf(FUNC,Rename_select,FUNCTION,"End");
     109    log_end(Rename_select,FUNCTION);
    84110  };
    85111
Note: See TracChangeset for help on using the changeset viewer.