Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (15 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_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Read_unit_to_Execution_unit_genMealy.cpp

    r81 r88  
    2424    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin");
    2525
    26     bool execute_unit_use [_param->_nb_execute_unit];
     26    bool execute_unit_use [_param->_nb_execute_unit][_param->_max_nb_execute_unit_port];
    2727
    2828    for (uint32_t i=0; i<_param->_nb_execute_unit; i++)
    29       execute_unit_use[i] = (PORT_READ(in_EXECUTE_UNIT_IN_ACK [i]) == 0);
     29      for (uint32_t j=0; j<_param->_nb_execute_unit_port[i]; j++)
     30        execute_unit_use[i][j] = false;
    3031
    3132    for (uint32_t i=0; i<_param->_nb_read_unit; i++)
    32       {
    33         bool       ack = false;
     33      for (uint32_t j=0; j<_param->_nb_read_unit_port[i]; j++)
     34        {
     35          bool       ack = false;
     36         
     37          log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"Test Read_unit[%d][%d]",i,j);
     38         
     39          if (PORT_READ(in_READ_UNIT_OUT_VAL [i][j]) == true)
     40            {
     41              log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION," * have a valid entry.");
     42             
     43              Tcontext_t context_id    = (_param->_have_port_context_id   )?PORT_READ(in_READ_UNIT_OUT_CONTEXT_ID    [i][j]):0;
     44              Tcontext_t front_end_id  = (_param->_have_port_front_end_id )?PORT_READ(in_READ_UNIT_OUT_FRONT_END_ID  [i][j]):0;
     45              Tcontext_t ooo_engine_id = (_param->_have_port_ooo_engine_id)?PORT_READ(in_READ_UNIT_OUT_OOO_ENGINE_ID [i][j]):0;
     46              Tcontext_t num_thread    = get_num_thread(context_id   , _param->_size_context_id   ,
     47                                                        front_end_id , _param->_size_front_end_id ,
     48                                                        ooo_engine_id, _param->_size_ooo_engine_id);
     49              Ttype_t    type          = PORT_READ(in_READ_UNIT_OUT_TYPE [i][j]);
     50             
     51#ifdef DEBUG_TEST
     52              if (_destination[i][num_thread][type].empty())
     53                throw ERRORMORPHEO(FUNCTION,"Invalid Operation : They have no execute_unit to receive a operation from the read_unit ["+toString(i)+"], thread ["+toString(num_thread)+"] and a operation's type ["+toString_type(type)+"].");
     54#endif
     55             
     56              // find a free execute_unit
     57              for (std::list<destination_t>::iterator it=_destination[i][num_thread][type].begin();
     58                   (it != _destination[i][num_thread][type].end()) and (ack == false);
     59                   it++)
     60                {
     61                  uint32_t dest = (*it).grp;
     62                  uint32_t port = (*it).elt;
     63                 
     64                  log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"   * Test destination [%d][%d].",dest,port);
     65                 
     66                  if (execute_unit_use [dest][port] == false)
     67                    {
     68                      log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"     * Is ok! Link.");
     69                     
     70                      // have find !!!
     71                      ack                           = PORT_READ(in_EXECUTE_UNIT_IN_ACK [dest][port]);
     72                      execute_unit_use [dest][port] = true;
    3473
    35         log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"Test Read_unit[%d]",i);
    36 
    37         if (PORT_READ(in_READ_UNIT_OUT_VAL [i]) == true)
    38           {
    39             log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION," * have a valid entry.");
    40            
    41             Tcontext_t context_id    = (_param->_have_port_context_id   )?PORT_READ(in_READ_UNIT_OUT_CONTEXT_ID    [i]):0;
    42             Tcontext_t front_end_id  = (_param->_have_port_front_end_id )?PORT_READ(in_READ_UNIT_OUT_FRONT_END_ID  [i]):0;
    43             Tcontext_t ooo_engine_id = (_param->_have_port_ooo_engine_id)?PORT_READ(in_READ_UNIT_OUT_OOO_ENGINE_ID [i]):0;
    44             Tcontext_t num_thread    = get_num_thread(context_id   , _param->_size_context_id   ,
    45                                                       front_end_id , _param->_size_front_end_id ,
    46                                                       ooo_engine_id, _param->_size_ooo_engine_id);
    47             Ttype_t    type          = PORT_READ(in_READ_UNIT_OUT_TYPE [i]);
    48            
    49 #ifdef DEBUG_TEST
    50             if (_destination[i][num_thread][type].empty())
    51               throw ERRORMORPHEO(FUNCTION,"Invalid Operation : They have no execute_unit to receive a operation from the read_unit ["+toString(i)+"], thread ["+toString(num_thread)+"] and a operation's type ["+toString_type(type)+"].");
    52 #endif
    53 
    54             // find a free execute_unit
    55             for (std::list<uint32_t>::iterator it=_destination[i][num_thread][type].begin();
    56                  (it != _destination[i][num_thread][type].end()) and (ack == false);
    57                  it++)
    58               {
    59                 uint32_t dest = *it;
    60 
    61                 log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"   * Test destination [%d].",dest);
    62                            
    63                 if (execute_unit_use [dest] == false)
    64                   {
    65                     log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"     * Is ok! Link.");
    66                     // have find !!!
    67                     ack                     = true;
    68                     execute_unit_use [dest] = true;
    69 
    70                     if (_param->_have_port_context_id)
    71                     PORT_WRITE(out_EXECUTE_UNIT_IN_CONTEXT_ID            [dest], PORT_READ(in_READ_UNIT_OUT_CONTEXT_ID            [i]));
    72                     if (_param->_have_port_front_end_id)
    73                     PORT_WRITE(out_EXECUTE_UNIT_IN_FRONT_END_ID          [dest], PORT_READ(in_READ_UNIT_OUT_FRONT_END_ID          [i]));
    74                     if (_param->_have_port_ooo_engine_id)
    75                     PORT_WRITE(out_EXECUTE_UNIT_IN_OOO_ENGINE_ID         [dest], PORT_READ(in_READ_UNIT_OUT_OOO_ENGINE_ID         [i]));
    76                     if (_param->_have_port_packet_id)
    77                     PORT_WRITE(out_EXECUTE_UNIT_IN_PACKET_ID             [dest], PORT_READ(in_READ_UNIT_OUT_PACKET_ID             [i]));
    78                     PORT_WRITE(out_EXECUTE_UNIT_IN_OPERATION             [dest], PORT_READ(in_READ_UNIT_OUT_OPERATION             [i]));
    79                     PORT_WRITE(out_EXECUTE_UNIT_IN_TYPE                  [dest], PORT_READ(in_READ_UNIT_OUT_TYPE                  [i]));
    80                     PORT_WRITE(out_EXECUTE_UNIT_IN_HAS_IMMEDIAT          [dest], PORT_READ(in_READ_UNIT_OUT_HAS_IMMEDIAT          [i]));
    81                     PORT_WRITE(out_EXECUTE_UNIT_IN_DATA_RC               [dest], PORT_READ(in_READ_UNIT_OUT_DATA_RC               [i]));
    82                     PORT_WRITE(out_EXECUTE_UNIT_IN_WRITE_RD              [dest], PORT_READ(in_READ_UNIT_OUT_WRITE_RD              [i]));
    83                     PORT_WRITE(out_EXECUTE_UNIT_IN_WRITE_RE              [dest], PORT_READ(in_READ_UNIT_OUT_WRITE_RE              [i]));
    84                     PORT_WRITE(out_EXECUTE_UNIT_IN_NUM_REG_RE            [dest], PORT_READ(in_READ_UNIT_OUT_NUM_REG_RE            [i]));
    85                     PORT_WRITE(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE [dest], PORT_READ(in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE [i]));
    86                     if (_param->_have_port_load_queue_ptr)
    87                     PORT_WRITE(out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE  [dest], PORT_READ(in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE  [i]));
    88                     PORT_WRITE(out_EXECUTE_UNIT_IN_IMMEDIAT              [dest], PORT_READ(in_READ_UNIT_OUT_IMMEDIAT              [i]));
    89                     PORT_WRITE(out_EXECUTE_UNIT_IN_DATA_RA               [dest], PORT_READ(in_READ_UNIT_OUT_DATA_RA               [i]));
    90                     PORT_WRITE(out_EXECUTE_UNIT_IN_DATA_RB               [dest], PORT_READ(in_READ_UNIT_OUT_DATA_RB               [i]));
    91                     PORT_WRITE(out_EXECUTE_UNIT_IN_NUM_REG_RD            [dest], PORT_READ(in_READ_UNIT_OUT_NUM_REG_RD            [i]));
    92                   }
    93               }
    94           }
    95         PORT_WRITE(out_READ_UNIT_OUT_ACK [i], ack);
    96       }
     74                      if (_param->_have_port_context_id)
     75                      PORT_WRITE(out_EXECUTE_UNIT_IN_CONTEXT_ID            [dest][port], PORT_READ(in_READ_UNIT_OUT_CONTEXT_ID            [i][j]));
     76                      if (_param->_have_port_front_end_id)
     77                      PORT_WRITE(out_EXECUTE_UNIT_IN_FRONT_END_ID          [dest][port], PORT_READ(in_READ_UNIT_OUT_FRONT_END_ID          [i][j]));
     78                      if (_param->_have_port_ooo_engine_id)
     79                      PORT_WRITE(out_EXECUTE_UNIT_IN_OOO_ENGINE_ID         [dest][port], PORT_READ(in_READ_UNIT_OUT_OOO_ENGINE_ID         [i][j]));
     80                      if (_param->_have_port_rob_ptr  )
     81                      PORT_WRITE(out_EXECUTE_UNIT_IN_PACKET_ID             [dest][port], PORT_READ(in_READ_UNIT_OUT_PACKET_ID             [i][j]));
     82                      PORT_WRITE(out_EXECUTE_UNIT_IN_OPERATION             [dest][port], PORT_READ(in_READ_UNIT_OUT_OPERATION             [i][j]));
     83                      PORT_WRITE(out_EXECUTE_UNIT_IN_TYPE                  [dest][port], PORT_READ(in_READ_UNIT_OUT_TYPE                  [i][j]));
     84                      PORT_WRITE(out_EXECUTE_UNIT_IN_HAS_IMMEDIAT          [dest][port], PORT_READ(in_READ_UNIT_OUT_HAS_IMMEDIAT          [i][j]));
     85                      PORT_WRITE(out_EXECUTE_UNIT_IN_DATA_RC               [dest][port], PORT_READ(in_READ_UNIT_OUT_DATA_RC               [i][j]));
     86                      PORT_WRITE(out_EXECUTE_UNIT_IN_WRITE_RD              [dest][port], PORT_READ(in_READ_UNIT_OUT_WRITE_RD              [i][j]));
     87                      PORT_WRITE(out_EXECUTE_UNIT_IN_WRITE_RE              [dest][port], PORT_READ(in_READ_UNIT_OUT_WRITE_RE              [i][j]));
     88                      PORT_WRITE(out_EXECUTE_UNIT_IN_NUM_REG_RE            [dest][port], PORT_READ(in_READ_UNIT_OUT_NUM_REG_RE            [i][j]));
     89                      PORT_WRITE(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE [dest][port], PORT_READ(in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE [i][j]));
     90                      if (_param->_have_port_load_queue_ptr)
     91                      PORT_WRITE(out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE  [dest][port], PORT_READ(in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE  [i][j]));
     92                      PORT_WRITE(out_EXECUTE_UNIT_IN_IMMEDIAT              [dest][port], PORT_READ(in_READ_UNIT_OUT_IMMEDIAT              [i][j]));
     93                      PORT_WRITE(out_EXECUTE_UNIT_IN_DATA_RA               [dest][port], PORT_READ(in_READ_UNIT_OUT_DATA_RA               [i][j]));
     94                      PORT_WRITE(out_EXECUTE_UNIT_IN_DATA_RB               [dest][port], PORT_READ(in_READ_UNIT_OUT_DATA_RB               [i][j]));
     95                      PORT_WRITE(out_EXECUTE_UNIT_IN_NUM_REG_RD            [dest][port], PORT_READ(in_READ_UNIT_OUT_NUM_REG_RD            [i][j]));
     96                    }
     97                }
     98            }
     99          PORT_WRITE(out_READ_UNIT_OUT_ACK [i][j], ack);
     100        }
    97101
    98102    for (uint32_t i=0; i<_param->_nb_execute_unit; i++)
    99       {
    100         PORT_WRITE(out_EXECUTE_UNIT_IN_VAL[i], execute_unit_use[i]); 
    101       }
     103      for (uint32_t j=0; j<_param->_nb_execute_unit_port[i]; j++)
     104        PORT_WRITE(out_EXECUTE_UNIT_IN_VAL[i][j], execute_unit_use[i][j]);
    102105
    103106    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End");
Note: See TracChangeset for help on using the changeset viewer.