Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (16 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src
Files:
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit.cpp

    r81 r88  
    4242    allocation ();
    4343
     44#if DEBUG_Functionnal_unit == true
     45    log_printf(INFO,Functionnal_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
     46
     47    std::cout << *param << std::endl;
     48#endif   
     49
    4450#ifdef STATISTICS
    45     if (_usage & USE_STATISTICS)
     51    if (usage_is_set(_usage,USE_STATISTICS))
    4652      {
    4753        log_printf(INFO,Functionnal_unit,FUNCTION,"Allocation of statistics");
     
    5258
    5359#ifdef VHDL
    54     if (_usage & USE_VHDL)
     60    if (usage_is_set(_usage,USE_VHDL))
    5561      {
    5662        // generate the vhdl
     
    6268
    6369#ifdef SYSTEMC
    64     if (_usage & USE_SYSTEMC)
     70    if (usage_is_set(_usage,USE_SYSTEMC))
    6571      {
    6672        log_printf(INFO,Functionnal_unit,FUNCTION,"Method - transition");
     
    8490# endif   
    8591
    86         log_printf(INFO,Functionnal_unit,FUNCTION,"Method - genMealy");
    87 
    88         SC_METHOD (genMealy);
    89         dont_initialize ();
    90         sensitive << (*(in_CLOCK)).neg()
    91                   << (*(in_EXECUTE_OUT_ACK));
    92        
    93 # ifdef SYSTEMCASS_SPECIFIC
    94         // List dependency information
    95         (*(out_EXECUTE_IN_ACK)) (*(in_EXECUTE_OUT_ACK));
    96 # endif   
    97        
    9892#endif
    9993      }
     
    108102
    109103#ifdef STATISTICS
    110     if (_usage & USE_STATISTICS)
     104    if (usage_is_set(_usage,USE_STATISTICS))
    111105      {
    112106        log_printf(INFO,Functionnal_unit,FUNCTION,"Generate Statistics file");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_allocation.cpp

    r81 r88  
    6767      if (_param->_have_port_ooo_engine_id)
    6868       in_EXECUTE_IN_OOO_ENGINE_ID = interface->set_signal_in <Tcontext_t        > ("ooo_engine_id", _param->_size_ooo_engine_id);
    69       if (_param->_have_port_packet_id)
    70        in_EXECUTE_IN_PACKET_ID     = interface->set_signal_in <Tpacket_t         > ("packet_id"    , _param->_size_packet_id    );
     69      if (_param->_have_port_rob_ptr)
     70       in_EXECUTE_IN_PACKET_ID     = interface->set_signal_in <Tpacket_t         > ("packet_id"    , _param->_size_rob_ptr    );
    7171       in_EXECUTE_IN_OPERATION     = interface->set_signal_in <Toperation_t      > ("operation"    , _param->_size_operation    );
    7272       in_EXECUTE_IN_TYPE          = interface->set_signal_in <Ttype_t           > ("type"         , _param->_size_type         );
    73        in_EXECUTE_IN_STORE_QUEUE_PTR_WRITE = interface->set_signal_in <Tlsq_ptr_t> ("store_queue_ptr_write",log2(_param->_size_store_queue));
     73       in_EXECUTE_IN_STORE_QUEUE_PTR_WRITE = interface->set_signal_in <Tlsq_ptr_t> ("store_queue_ptr_write",_param->_size_store_queue_ptr);
    7474       if (_param->_have_port_load_queue_ptr)
    75        in_EXECUTE_IN_LOAD_QUEUE_PTR_WRITE  = interface->set_signal_in <Tlsq_ptr_t> ("load_queue_ptr_write" ,log2(_param->_size_load_queue));
     75       in_EXECUTE_IN_LOAD_QUEUE_PTR_WRITE  = interface->set_signal_in <Tlsq_ptr_t> ("load_queue_ptr_write" ,_param->_size_load_queue_ptr);
    7676       in_EXECUTE_IN_HAS_IMMEDIAT  = interface->set_signal_in <Tcontrol_t        > ("has_immediat" , 1);
    7777       in_EXECUTE_IN_IMMEDIAT      = interface->set_signal_in <Tgeneral_data_t   > ("immediat"     , _param->_size_general_data);
     
    102102       if (_param->_have_port_ooo_engine_id)
    103103       out_EXECUTE_OUT_OOO_ENGINE_ID  = interface->set_signal_out<Tcontext_t        > ("ooo_engine_id",_param->_size_ooo_engine_id);
    104        if (_param->_have_port_packet_id)
    105        out_EXECUTE_OUT_PACKET_ID      = interface->set_signal_out<Tpacket_t         > ("packet_id"    ,_param->_size_packet_id    );
     104       if (_param->_have_port_rob_ptr)
     105       out_EXECUTE_OUT_PACKET_ID      = interface->set_signal_out<Tpacket_t         > ("packet_id"    ,_param->_size_rob_ptr    );
    106106     //out_EXECUTE_OUT_OPERATION      = interface->set_signal_out<Toperation_t      > ("operation"    ,_param->_size_operation    );
    107107       out_EXECUTE_OUT_TYPE           = interface->set_signal_out<Ttype_t           > ("type"         ,_param->_size_type         );
     
    117117     }
    118118
    119     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    120      _execute_operation = new execute_operation_t;
    121      _execute_param     = new execute_param_t(_param->_size_general_data,
    122                                               _param->_timing);
     119     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     120     if (usage_is_set(_usage,USE_SYSTEMC))
     121       {
     122     _execute_operation_in  = new execute_operation_t;
     123     _execute_operation_out = new execute_operation_t;
     124     _execute_param         = new execute_param_t(_param->_size_general_data,
     125                                                  _param->_timing);
    123126
    124127     _execute_register = new execute_register_t *** [_param->_nb_context];
     
    134137             for (uint32_t k=0; k<_param->_nb_ooo_engine; k++)
    135138               {
    136                  uint32_t num_thread = get_num_thread(i,_param->_size_context_id,
    137                                                       j,_param->_size_front_end_id,
    138                                                       k,_param->_size_ooo_engine_id);
     139//               uint32_t num_thread = get_num_thread(i,_param->_size_context_id,
     140//                                                    j,_param->_size_front_end_id,
     141//                                                    k,_param->_size_ooo_engine_id);
    139142
    140143                 _execute_register [i][j][k] = new execute_register_t;
     
    144147
    145148                 for (uint32_t x=GROUP_CUSTOM_1; x<GROUP_CUSTOM_8; x++)
    146                    if ((_param->_get_custom_information(num_thread))._get_valid_group(x) == true)
     149                   if ((_param->_get_custom_information())._get_valid_group(x) == true)
    147150                     {
    148                        uint32_t nb_reg = (_param->_get_custom_information(num_thread))._get_nb_register(x);
     151                       uint32_t nb_reg = (_param->_get_custom_information())._get_nb_register(x);
    149152                       _execute_register[i][j][k]->implement_group(x,nb_reg);
    150153
    151154                       for (uint32_t y=0; y<nb_reg; y++)
    152                          _execute_register[i][j][k]->_spr_access_mode->change_mode(x,y,(_param->_get_custom_information(num_thread))._get_access_mode(x,y));
     155                         _execute_register[i][j][k]->_spr_access_mode->change_mode(x,y,(_param->_get_custom_information())._get_access_mode(x,y));
    153156                     }
    154157               }
     
    211214     if (_param->_timing[TYPE_TEST   ][OPERATION_TEST_L_SFNE       ]._latence > 0)
    212215       _function_execute[TYPE_TEST   ][OPERATION_TEST_L_SFNE       ] = &(operation_l_sfne    );
    213 //   if (_param->_timing[TYPE_MUL_DIV][OPERATION_MUL_DIV_L_MUL     ]._latence > 0)
    214 //     _function_execute[TYPE_MUL_DIV][OPERATION_MUL_DIV_L_MUL     ] = &(operation_l_mul     );
    215 //   if (_param->_timing[TYPE_MUL_DIV][OPERATION_MUL_DIV_L_MULU    ]._latence > 0)
    216 //     _function_execute[TYPE_MUL_DIV][OPERATION_MUL_DIV_L_MULU    ] = &(operation_l_mulu    );
    217 //   if (_param->_timing[TYPE_MUL_DIV][OPERATION_MUL_DIV_L_DIV     ]._latence > 0)
    218 //     _function_execute[TYPE_MUL_DIV][OPERATION_MUL_DIV_L_DIV     ] = &(operation_l_div     );
    219 //   if (_param->_timing[TYPE_MUL_DIV][OPERATION_MUL_DIV_L_DIVU    ]._latence > 0)
    220 //     _function_execute[TYPE_MUL_DIV][OPERATION_MUL_DIV_L_DIVU    ] = &(operation_l_divu    );
     216//   if (_param->_timing[TYPE_MUL    ][OPERATION_MUL_L_MUL         ]._latence > 0)
     217//     _function_execute[TYPE_MUL    ][OPERATION_MUL_L_MUL         ] = &(operation_l_mul     );
     218//   if (_param->_timing[TYPE_MUL    ][OPERATION_MUL_L_MULU        ]._latence > 0)
     219//     _function_execute[TYPE_DIV    ][OPERATION_MUL_L_MULU        ] = &(operation_l_mulu    );
     220//   if (_param->_timing[TYPE_DIV    ][OPERATION_DIV_L_DIV         ]._latence > 0)
     221//     _function_execute[TYPE_DIV    ][OPERATION_DIV_L_DIV         ] = &(operation_l_div     );
     222//   if (_param->_timing[TYPE_DIV    ][OPERATION_DIV_L_DIVU        ]._latence > 0)
     223//     _function_execute[TYPE_DIV    ][OPERATION_DIV_L_DIVU        ] = &(operation_l_divu    );
    221224     if (_param->_timing[TYPE_EXTEND ][OPERATION_EXTEND_L_EXTEND_S ]._latence > 0)
    222225       _function_execute[TYPE_EXTEND ][OPERATION_EXTEND_L_EXTEND_S ] = &(operation_l_extend_s);
     
    243246     if (_param->_timing[TYPE_BRANCH ][OPERATION_BRANCH_L_JALR     ]._latence > 0)
    244247       _function_execute[TYPE_BRANCH ][OPERATION_BRANCH_L_JALR     ] = &(operation_l_jalr    );
    245 
    246 
    247 
    248 #ifdef POSITION
    249     _component->generate_file();
     248       }
     249
     250#ifdef POSITION
     251     if (usage_is_set(_usage,USE_POSITION))
     252       _component->generate_file();
    250253#endif
    251254
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_deallocation.cpp

    r81 r88  
    2424    log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
    2525
    26     if (_usage & USE_SYSTEMC)
     26    if (usage_is_set(_usage,USE_SYSTEMC))
    2727      {
    2828        delete    in_CLOCK ;
     
    3737        if (_param->_have_port_ooo_engine_id)
    3838        delete  in_EXECUTE_IN_OOO_ENGINE_ID ;
    39         if (_param->_have_port_packet_id)
     39        if (_param->_have_port_rob_ptr)
    4040        delete  in_EXECUTE_IN_PACKET_ID     ;
    4141        delete  in_EXECUTE_IN_OPERATION     ;
     
    6262        if (_param->_have_port_ooo_engine_id)
    6363        delete out_EXECUTE_OUT_OOO_ENGINE_ID  ;
    64         if (_param->_have_port_packet_id)
     64        if (_param->_have_port_rob_ptr)
    6565        delete out_EXECUTE_OUT_PACKET_ID      ;
    6666      //delete out_EXECUTE_OUT_OPERATION      ;
     
    7575        delete out_EXECUTE_OUT_NO_SEQUENCE    ;
    7676        delete out_EXECUTE_OUT_ADDRESS        ;
     77
     78        // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     79       
     80        delete [] _execute_register;
     81        delete    _execute_param;
     82        delete    _execute_operation_in;
     83        delete    _execute_operation_out;
     84        delete [] _function_execute;
    7785      }
    78     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    79 
    80     delete [] _execute_register;
    81     delete    _execute_param;
    82     delete    _execute_operation;
    83     delete [] _function_execute;
    8486
    8587    delete    _component;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_end_cycle.cpp

    r81 r88  
    2626
    2727#ifdef STATISTICS
    28     _stat->end_cycle();
     28    if (usage_is_set(_usage,USE_STATISTICS))
     29      _stat->end_cycle();
    2930#endif   
    3031
     
    3233    // Evaluation before read the ouput signal
    3334//  sc_start(0);
    34     _interfaces->testbench();
     35    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
     36      _interfaces->testbench();
    3537#endif
    3638
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_genMoore.cpp

    r81 r88  
    2323  void Functionnal_unit::genMoore (void)
    2424  {
    25     log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
     25    log_begin(Functionnal_unit,FUNCTION);
     26    log_function(Functionnal_unit,FUNCTION,_name.c_str());
    2627
    27     internal_EXECUTE_OUT_VAL = reg_BUSY and (_execute_operation->_timing._latence == 0);
     28    {
     29      internal_EXECUTE_IN_ACK = not reg_BUSY_IN;
     30     
     31      PORT_WRITE(out_EXECUTE_IN_ACK           , internal_EXECUTE_IN_ACK);
     32    }
    2833
    29     PORT_WRITE(out_EXECUTE_OUT_VAL          , internal_EXECUTE_OUT_VAL);
    30     if (_param->_have_port_context_id)
    31     PORT_WRITE(out_EXECUTE_OUT_CONTEXT_ID   ,_execute_operation->_context_id   );
    32     if (_param->_have_port_front_end_id)
    33     PORT_WRITE(out_EXECUTE_OUT_FRONT_END_ID ,_execute_operation->_front_end_id );
    34     if (_param->_have_port_ooo_engine_id)
    35     PORT_WRITE(out_EXECUTE_OUT_OOO_ENGINE_ID,_execute_operation->_ooo_engine_id);
    36     if (_param->_have_port_packet_id)
    37     PORT_WRITE(out_EXECUTE_OUT_PACKET_ID    ,_execute_operation->_packet_id    );
    38   //PORT_WRITE(out_EXECUTE_OUT_OPERATION    ,_execute_operation->_operation    );
    39     PORT_WRITE(out_EXECUTE_OUT_TYPE         ,_execute_operation->_type         );
    40     PORT_WRITE(out_EXECUTE_OUT_WRITE_RD     ,_execute_operation->_write_rd     );
    41     PORT_WRITE(out_EXECUTE_OUT_NUM_REG_RD   ,_execute_operation->_num_reg_rd   );
    42     PORT_WRITE(out_EXECUTE_OUT_DATA_RD      ,_execute_operation->_data_rd      );
    43     PORT_WRITE(out_EXECUTE_OUT_WRITE_RE     ,_execute_operation->_write_re     );
    44     PORT_WRITE(out_EXECUTE_OUT_NUM_REG_RE   ,_execute_operation->_num_reg_re   );
    45     PORT_WRITE(out_EXECUTE_OUT_DATA_RE      ,_execute_operation->_data_re      );
    46     PORT_WRITE(out_EXECUTE_OUT_EXCEPTION    ,_execute_operation->_exception    );
    47     PORT_WRITE(out_EXECUTE_OUT_NO_SEQUENCE  ,_execute_operation->_no_sequence  );
    48     PORT_WRITE(out_EXECUTE_OUT_ADDRESS      ,_execute_operation->_address      );
     34    {
     35      internal_EXECUTE_OUT_VAL = reg_BUSY_OUT and (_execute_operation_out->_timing._latence == 0);
     36     
     37      PORT_WRITE(out_EXECUTE_OUT_VAL          , internal_EXECUTE_OUT_VAL);
     38      if (_param->_have_port_context_id)
     39      PORT_WRITE(out_EXECUTE_OUT_CONTEXT_ID   ,_execute_operation_out->_context_id   );
     40      if (_param->_have_port_front_end_id)
     41      PORT_WRITE(out_EXECUTE_OUT_FRONT_END_ID ,_execute_operation_out->_front_end_id );
     42      if (_param->_have_port_ooo_engine_id)
     43      PORT_WRITE(out_EXECUTE_OUT_OOO_ENGINE_ID,_execute_operation_out->_ooo_engine_id);
     44      if (_param->_have_port_rob_ptr)
     45      PORT_WRITE(out_EXECUTE_OUT_PACKET_ID    ,_execute_operation_out->_packet_id    );
     46  //  PORT_WRITE(out_EXECUTE_OUT_OPERATION    ,_execute_operation_out->_operation    );
     47      PORT_WRITE(out_EXECUTE_OUT_TYPE         ,_execute_operation_out->_type         );
     48      PORT_WRITE(out_EXECUTE_OUT_WRITE_RD     ,_execute_operation_out->_write_rd     );
     49      PORT_WRITE(out_EXECUTE_OUT_NUM_REG_RD   ,_execute_operation_out->_num_reg_rd   );
     50      PORT_WRITE(out_EXECUTE_OUT_DATA_RD      ,_execute_operation_out->_data_rd      );
     51      PORT_WRITE(out_EXECUTE_OUT_WRITE_RE     ,_execute_operation_out->_write_re     );
     52      PORT_WRITE(out_EXECUTE_OUT_NUM_REG_RE   ,_execute_operation_out->_num_reg_re   );
     53      PORT_WRITE(out_EXECUTE_OUT_DATA_RE      ,_execute_operation_out->_data_re      );
     54      PORT_WRITE(out_EXECUTE_OUT_EXCEPTION    ,_execute_operation_out->_exception    );
     55      PORT_WRITE(out_EXECUTE_OUT_NO_SEQUENCE  ,_execute_operation_out->_no_sequence  );
     56      PORT_WRITE(out_EXECUTE_OUT_ADDRESS      ,_execute_operation_out->_address      );
     57    }
    4958
    50     log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
     59    log_end(Functionnal_unit,FUNCTION);
    5160  };
    5261
     
    5766}; // end namespace multi_execute_loop
    5867}; // end namespace core
    59 
    6068}; // end namespace behavioural
    6169}; // end namespace morpheo             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_transition.cpp

    r81 r88  
    2323  void Functionnal_unit::transition (void)
    2424  {
    25     log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
     25    log_begin(Functionnal_unit,FUNCTION);
     26    log_function(Functionnal_unit,FUNCTION,_name.c_str());
    2627
    2728    if (PORT_READ(in_NRESET) == 0)
    2829      {
    29         reg_BUSY = false;
     30        reg_BUSY_IN  = false;
     31        reg_BUSY_OUT = false;
    3032       
    3133        for (uint32_t i=0; i<_param->_nb_context; i++)
     
    3335            for (uint32_t k=0; k<_param->_nb_ooo_engine; k++)
    3436              {
    35                 uint32_t num_thread = get_num_thread(i,_param->_size_context_id,
    36                                                      j,_param->_size_front_end_id,
    37                                                      k,_param->_size_ooo_engine_id);
     37//              uint32_t num_thread = get_num_thread(i,_param->_size_context_id,
     38//                                                   j,_param->_size_front_end_id,
     39//                                                   k,_param->_size_ooo_engine_id);
    3840               
    3941                for (uint32_t x=GROUP_CUSTOM_1; x<GROUP_CUSTOM_8; x++)
    4042                  {
    41                     function_execute_end_cycle_t * fct = (_param->_get_custom_information(num_thread)._get_custom_execute_reset(x));
     43                    function_execute_end_cycle_t * fct = (_param->_get_custom_information()._get_custom_execute_reset(x));
    4244                   
    4345                    if (fct != NULL)
     
    5153        if (internal_EXECUTE_OUT_VAL and PORT_READ(in_EXECUTE_OUT_ACK))
    5254          {
     55            log_printf(TRACE,Functionnal_unit,FUNCTION,"  * EXECUTE_OUT : Transaction Accepted");
    5356            // transaction
    54             reg_BUSY = false;
     57            reg_BUSY_OUT = false;
    5558          }
    5659       
     
    6063        if (PORT_READ(in_EXECUTE_IN_VAL) and internal_EXECUTE_IN_ACK)
    6164          {
    62             reg_BUSY = true;
     65            log_printf(TRACE,Functionnal_unit,FUNCTION,"  * EXECUTE_IN : Transaction Accepted");
     66
     67            reg_BUSY_IN = true;
    6368
    6469            Tcontext_t   context_id    = (_param->_have_port_context_id   )?PORT_READ(in_EXECUTE_IN_CONTEXT_ID   ):0;
    6570            Tcontext_t   front_end_id  = (_param->_have_port_front_end_id )?PORT_READ(in_EXECUTE_IN_FRONT_END_ID ):0;
    6671            Tcontext_t   ooo_engine_id = (_param->_have_port_ooo_engine_id)?PORT_READ(in_EXECUTE_IN_OOO_ENGINE_ID):0;
    67             Tcontext_t   packet_id     = (_param->_have_port_packet_id    )?PORT_READ(in_EXECUTE_IN_PACKET_ID    ):0;
     72            Tcontext_t   packet_id     = (_param->_have_port_rob_ptr      )?PORT_READ(in_EXECUTE_IN_PACKET_ID    ):0;
    6873            Toperation_t operation     = PORT_READ(in_EXECUTE_IN_OPERATION);
    6974            Ttype_t      type          = PORT_READ(in_EXECUTE_IN_TYPE);
    7075           
    71             _execute_operation->_context_id    = context_id   ;
    72             _execute_operation->_front_end_id  = front_end_id ;
    73             _execute_operation->_ooo_engine_id = ooo_engine_id;
    74             _execute_operation->_packet_id     = packet_id    ;
    75             _execute_operation->_operation     = operation    ;
    76             _execute_operation->_type          = type         ;
    77             _execute_operation->_has_immediat  = PORT_READ(in_EXECUTE_IN_HAS_IMMEDIAT);
    78             _execute_operation->_immediat      = PORT_READ(in_EXECUTE_IN_IMMEDIAT    );
    79             _execute_operation->_data_ra       = PORT_READ(in_EXECUTE_IN_DATA_RA     );
    80             _execute_operation->_data_rb       = PORT_READ(in_EXECUTE_IN_DATA_RB     );
    81             _execute_operation->_data_rc       = PORT_READ(in_EXECUTE_IN_DATA_RC     );
    82             _execute_operation->_write_rd      = PORT_READ(in_EXECUTE_IN_WRITE_RD    );
    83             _execute_operation->_num_reg_rd    = PORT_READ(in_EXECUTE_IN_NUM_REG_RD  );
    84             _execute_operation->_write_re      = PORT_READ(in_EXECUTE_IN_WRITE_RE    );
    85             _execute_operation->_num_reg_re    = PORT_READ(in_EXECUTE_IN_NUM_REG_RE  );
    86 
     76            _execute_operation_in->_context_id    = context_id   ;
     77            _execute_operation_in->_front_end_id  = front_end_id ;
     78            _execute_operation_in->_ooo_engine_id = ooo_engine_id;
     79            _execute_operation_in->_packet_id     = packet_id    ;
     80            _execute_operation_in->_operation     = operation    ;
     81            _execute_operation_in->_type          = type         ;
     82            _execute_operation_in->_has_immediat  = PORT_READ(in_EXECUTE_IN_HAS_IMMEDIAT);
     83            _execute_operation_in->_immediat      = PORT_READ(in_EXECUTE_IN_IMMEDIAT    );
     84            _execute_operation_in->_data_ra       = PORT_READ(in_EXECUTE_IN_DATA_RA     );
     85            _execute_operation_in->_data_rb       = PORT_READ(in_EXECUTE_IN_DATA_RB     );
     86            _execute_operation_in->_data_rc       = PORT_READ(in_EXECUTE_IN_DATA_RC     );
     87            _execute_operation_in->_write_rd      = PORT_READ(in_EXECUTE_IN_WRITE_RD    );
     88            _execute_operation_in->_num_reg_rd    = PORT_READ(in_EXECUTE_IN_NUM_REG_RD  );
     89            _execute_operation_in->_write_re      = PORT_READ(in_EXECUTE_IN_WRITE_RE    );
     90            _execute_operation_in->_num_reg_re    = PORT_READ(in_EXECUTE_IN_NUM_REG_RE  );
     91
     92            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * context_id    : %d",_execute_operation_in->_context_id   );
     93            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * front_end_id  : %d",_execute_operation_in->_front_end_id );
     94            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * ooo_engine_id : %d",_execute_operation_in->_ooo_engine_id);
     95            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * packet_id     : %d",_execute_operation_in->_packet_id    );
     96            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * operation     : %d",_execute_operation_in->_operation    );
     97            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * type          : %s",toString_type(_execute_operation_in->_type).c_str());
     98            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * has_immediat  : %d",_execute_operation_in->_has_immediat );
     99            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * immediat      : %.8x",_execute_operation_in->_immediat     );
     100            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * data_ra       : %.8x",_execute_operation_in->_data_ra      );
     101            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * data_rb       : %.8x",_execute_operation_in->_data_rb      );
     102            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * data_rc       : %.8x",_execute_operation_in->_data_rc      );
     103            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * write_rd      : %d"  ,_execute_operation_in->_write_rd     );
     104            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * num_reg_rd    : %d"  ,_execute_operation_in->_num_reg_rd   );
     105            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * write_re      : %d"  ,_execute_operation_in->_write_re     );
     106            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * num_reg_re    : %d"  ,_execute_operation_in->_num_reg_re   );
     107           
    87108#ifdef DEBUG_TEST
    88109            if (type >= _param->_nb_type)
     
    98119            if (type == TYPE_CUSTOM)
    99120              {
    100                 uint32_t num_thread = get_num_thread(context_id   ,_param->_size_context_id,
    101                                                      front_end_id ,_param->_size_front_end_id,
    102                                                      ooo_engine_id,_param->_size_ooo_engine_id);
    103 
    104                 (*(_param->_get_custom_information(num_thread)._get_custom_execute_genMoore(operation))) (_execute_operation, execute_register, _execute_param);
     121//              uint32_t num_thread = get_num_thread(context_id   ,_param->_size_context_id,
     122//                                                   front_end_id ,_param->_size_front_end_id,
     123//                                                   ooo_engine_id,_param->_size_ooo_engine_id);
     124
     125                (*(_param->_get_custom_information()._get_custom_execute_genMoore(operation))) (_execute_operation_in, execute_register, _execute_param);
    105126              }
    106127            else
    107               (*(_function_execute[type][operation])) (_execute_operation, execute_register, _execute_param);
    108 
     128              (*(_function_execute[type][operation])) (_execute_operation_in, execute_register, _execute_param);
     129
     130
     131            log_printf(TRACE,Functionnal_unit,FUNCTION,"    -----------------");
     132            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * latence       : %.8x",_execute_operation_in->_timing._latence);
     133            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * delay         : %.8x",_execute_operation_in->_timing._delay);
     134            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * data_rd       : %.8x",_execute_operation_in->_data_rd    );
     135            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * data_re       : %.8x",_execute_operation_in->_data_re    );
     136            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * exception     : %d"  ,_execute_operation_in->_exception  );
     137            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * no_sequence   : %d"  ,_execute_operation_in->_no_sequence);
     138            log_printf(TRACE,Functionnal_unit,FUNCTION,"    * address       : %.8x",_execute_operation_in->_address    );
    109139
    110140#ifdef STATISTICS
    111             (*_stat_use_functionnal_unit) ++;
    112             (*_stat_sum_delay)   += _execute_operation->_timing._delay;
    113             (*_stat_sum_latence) += _execute_operation->_timing._latence;
     141            if (usage_is_set(_usage,USE_STATISTICS))
     142              {
     143                (*_stat_use_functionnal_unit) ++;
     144                (*_stat_sum_delay)   += _execute_operation_in->_timing._delay;
     145                (*_stat_sum_latence) += _execute_operation_in->_timing._latence;
     146              }
    114147#endif
    115148          }
     
    121154              for (uint32_t k=0; k<_param->_nb_ooo_engine; k++)
    122155                {
    123                   uint32_t num_thread = get_num_thread(i,_param->_size_context_id,
    124                                                        j,_param->_size_front_end_id,
    125                                                        k,_param->_size_ooo_engine_id);
     156//                uint32_t num_thread = get_num_thread(i,_param->_size_context_id,
     157//                                                     j,_param->_size_front_end_id,
     158//                                                     k,_param->_size_ooo_engine_id);
    126159
    127160                  for (uint32_t x=GROUP_CUSTOM_1; x<GROUP_CUSTOM_8; x++)
    128161                    {
    129                       function_execute_end_cycle_t * fct = (_param->_get_custom_information(num_thread)._get_custom_execute_transition(x));
     162                      function_execute_end_cycle_t * fct = (_param->_get_custom_information()._get_custom_execute_transition(x));
    130163                     
    131164                      if (fct != NULL)
     
    142175            }
    143176        }
     177
     178        if (reg_BUSY_IN and not reg_BUSY_OUT)
     179          {
     180            reg_BUSY_OUT = reg_BUSY_IN;
     181            reg_BUSY_IN  = false;
     182
     183            _execute_operation_out->_timing        = _execute_operation_in->_timing       ;
     184            _execute_operation_out->_context_id    = _execute_operation_in->_context_id   ;
     185            _execute_operation_out->_front_end_id  = _execute_operation_in->_front_end_id ;
     186            _execute_operation_out->_ooo_engine_id = _execute_operation_in->_ooo_engine_id;
     187            _execute_operation_out->_packet_id     = _execute_operation_in->_packet_id    ;
     188            _execute_operation_out->_operation     = _execute_operation_in->_operation    ;
     189            _execute_operation_out->_type          = _execute_operation_in->_type         ;
     190            _execute_operation_out->_has_immediat  = _execute_operation_in->_has_immediat ;
     191            _execute_operation_out->_immediat      = _execute_operation_in->_immediat     ;
     192            _execute_operation_out->_data_ra       = _execute_operation_in->_data_ra      ;
     193            _execute_operation_out->_data_rb       = _execute_operation_in->_data_rb      ;
     194            _execute_operation_out->_data_rc       = _execute_operation_in->_data_rc      ;
     195            _execute_operation_out->_data_rd       = _execute_operation_in->_data_rd      ;
     196            _execute_operation_out->_data_re       = _execute_operation_in->_data_re      ;
     197            _execute_operation_out->_write_rd      = _execute_operation_in->_write_rd     ;
     198            _execute_operation_out->_num_reg_rd    = _execute_operation_in->_num_reg_rd   ;
     199            _execute_operation_out->_write_re      = _execute_operation_in->_write_re     ;
     200            _execute_operation_out->_num_reg_re    = _execute_operation_in->_num_reg_re   ;
     201            _execute_operation_out->_exception     = _execute_operation_in->_exception    ;
     202            _execute_operation_out->_no_sequence   = _execute_operation_in->_no_sequence  ;
     203            _execute_operation_out->_address       = _execute_operation_in->_address      ;
     204          }
     205       
     206        // each cycle : decrease the latence
     207        if (reg_BUSY_OUT and (_execute_operation_out->_timing._latence > 0))
     208          _execute_operation_out->_timing._latence --;
    144209      }
    145 
    146     // each cycle : decrease the latence
    147     if (reg_BUSY and (_execute_operation->_timing._latence > 0))
    148       _execute_operation->_timing._latence --;
    149210
    150211#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     
    152213#endif
    153214
    154     log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
     215    log_end(Functionnal_unit,FUNCTION);
    155216  };
    156217
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Parameters.cpp

    r81 r88  
    3131                          uint32_t           size_load_queue    ,
    3232                          execute_timing_t** timing             ,
    33                           morpheo::behavioural::custom::custom_information_t (*get_custom_information) (uint32_t)) :
    34     _nb_context              (nb_context            ),
    35     _nb_front_end            (nb_front_end          ),
    36     _nb_ooo_engine           (nb_ooo_engine         ),
    37     _nb_packet               (nb_packet             ),
    38     _size_general_data       (size_general_data     ),
    39     _nb_general_register     (nb_general_register   ),
    40     _size_special_data       (size_special_data     ),
    41     _nb_special_register     (nb_special_register   ),
    42     _size_store_queue        (size_store_queue      ),
    43     _size_load_queue         (size_load_queue       ),
    44 
    45     _size_context_id         (log2(nb_context      )),
    46     _size_front_end_id       (log2(nb_front_end    )),
    47     _size_ooo_engine_id      (log2(nb_ooo_engine   )),
    48     _size_packet_id          (log2(nb_packet       )),
    49     _size_general_register   (log2(nb_general_register)),
    50     _size_special_register   (log2(nb_special_register)),
    51 
    52     _have_port_context_id    (_size_context_id    > 0),
    53     _have_port_front_end_id  (_size_front_end_id  > 0),
    54     _have_port_ooo_engine_id (_size_ooo_engine_id > 0),
    55     _have_port_packet_id     (_size_packet_id     > 0),
    56     _have_port_load_queue_ptr(_size_load_queue    > 1),
    57 
    58     _have_groupe_MAC         ( (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MAC  ]._latence > 0) or
    59                                (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MACRC]._latence > 0) or
    60                                (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MSB  ]._latence > 0))
     33                          morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void),
     34                          bool               is_toplevel)
    6135  {
    6236    log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
    6337
    64     _timing                 = timing;
     38    _nb_context              = nb_context            ;
     39    _nb_front_end            = nb_front_end          ;
     40    _nb_ooo_engine           = nb_ooo_engine         ;
     41    _nb_packet               = nb_packet             ;
     42//  _size_general_data       = size_general_data     ;
     43//  _size_special_data       = size_special_data     ;
     44//  _nb_general_register     = nb_general_register   ;
     45//  _nb_special_register     = nb_special_register   ;
     46//  _size_store_queue        = size_store_queue      ;
     47//  _size_load_queue         = size_load_queue       ;
     48
     49//  _size_context_id         = log2(nb_context         );
     50//  _size_front_end_id       = log2(nb_front_end       );
     51//  _size_ooo_engine_id      = log2(nb_ooo_engine      );
     52//  _size_packet_id          = log2(nb_packet          );
     53//  _size_general_register   = log2(nb_general_register);
     54//  _size_special_register   = log2(nb_special_register);
     55
     56//  _have_port_context_id    = _size_context_id    > 0;
     57//  _have_port_front_end_id  = _size_front_end_id  > 0;
     58//  _have_port_ooo_engine_id = _size_ooo_engine_id > 0;
     59//  _have_port_packet_id     = _size_packet_id     > 0;
     60//  _have_port_load_queue_ptr= _size_load_queue    > 1;
     61
     62    _have_groupe_MAC         = ( (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MAC  ]._latence > 0) or
     63                                 (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MACRC]._latence > 0) or
     64                                 (timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MSB  ]._latence > 0));
     65
     66    _timing                  = timing;
    6567
    6668    if (get_custom_information == NULL)
     
    7173    test();
    7274
     75    if (is_toplevel)
     76      {
     77        _size_context_id         = log2(nb_context         );
     78        _size_front_end_id       = log2(nb_front_end       );
     79        _size_ooo_engine_id      = log2(nb_ooo_engine      );
     80        _size_rob_ptr            = log2(nb_packet          );
     81        _size_general_register   = log2(nb_general_register);
     82        _size_special_register   = log2(nb_special_register);
     83
     84        _size_general_data       = size_general_data     ;
     85        _size_special_data       = size_special_data     ;
     86        _size_general_register   = log2(nb_general_register);
     87        _size_special_register   = log2(nb_special_register);
     88
     89        _size_load_queue_ptr     = log2(size_load_queue );
     90        _size_store_queue_ptr    = log2(size_store_queue);
     91   
     92        _have_port_context_id    = _size_context_id    > 0;
     93        _have_port_front_end_id  = _size_front_end_id  > 0;
     94        _have_port_ooo_engine_id = _size_ooo_engine_id > 0;
     95        _have_port_rob_ptr       = _size_rob_ptr       > 0;
     96        _have_port_load_queue_ptr= _size_load_queue_ptr> 0;
     97
     98        copy();
     99      }
     100
    73101    log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
    74102  };
    75103 
     104// #undef  FUNCTION
     105// #define FUNCTION "Functionnal_unit::Parameters (copy)"
     106//   Parameters::Parameters (Parameters & param):
     107//     _nb_context              (param._nb_context             ),
     108//     _nb_front_end            (param._nb_front_end           ),
     109//     _nb_ooo_engine           (param._nb_ooo_engine          ),
     110//     _nb_packet               (param._nb_packet              ),
     111//     _size_general_data       (param._size_general_data      ),
     112//     _nb_general_register     (param._nb_general_register    ),
     113//     _size_special_data       (param._size_special_data      ),
     114//     _nb_special_register     (param._nb_special_register    ),
     115//     _size_store_queue        (param._size_store_queue       ),
     116//     _size_load_queue         (param._size_load_queue        ),
     117
     118//     _size_context_id         (param._size_context_id        ),
     119//     _size_front_end_id       (param._size_front_end_id      ),
     120//     _size_ooo_engine_id      (param._size_ooo_engine_id     ),
     121//     _size_packet_id          (param._size_packet_id         ),
     122//     _size_general_register   (param._size_general_register  ),
     123//     _size_special_register   (param._size_special_register  ),
     124
     125//     _have_port_context_id    (param._have_port_context_id   ),
     126//     _have_port_front_end_id  (param._have_port_front_end_id ),
     127//     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
     128//     _have_port_packet_id     (param._have_port_packet_id    ),
     129//     _have_port_load_queue_ptr(param._have_port_load_queue_ptr),
     130
     131//     _have_groupe_MAC         (param._have_groupe_MAC        )
     132//   {
     133//     log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
     134
     135//     _timing                 = param._timing;
     136//     _get_custom_information = param._get_custom_information;
     137
     138//     test();
     139//     log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
     140//   };
     141
    76142#undef  FUNCTION
    77 #define FUNCTION "Functionnal_unit::Parameters (copy)"
    78   Parameters::Parameters (Parameters & param):
    79     _nb_context              (param._nb_context             ),
    80     _nb_front_end            (param._nb_front_end           ),
    81     _nb_ooo_engine           (param._nb_ooo_engine          ),
    82     _nb_packet               (param._nb_packet              ),
    83     _size_general_data       (param._size_general_data      ),
    84     _nb_general_register     (param._nb_general_register    ),
    85     _size_special_data       (param._size_special_data      ),
    86     _nb_special_register     (param._nb_special_register    ),
    87     _size_store_queue        (param._size_store_queue       ),
    88     _size_load_queue         (param._size_load_queue        ),
    89 
    90     _size_context_id         (param._size_context_id        ),
    91     _size_front_end_id       (param._size_front_end_id      ),
    92     _size_ooo_engine_id      (param._size_ooo_engine_id     ),
    93     _size_packet_id          (param._size_packet_id         ),
    94     _size_general_register   (param._size_general_register  ),
    95     _size_special_register   (param._size_special_register  ),
    96 
    97     _have_port_context_id    (param._have_port_context_id   ),
    98     _have_port_front_end_id  (param._have_port_front_end_id ),
    99     _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
    100     _have_port_packet_id     (param._have_port_packet_id    ),
    101     _have_port_load_queue_ptr(param._have_port_load_queue_ptr),
    102 
    103     _have_groupe_MAC         (param._have_groupe_MAC        )
     143#define FUNCTION "Functionnal_unit::~Parameters"
     144  Parameters::~Parameters (void)
    104145  {
    105146    log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
    106 
    107     _timing                 = param._timing;
    108     _get_custom_information = param._get_custom_information;
    109 
    110     test();
    111147    log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
    112148  };
    113149
    114150#undef  FUNCTION
    115 #define FUNCTION "Functionnal_unit::~Parameters"
    116   Parameters::~Parameters ()
     151#define FUNCTION "Functionnal_unit::copy"
     152  void Parameters::copy (void)
    117153  {
    118154    log_printf(FUNC,Functionnal_unit,FUNCTION,"Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Parameters_msg_error.cpp

    r81 r88  
    3131      for (uint32_t j=0; j<_nb_operation; j++)
    3232        if (_timing[i][j]._delay != _timing[i][j]._latence)
    33           test.error("For the type '"+toString(i)+"', and the operation '"+toString(j)+"', the delay and the latence must be equal.");
     33          test.error(toString(_("For the type '%d', and the operation '%d', the delay and the latence must be equal.\n"),i,j));
    3434
    3535    if (_have_groupe_MAC and ((_timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MAC  ]._latence == 0) or
    3636                              (_timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MACRC]._latence == 0) or
    3737                              (_timing[TYPE_SPECIAL][OPERATION_SPECIAL_L_MSB  ]._latence == 0)))
    38       test.error("The functionnal unit implement a MAC unit, the latence to operation OPERATION_ALU_L_MAC, OPERATION_ALU_L_MACRC and OPERATION_ALU_L_MSB must be higher than 0.");
     38      test.error("The functionnal unit implement a MAC unit, the latence to operation OPERATION_ALU_L_MAC, OPERATION_ALU_L_MACRC and OPERATION_ALU_L_MSB must be higher than 0.\n");
    3939
    4040    log_printf(FUNC,Functionnal_unit,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Parameters_print.cpp

    r81 r88  
    3232    xml.singleton_begin("nb_packet          "); xml.attribut("value",toString(_nb_packet          )); xml.singleton_end();
    3333    xml.singleton_begin("size_general_data  "); xml.attribut("value",toString(_size_general_data  )); xml.singleton_end();
    34     xml.singleton_begin("nb_general_register"); xml.attribut("value",toString(_nb_general_register)); xml.singleton_end();
     34//  xml.singleton_begin("nb_general_register"); xml.attribut("value",toString(_nb_general_register)); xml.singleton_end();
    3535    xml.singleton_begin("size_special_data  "); xml.attribut("value",toString(_size_special_data  )); xml.singleton_end();
    36     xml.singleton_begin("nb_special_register"); xml.attribut("value",toString(_nb_special_register)); xml.singleton_end();
     36//  xml.singleton_begin("nb_special_register"); xml.attribut("value",toString(_nb_special_register)); xml.singleton_end();
    3737    xml.balise_close();
    3838
Note: See TracChangeset for help on using the changeset viewer.