Ignore:
Timestamp:
Jun 26, 2009, 10:43:23 AM (15 years ago)
Author:
rosiere
Message:

1) Correct bug in link two signal
2) Fix error detected with valgrind
3) modif distexe script

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Dcache_Access
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Dcache_Access/SelfTest/src/main.cpp

    r88 r128  
    1515  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
    1616  err (_("list_params is :\n"));
     17//err (_(" * nb_thread                                                                 (uint32_t         )\n"));
    1718  err (_(" * nb_execute_loop                                                           (uint32_t         )\n"));
    1819  err (_(" * nb_load_store_unit [nb_execute_loop]                                      (uint32_t         )\n"));
     
    158159     
    159160      test (name,param);
     161
     162      delete param;
    160163    }
    161164  catch (morpheo::ErrorMorpheo & error)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Dcache_Access/SelfTest/src/test.cpp

    r88 r128  
    5454  sc_clock              *  in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);         
    5555  sc_signal<Tcontrol_t> *  in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
     56
     57  sc_signal<Tcontrol_t        >   ** out_DCACHE_REQ_VAL         ;
     58  sc_signal<Tcontrol_t        >   **  in_DCACHE_REQ_ACK         ;
     59  sc_signal<Tcontext_t        >   ** out_DCACHE_REQ_THREAD_ID   ;
     60  sc_signal<Tpacket_t         >   ** out_DCACHE_REQ_PACKET_ID   ;
     61  sc_signal<Tdcache_address_t >   ** out_DCACHE_REQ_ADDRESS     ;
     62  sc_signal<Tdcache_data_t    >   ** out_DCACHE_REQ_WDATA       ;
     63  sc_signal<Tdcache_type_t    >   ** out_DCACHE_REQ_TYPE        ;
     64
     65  sc_signal<Tcontrol_t        >   **  in_DCACHE_RSP_VAL         ;
     66  sc_signal<Tcontrol_t        >   ** out_DCACHE_RSP_ACK         ;
     67  sc_signal<Tcontext_t        >   **  in_DCACHE_RSP_THREAD_ID   ;
     68  sc_signal<Tpacket_t         >   **  in_DCACHE_RSP_PACKET_ID   ;
     69  sc_signal<Tdcache_data_t    >   **  in_DCACHE_RSP_RDATA       ;
     70  sc_signal<Tdcache_error_t   >   **  in_DCACHE_RSP_ERROR       ;
     71
     72  sc_signal<Tcontrol_t        > ****  in_LSQ_REQ_VAL            ;
     73  sc_signal<Tcontrol_t        > **** out_LSQ_REQ_ACK            ;
     74  sc_signal<Tcontext_t        > ****  in_LSQ_REQ_THREAD_ID      ;
     75  sc_signal<Tpacket_t         > ****  in_LSQ_REQ_PACKET_ID      ;
     76  sc_signal<Tdcache_address_t > ****  in_LSQ_REQ_ADDRESS        ;
     77  sc_signal<Tdcache_data_t    > ****  in_LSQ_REQ_WDATA          ;
     78  sc_signal<Tdcache_type_t    > ****  in_LSQ_REQ_TYPE           ;
     79
     80  sc_signal<Tcontrol_t        > **** out_LSQ_RSP_VAL            ;
     81  sc_signal<Tcontrol_t        > ****  in_LSQ_RSP_ACK            ;
     82  sc_signal<Tcontext_t        > **** out_LSQ_RSP_THREAD_ID      ;
     83  sc_signal<Tpacket_t         > **** out_LSQ_RSP_PACKET_ID      ;
     84  sc_signal<Tdcache_data_t    > **** out_LSQ_RSP_RDATA          ;
     85  sc_signal<Tdcache_error_t   > **** out_LSQ_RSP_ERROR          ;
    5686
    5787  ALLOC1_SC_SIGNAL(out_DCACHE_REQ_VAL         ,"out_DCACHE_REQ_VAL      ",Tcontrol_t        ,_param->_nb_dcache_port);
     
    183213  in_NRESET->write(1); 
    184214
     215#ifdef SELFTEST
    185216  LABEL("Loop of Test");
    186217
     
    280311      SC_START(1);
    281312    }
     313#else
     314  SC_START(5);
     315#endif
    282316
    283317  /********************************************************
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Dcache_Access/src/Dcache_Access_genMealy_req.cpp

    r123 r128  
    2020  {
    2121    log_begin(Dcache_Access,FUNCTION);
     22    log_function(Dcache_Access,FUNCTION,_name.c_str());
    2223
    2324    if (PORT_READ(in_NRESET))
     
    5354              {
    5455                uint32_t   num_port       = _param->_table_routing[num_execute_loop][num_load_store_unit][num_cache_access];
     56
     57                log_printf(TRACE,Dcache_Access,FUNCTION,"  * LSQ_REQ [%d][%d][%d] <-> DCACHE_REQ [%d]",num_execute_loop,num_load_store_unit,num_cache_access,num_port);
     58
    5559                Tcontrol_t dcache_req_ack = PORT_READ(in_DCACHE_REQ_ACK [num_port]);
    5660
    57                 log_printf(TRACE,Dcache_Access,FUNCTION,"  * num_port      : %d",num_port);
    58                
    5961#ifdef STATISTICS
    6062                if (dcache_req_ack)
     
    6769                if (not dcache_req_val [num_port])
    6870                  {
     71                    log_printf(TRACE,Dcache_Access,FUNCTION,"  * is valid !!!");
     72
    6973                    dcache_req_val  [num_port] = 1;
    7074                    lsq_req_ack [num_execute_loop][num_load_store_unit][num_cache_access] = dcache_req_ack;
    7175                   
    72                     log_printf(TRACE,Dcache_Access,FUNCTION,"    * kane - dcache");
    73 
    7476                    if (_param->_have_port_dcache_thread_id)
    7577                      {
     
    7981                    log_printf(TRACE,Dcache_Access,FUNCTION,"    * num_thread  : %d",num_thread );
    8082
     83#ifdef DEBUG_TEST
     84                    if (num_thread >= _param->_nb_thread)
     85                      throw ERRORMORPHEO(FUNCTION,toString(_("Invalid thread number : %d\n"),num_thread));
     86#endif
    8187
    8288                    PORT_WRITE(out_DCACHE_REQ_THREAD_ID [num_port], num_thread);
     
    8894                    if (_param->_have_port_dcache_packet_id)
    8995                      {
    90                     Tpacket_t packet_id = (_param->_have_port_lsq_packet_id [num_execute_loop][num_load_store_unit])?PORT_READ(in_LSQ_REQ_PACKET_ID [num_execute_loop][num_load_store_unit][num_cache_access]):0;
    91                     PORT_WRITE(out_DCACHE_REQ_PACKET_ID [num_port], ((num_cache_access    << _param->_shift_num_cache_access   )+
    92                                                                      packet_id));
     96                    Tpacket_t packet_id = ((num_cache_access << _param->_shift_num_cache_access)+
     97                                           ((_param->_have_port_lsq_packet_id [num_execute_loop][num_load_store_unit])?PORT_READ(in_LSQ_REQ_PACKET_ID [num_execute_loop][num_load_store_unit][num_cache_access]):0));
     98
     99                    log_printf(TRACE,Dcache_Access,FUNCTION,"    * packet_id   : %d",packet_id);
     100
     101                    PORT_WRITE(out_DCACHE_REQ_PACKET_ID [num_port], packet_id);
    93102                      }
    94103                    PORT_WRITE(out_DCACHE_REQ_ADDRESS   [num_port], PORT_READ(in_LSQ_REQ_ADDRESS   [num_execute_loop][num_load_store_unit][num_cache_access]));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Dcache_Access/src/Dcache_Access_genMealy_rsp.cpp

    r123 r128  
    2020  {
    2121    log_begin(Dcache_Access,FUNCTION);
     22    log_function(Dcache_Access,FUNCTION,_name.c_str());
    2223
    2324    if (PORT_READ(in_NRESET))
     
    4647            Tpacket_t  lsq_packet_id       =  packet_id                                        & _param->_mask_num_lsq_packet;
    4748
    48 //          log_printf(TRACE,Dcache_Access,FUNCTION,"thread_id          : %d",thread_id);
    49 //          log_printf(TRACE,Dcache_Access,FUNCTION,"execute_loop_id    : %d",execute_loop_id);
    50 //          log_printf(TRACE,Dcache_Access,FUNCTION,"load_store_unit_id : %d",load_store_unit_id);
    51 //          log_printf(TRACE,Dcache_Access,FUNCTION,"cache_access_id    : %d",cache_access_id);
     49            log_printf(TRACE,Dcache_Access,FUNCTION,"  * DCACHE_RSP [%d] <-> LSQ_RSP [%d][%d][%d]",i,execute_loop_id,load_store_unit_id,cache_access_id);
     50
     51            log_printf(TRACE,Dcache_Access,FUNCTION,"    * thread_id            : %d",thread_id);
     52            log_printf(TRACE,Dcache_Access,FUNCTION,"      * execute_loop_id    : %d",execute_loop_id);
     53            log_printf(TRACE,Dcache_Access,FUNCTION,"      * load_store_unit_id : %d",load_store_unit_id);
     54            log_printf(TRACE,Dcache_Access,FUNCTION,"      * context_id         : %d",context_id);
     55            log_printf(TRACE,Dcache_Access,FUNCTION,"    * packet_id            : %d",thread_id);
     56            log_printf(TRACE,Dcache_Access,FUNCTION,"      * cache_access_id    : %d",cache_access_id);
     57            log_printf(TRACE,Dcache_Access,FUNCTION,"      * lsq_packet_id      : %d",lsq_packet_id);
    5258           
    5359#ifdef DEBUG_TEST
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Dcache_Access/src/Parameters.cpp

    r88 r128  
    5555    _translate_load_store_unit_to_thread = translate_load_store_unit_to_thread;
    5656
     57//     log_printf(TRACE,Dcache_Access,FUNCTION,"  * table_routing");
     58//     for (uint32_t i=0; i<_nb_execute_loop; i++)
     59//       for (uint32_t j=0; j<_nb_load_store_unit [i]; ++j)
     60//      for (uint32_t k=0; k<_nb_cache_access [i][j]; ++k)
     61//           log_printf(TRACE,Dcache_Access,FUNCTION,"    [%d][%d][%d] %d",i,j,k,_table_routing [i][j][k]);
     62
     63//     log_printf(TRACE,Dcache_Access,FUNCTION,"  * translate_load_store_unit_to_thread");
     64//     for (uint32_t i=0; i<_nb_execute_loop; i++)
     65//       for (uint32_t j=0; j<_nb_load_store_unit [i]; j++)
     66//         for (uint32_t k=0; k<_nb_context[i]; k++)
     67//           log_printf(TRACE,Dcache_Access,FUNCTION,"    [%d][%d][%d] %d",i,j,k,_translate_load_store_unit_to_thread [i][j][k]);
     68
    5769    test();
    5870
     
    93105    _translate_thread_to_context         = new uint32_t [nb_thread];
    94106
     107    log_printf(TRACE,Dcache_Access,FUNCTION,"  * translate_load_store_unit_to_thread");
     108
    95109    for (uint32_t i=0; i<_nb_execute_loop; ++i)
    96110      for (uint32_t j=0; j<_nb_load_store_unit [i]; ++j)
     
    99113            uint32_t num_thread = _translate_load_store_unit_to_thread [i][j][k];
    100114           
     115            log_printf(TRACE,Dcache_Access,FUNCTION,"    [%d][%d][%d] %d",i,j,k,_translate_load_store_unit_to_thread [i][j][k]);
     116
     117            if (num_thread < _nb_thread)
     118              {
    101119            _translate_thread_to_execute_loop    [num_thread] = i;
    102120            _translate_thread_to_load_store_unit [num_thread] = j;
    103121            _translate_thread_to_context         [num_thread] = k;
     122              }
     123            else
     124              {
     125            _translate_thread_to_execute_loop    [num_thread] = _nb_execute_loop;
     126            _translate_thread_to_load_store_unit [num_thread] = _nb_load_store_unit [i];
     127            _translate_thread_to_context         [num_thread] = _nb_context [i];
     128              }
    104129          }
    105130
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Dcache_Access/src/Parameters_msg_error.cpp

    r88 r128  
    4949          {
    5050            uint32_t num_thread = _translate_load_store_unit_to_thread [i][j][k];
    51             if (num_thread >= _nb_thread)
    52               test.error(toString(_("Context [%d][%d][%d] is linked with an invalid thread id.\n"),i,j,k));
    53             else
    54               if (thread_link [num_thread] == true)
    55                 test.error(toString(_("Context [%d][%d][%d] is linked with an already used thread id.\n"),i,j,k));
    56               else
    57                 thread_link [num_thread] = true;
     51
     52            if (num_thread != _nb_thread)
     53              thread_link [num_thread] = true;
     54
     55//             if (num_thread >= _nb_thread)
     56//               test.error(toString(_("Context [%d][%d][%d] is linked with an invalid thread id.\n"),i,j,k));
     57//             else
     58//               if (thread_link [num_thread] == true)
     59//                 test.error(toString(_("Context [%d][%d][%d] is linked with an already used thread id.\n"),i,j,k));
     60//               else
     61//                 thread_link [num_thread] = true;
    5862          }
    5963
Note: See TracChangeset for help on using the changeset viewer.