Ignore:
Timestamp:
Jun 17, 2009, 2:11:25 PM (15 years ago)
Author:
rosiere
Message:

1) Add test and configuration
2) Fix Bug
3) Add log file in load store unit
4) Fix Bug in environment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp

    r123 r124  
    4747    Tcontrol_t have_decod_branch [_param->_nb_context];
    4848
     49    Tcontext_t      CONTEXT_EVENT_CONTEXT_ID    = 0;
     50    Tdepth_t        CONTEXT_EVENT_DEPTH         = 0;
     51    Tevent_type_t   CONTEXT_EVENT_TYPE          = 0;
     52    Tcontrol_t      CONTEXT_EVENT_IS_DELAY_SLOT = 0;
     53    Tgeneral_data_t CONTEXT_EVENT_ADDRESS       = 0;
     54    Tgeneral_data_t CONTEXT_EVENT_ADDRESS_EPCR  = 0;
     55
    4956    for (uint32_t i=0; i<_param->_nb_context; i++)
    5057      {
     
    6774        log_printf(TRACE,Decod,FUNCTION,"  * DECOD [%d]",i);   
    6875
     76        bool ifetch_val = false;
    6977        while ((it != select->end())    and  // have a no scanned "slot_in" ?
    70                (decod_val [i] == false) and  // have not a previous selected entry?
     78//             (decod_val [i] == false) and  // have not a previous selected entry?
     79               (ifetch_val    == false) and  // not find ifetch instruction valid
    7180               (context_event_val == false)) // Have not a context_event (spr_access, exception, ...)
    7281          {
     
    8695                log_printf(TRACE,Decod,FUNCTION,"      * decod_ack              : %d",PORT_READ(in_DECOD_ACK [i]));
    8796
     97                ifetch_val        = true;
    8898                decod_val  [i]    = true;                        // fetch_val and decod_enable
    8999                ifetch_ack [x][y] = PORT_READ(in_DECOD_ACK [i]); // fetch_val and decod_enable and decod_ack
     
    189199                    ifetch_ack  [x][y] &= not have_decod_branch [x] and PORT_READ(in_PREDICT_ACK [i]);// predict_ack and fetch_val and decod_enable and decod_ack
    190200               
    191                     if (_param->_have_port_context_id)
    192                     PORT_WRITE(out_PREDICT_CONTEXT_ID                  [i],x);
    193                     PORT_WRITE(out_PREDICT_MATCH_INST_IFETCH_PTR       [i],y == ((_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_IFETCH_INST_IFETCH_PTR [x]):0));
    194                     PORT_WRITE(out_PREDICT_BRANCH_STATE                [i],PORT_READ(in_IFETCH_BRANCH_STATE                [x]));
    195                     if (_param->_have_port_depth)
    196                     PORT_WRITE(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i],PORT_READ(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [x]));
    197                     PORT_WRITE(out_PREDICT_BRANCH_CONDITION            [i],_decod_instruction->_branch_condition  );
    198 //                  PORT_WRITE(out_PREDICT_BRANCH_STACK_WRITE          [i],_decod_instruction->_branch_stack_write);
    199                     PORT_WRITE(out_PREDICT_BRANCH_DIRECTION            [i],_decod_instruction->_branch_direction  );
    200                     PORT_WRITE(out_PREDICT_ADDRESS_SRC                 [i],_decod_instruction->_address           );
    201                     PORT_WRITE(out_PREDICT_ADDRESS_DEST                [i],_decod_instruction->_address_next      );
    202                
    203201                    // can continue is set if direction is "not take" (also, continue is sequential order)
    204202
     
    209207                    log_printf(TRACE,Decod,FUNCTION,"      * predict_can_continue   : %d",PORT_READ(in_PREDICT_CAN_CONTINUE [i]));
    210208                  }
     209
     210                if (_param->_have_port_context_id)
     211                PORT_WRITE(out_PREDICT_CONTEXT_ID                  [i],x);
     212                PORT_WRITE(out_PREDICT_MATCH_INST_IFETCH_PTR       [i],y == ((_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_IFETCH_INST_IFETCH_PTR [x]):0));
     213                PORT_WRITE(out_PREDICT_BRANCH_STATE                [i],PORT_READ(in_IFETCH_BRANCH_STATE                [x]));
     214                if (_param->_have_port_depth)
     215                PORT_WRITE(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i],PORT_READ(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [x]));
     216                PORT_WRITE(out_PREDICT_BRANCH_CONDITION            [i],_decod_instruction->_branch_condition  );
     217//              PORT_WRITE(out_PREDICT_BRANCH_STACK_WRITE          [i],_decod_instruction->_branch_stack_write);
     218                PORT_WRITE(out_PREDICT_BRANCH_DIRECTION            [i],_decod_instruction->_branch_direction  );
     219                PORT_WRITE(out_PREDICT_ADDRESS_SRC                 [i],_decod_instruction->_address           );
     220                PORT_WRITE(out_PREDICT_ADDRESS_DEST                [i],_decod_instruction->_address_next      );
    211221
    212222                Tevent_type_t event_type = _decod_instruction->_event_type;
     
    223233                    ifetch_ack  [x][y] &= PORT_READ(in_CONTEXT_EVENT_ACK);// context_event_ack and fetch_val and decod_enable and decod_ack
    224234
    225                     if (_param->_have_port_context_id)
    226                     PORT_WRITE(out_CONTEXT_EVENT_CONTEXT_ID   , x);
    227                     if (_param->_have_port_depth)
    228                     PORT_WRITE(out_CONTEXT_EVENT_DEPTH        , depth);
    229                     PORT_WRITE(out_CONTEXT_EVENT_TYPE         , _decod_instruction->_event_type    );
    230                     PORT_WRITE(out_CONTEXT_EVENT_IS_DELAY_SLOT, _decod_instruction->_is_delay_slot );
    231                     PORT_WRITE(out_CONTEXT_EVENT_ADDRESS      , _decod_instruction->_address       );
    232                     PORT_WRITE(out_CONTEXT_EVENT_ADDRESS_EPCR , _decod_instruction->_address_next  );
     235                    CONTEXT_EVENT_CONTEXT_ID    = x;
     236                    CONTEXT_EVENT_DEPTH         = depth;
     237                    CONTEXT_EVENT_TYPE          = _decod_instruction->_event_type;
     238                    CONTEXT_EVENT_IS_DELAY_SLOT = _decod_instruction->_is_delay_slot;
     239                    CONTEXT_EVENT_ADDRESS       = _decod_instruction->_address;
     240                    CONTEXT_EVENT_ADDRESS_EPCR  = _decod_instruction->_address_next ;
     241               
    233242                  }
    234243
     
    263272          }
    264273      }
     274
    265275    //-----------------------------------
    266276    // Write output
     
    272282
    273283    PORT_WRITE(out_CONTEXT_EVENT_VAL, context_event_val);
     284    if (_param->_have_port_context_id)
     285    PORT_WRITE(out_CONTEXT_EVENT_CONTEXT_ID   , CONTEXT_EVENT_CONTEXT_ID   );
     286    if (_param->_have_port_depth)
     287    PORT_WRITE(out_CONTEXT_EVENT_DEPTH        , CONTEXT_EVENT_DEPTH        );
     288    PORT_WRITE(out_CONTEXT_EVENT_TYPE         , CONTEXT_EVENT_TYPE         );
     289    PORT_WRITE(out_CONTEXT_EVENT_IS_DELAY_SLOT, CONTEXT_EVENT_IS_DELAY_SLOT);
     290    PORT_WRITE(out_CONTEXT_EVENT_ADDRESS      , CONTEXT_EVENT_ADDRESS      );
     291    PORT_WRITE(out_CONTEXT_EVENT_ADDRESS_EPCR , CONTEXT_EVENT_ADDRESS_EPCR );
    274292
    275293    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
Note: See TracChangeset for help on using the changeset viewer.