Changeset 106


Ignore:
Timestamp:
Feb 9, 2009, 11:55:26 PM (15 years ago)
Author:
rosiere
Message:

1) RAT : Fix bug when update and event in same cycle
2) Context State : Compute depth
3) Load Store Unit : In check logic, translate all access in little endian. More easy to check
4) UFPT : End Event

Location:
trunk
Files:
1 deleted
42 edited

Legend:

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

    r104 r106  
    1818namespace load_store_unit {
    1919
     20template <typename T>
     21T swapBytes (T data, uint32_t size_data, uint32_t size_access)
     22{
     23  uint64_t x = static_cast<uint64_t>(data);
     24
     25//   switch (size_data)
     26//     {
     27//     case 2 : // 16 bits
     28//       {
     29//         switch (size_access)
     30//           {
     31//           case 2 :
     32//             {
     33//               x = ((((x>> 8)&0xff) <<  0) |
     34//                    (((x>> 0)&0xff) <<  8) );
     35//               break;
     36//             }
     37//           default :
     38//             {
     39//               break;
     40//             }
     41//           }
     42//         break;
     43//       }
     44//     case 4 : // 32 bits
     45//       {
     46//         switch (size_access)
     47//           {
     48//           case 2 :
     49//             {
     50//               x = ((((x>> 8)&0xff) <<  0) |
     51//                    (((x>> 0)&0xff) <<  8) |
     52//                    (((x>>24)&0xff) << 16) |
     53//                    (((x>>16)&0xff) << 24) );
     54//               break;
     55//             }
     56//           case 4 :
     57//             {
     58//               x = ((((x>>24)&0xff) <<  0) |
     59//                    (((x>>16)&0xff) <<  8) |
     60//                    (((x>> 8)&0xff) << 16) |
     61//                    (((x>> 0)&0xff) << 24) );
     62//               break;
     63//             }
     64//           default :
     65//             {
     66//               break;
     67//             }
     68//           }
     69//         break;
     70//       }
     71//     case 8 : // 64 bits
     72//       {
     73//         switch (size_access)
     74//           {
     75//           case 2 :
     76//             {
     77//               x = ((((x>> 8)&0xff) <<  0) |
     78//                    (((x>> 0)&0xff) <<  8) |
     79//                    (((x>>24)&0xff) << 16) |
     80//                    (((x>>16)&0xff) << 24) |
     81//                    (((x>>40)&0xff) << 32) |
     82//                    (((x>>32)&0xff) << 40) |
     83//                    (((x>>56)&0xff) << 48) |
     84//                    (((x>>48)&0xff) << 56) );
     85//               break;
     86//             }
     87//           case 4 :
     88//             {
     89//               x = ((((x>>24)&0xff) <<  0) |
     90//                    (((x>>16)&0xff) <<  8) |
     91//                    (((x>> 8)&0xff) << 16) |
     92//                    (((x>> 0)&0xff) << 24) |
     93//                    (((x>>56)&0xff) << 32) |
     94//                    (((x>>48)&0xff) << 40) |
     95//                    (((x>>40)&0xff) << 48) |
     96//                    (((x>>32)&0xff) << 56) );
     97//               break;
     98//             }
     99//           case 8 :
     100//             {
     101//               x = ((((x>>56)&0xff) <<  0) |
     102//                    (((x>>48)&0xff) <<  8) |
     103//                    (((x>>40)&0xff) << 16) |
     104//                    (((x>>32)&0xff) << 24) |
     105//                    (((x>>24)&0xff) << 32) |
     106//                    (((x>>16)&0xff) << 40) |
     107//                    (((x>> 8)&0xff) << 48) |
     108//                    (((x>> 0)&0xff) << 56) );
     109//               break;
     110//             }
     111//           default :
     112//             {
     113//               break;
     114//             }
     115//           }
     116//         break;
     117//       }
     118//     default :
     119//       {
     120//         break;
     121//       }
     122//     }
     123
     124
     125  uint64_t y=0;
     126
     127  for (uint32_t i=0; i<size_data; i+=size_access)
     128    {
     129      uint32_t offset = i<<3;
     130
     131      switch (size_access)
     132        {
     133        case 1 :
     134          {
     135            y = x;
     136            break;
     137          }
     138        case 2 :
     139          {
     140            y |= ((((x>>( 8+offset))&0xff) << ( 0+offset)) |
     141                  (((x>>( 0+offset))&0xff) << ( 8+offset)) );
     142            break;
     143          }
     144        case 4 :
     145          {
     146            y |= ((((x>>(24+offset))&0xff) << ( 0+offset)) |
     147                  (((x>>(16+offset))&0xff) << ( 8+offset)) |
     148                  (((x>>( 8+offset))&0xff) << (16+offset)) |
     149                  (((x>>( 0+offset))&0xff) << (24+offset)) );
     150            break;
     151          }
     152        case 8 :
     153          {
     154            y |= ((((x>>(56+offset))&0xff) << ( 0+offset)) |
     155                  (((x>>(48+offset))&0xff) << ( 8+offset)) |
     156                  (((x>>(40+offset))&0xff) << (16+offset)) |
     157                  (((x>>(32+offset))&0xff) << (24+offset)) |
     158                  (((x>>(24+offset))&0xff) << (32+offset)) |
     159                  (((x>>(16+offset))&0xff) << (40+offset)) |
     160                  (((x>>( 8+offset))&0xff) << (48+offset)) |
     161                  (((x>>( 0+offset))&0xff) << (56+offset)) );
     162            break;
     163          }
     164        default :
     165            {
     166              break;
     167            }
     168        }
     169    }
     170
     171  return static_cast<T>(y);
     172}
     173
     174template <typename T>
     175T swapBits (T data, uint32_t size_data, uint32_t size_access)
     176{
     177  uint8_t x = static_cast<uint8_t>(data);
     178
     179  uint8_t y=0;
     180
     181  for (uint32_t i=0; i<size_data; i+=size_access)
     182    {
     183      uint32_t offset = i;
     184
     185      switch (size_access)
     186        {
     187        case 1 :
     188          {
     189            y = x;
     190            break;
     191          }
     192        case 2 :
     193          {
     194            y |= ((((x>>( 1+offset))&0x1) << ( 0+offset)) |
     195                  (((x>>( 0+offset))&0x1) << ( 1+offset)) );
     196            break;
     197          }
     198        case 4 :
     199          {
     200            y |= ((((x>>( 3+offset))&0x1) << ( 0+offset)) |
     201                  (((x>>( 2+offset))&0x1) << ( 1+offset)) |
     202                  (((x>>( 1+offset))&0x1) << ( 2+offset)) |
     203                  (((x>>( 0+offset))&0x1) << ( 3+offset)) );
     204            break;
     205          }
     206        case 8 :
     207          {
     208            y |= ((((x>>( 7+offset))&0x1) << ( 0+offset)) |
     209                  (((x>>( 6+offset))&0x1) << ( 1+offset)) |
     210                  (((x>>( 5+offset))&0x1) << ( 2+offset)) |
     211                  (((x>>( 4+offset))&0x1) << ( 3+offset)) |
     212                  (((x>>( 3+offset))&0x1) << ( 4+offset)) |
     213                  (((x>>( 2+offset))&0x1) << ( 5+offset)) |
     214                  (((x>>( 1+offset))&0x1) << ( 6+offset)) |
     215                  (((x>>( 0+offset))&0x1) << ( 7+offset)) );
     216            break;
     217          }
     218        default :
     219            {
     220              break;
     221            }
     222        }
     223    }
     224
     225  return static_cast<T>(y);
     226}
    20227
    21228#undef  FUNCTION
     
    83290
    84291                log_printf(TRACE,Load_store_unit,FUNCTION,"    * index_store : %d",index_store);
     292                log_printf(TRACE,Load_store_unit,FUNCTION,"    * ptr_read    : %d",reg_STORE_QUEUE_PTR_READ);
     293
    85294                if (index_store == reg_STORE_QUEUE_PTR_READ)
    86295                  {
     
    148357                                 
    149358                                  // Read data
    150                                   Tgeneral_data_t load_data  = _load_queue [index_load ]._rdata  ;
    151                                   Tgeneral_data_t store_data = _store_queue[index_store]._wdata  ;
    152                                  
    153                                   log_printf(TRACE,Load_store_unit,FUNCTION,"            * load_data  (before): 0x%.8x",load_data);
    154                                   log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_data (before): 0x%.8x",store_data);
     359                                  bool is_big_endian = true;
     360
     361                                  Tgeneral_data_t   load_data      = _load_queue [index_load ]._rdata  ;
     362                                  Tgeneral_data_t   store_data     = _store_queue[index_store]._wdata  ;
     363                                  Tdcache_address_t check_hit_byte = _load_queue [index_load ]._check_hit_byte;
     364                                  Tcontrol_t        check_hit      = _load_queue [index_load ]._check_hit;
     365                                  uint32_t          load_size_access  = memory_size(_load_queue [index_load ]._operation)>>3;
     366                                  uint32_t          store_size_access = memory_size(_store_queue[index_store]._operation)>>3;
     367
     368                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * is_big_endian           : %d",is_big_endian);
     369                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * load_data               : 0x%.8x",load_data);
     370                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_data              : 0x%.8x",store_data);
     371                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit_byte          : %x",check_hit_byte);
     372                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit               : %d",check_hit);
     373
     374                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * load_size_access        : %d",load_size_access );
     375                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_size_access       : %d",store_size_access);
     376
     377                                  if (is_big_endian)
     378                                    {
     379                                      // swap in little endian
     380                                      load_data      = swapBytes<Tgeneral_data_t  >(load_data     , _param->_size_general_data>>3,load_size_access);
     381                                      store_data     = swapBytes<Tgeneral_data_t  >(store_data    , _param->_size_general_data>>3,store_size_access);
     382                                      check_hit_byte = swapBits <Tdcache_address_t>(check_hit_byte, _param->_size_general_data>>3,load_size_access);
     383                                     
     384                                     
     385                                      log_printf(TRACE,Load_store_unit,FUNCTION,"            * load_data      (swap 1) : 0x%.8x",load_data);
     386                                      log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_data     (swap 1) : 0x%.8x",store_data);
     387                                      log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit_byte (swap 1) : %x",check_hit_byte);
     388                                    }
    155389
    156390                                  uint32_t store_nb_byte     = (1<<memory_access(_store_queue[index_store]._operation));
     
    160394                                  uint32_t store_num_byte_max = store_num_byte_min+store_nb_byte;
    161395
    162                                   log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_num_byte_min : %d",store_num_byte_min);
    163                                   log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_num_byte_max : %d",store_num_byte_max);
    164                                   log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit          : %x",_load_queue[index_load]._check_hit);
    165                                   log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit_byte     : %x",_load_queue[index_load]._check_hit_byte);
     396                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_num_byte_min      : %d",store_num_byte_min);
     397                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_num_byte_max      : %d",store_num_byte_max);
     398
     399//                                   uint32_t load_nb_byte      = (1<<memory_access(_load_queue[index_load]._operation));
     400
     401//                                uint32_t load_num_byte_min = (load_addr & _param->_mask_address_lsb);
     402//                                uint32_t load_num_byte_max = load_num_byte_min+load_nb_byte;
     403
     404//                                log_printf(TRACE,Load_store_unit,FUNCTION,"            * load_num_byte_min       : %d",load_num_byte_min);
     405//                                log_printf(TRACE,Load_store_unit,FUNCTION,"            * load_num_byte_max       : %d",load_num_byte_max);
     406
     407//                                for (uint32_t num_load_byte=load_num_byte_min; num_load_byte<load_num_byte_max; num_load_byte ++)
     408//                                  {
     409//                                       // Make a mask
     410//                                       uint32_t num_store_byte = num_load_byte;
     411                                     
     412
     413
    166414                                  // The bypass is checked byte per byte
    167415                                  // Is same endianness : because to change endianness, we must write in special register. Also the pipeline is flushed.
    168                                   bool is_big_endian = true;
    169 
    170416                                  for (uint32_t num_store_byte=store_num_byte_min; num_store_byte<store_num_byte_max; num_store_byte ++)
    171417                                    {
    172418                                      // Make a mask
    173                                       uint32_t num_load_byte;
    174 
    175                                       if (is_big_endian)
    176                                         {
    177                                           // sd 0 : 0 1 2 3 4 5 6 7
    178                                           // ld 0 : 0 1 2 3 4 5 6 7 >>  0
    179                                           // lw 0 :         0 1 2 3 >>  0 -4
    180                                           // lw 4 : 4 5 6 7         >> 32 +4
    181                                           // lh 0 :             0 1 >>  0 -6
    182                                           // lh 2 :         2 3     >> 16 -2
    183                                           // lh 4 :     4 5         >> 32 +2
    184                                           // lh 6 : 6 7             >> 48 +6
    185                                           // lb 0 :               0 >>  0 -7
    186                                           // lb 1 :             1   >>  8 -5
    187                                           // lb 2 :           2     >> 16 -3
    188                                           // lb 3 :         3       >> 24 -1
    189                                           // lb 4 :       4         >> 32 +1
    190                                           // lb 5 :     5           >> 40 +3
    191                                           // lb 6 :   6             >> 48 +5
    192                                           // lb 7 : 7               >> 56 +7
    193 
    194                                           // diff : (store_nb_byte + load_nb_byte) - 2*nb_load_byte*((num_store_byte+1)
    195 
    196                                           // store duplicate = all store access can be see as full size_data store
    197                                           uint32_t load_nb_byte = (1<<memory_access(_load_queue [index_load ]._operation));
    198 
    199 //                                           log_printf(TRACE,Load_store_unit,FUNCTION,"                * num_store_byte       : %d",num_store_byte);
    200 //                                           log_printf(TRACE,Load_store_unit,FUNCTION,"                * size_general_data>>3 : %d",(_param->_size_general_data>>3));
    201 //                                           log_printf(TRACE,Load_store_unit,FUNCTION,"                * load_nb_byte         : %d",load_nb_byte);
    202 //                                           log_printf(TRACE,Load_store_unit,FUNCTION,"                * x = ((_param->_size_general_data>>3)+load_nb_byte-2*load_nb_byte*(num_store_byte/load_nb_byte+1)) = %d+%d-%d*%d = %d"
    203 //                                                      , (_param->_size_general_data>>3)
    204 //                                                      , load_nb_byte
    205 //                                                      , 2*load_nb_byte
    206 //                                                      ,((num_store_byte/load_nb_byte)+1)
    207 //                                                      ,((_param->_size_general_data>>3)+load_nb_byte-2*load_nb_byte*((num_store_byte/load_nb_byte)+1)));
     419                                      uint32_t num_load_byte = num_store_byte;
     420
     421//                                       if (is_big_endian)
     422//                                         {
     423//                                           // sd 0 : 0 1 2 3 4 5 6 7
     424//                                           // ld 0 : 0 1 2 3 4 5 6 7 >>  0
     425//                                           // lw 0 :         0 1 2 3 >>  0 -4
     426//                                           // lw 4 : 4 5 6 7         >> 32 +4
     427//                                           // lh 0 :             0 1 >>  0 -6
     428//                                           // lh 2 :         2 3     >> 16 -2
     429//                                           // lh 4 :     4 5         >> 32 +2
     430//                                           // lh 6 : 6 7             >> 48 +6
     431//                                           // lb 0 :               0 >>  0 -7
     432//                                           // lb 1 :             1   >>  8 -5
     433//                                           // lb 2 :           2     >> 16 -3
     434//                                           // lb 3 :         3       >> 24 -1
     435//                                           // lb 4 :       4         >> 32 +1
     436//                                           // lb 5 :     5           >> 40 +3
     437//                                           // lb 6 :   6             >> 48 +5
     438//                                           // lb 7 : 7               >> 56 +7
     439
     440//                                           // diff : (store_nb_byte + load_nb_byte) - 2*nb_load_byte*((num_store_byte+1)
     441
     442//                                           // store duplicate = all store access can be see as full size_data store
     443// //                                           uint32_t load_nb_byte = (1<<memory_access(_load_queue [index_load ]._operation));
     444
     445// //                                           int32_t diff = ((_param->_size_general_data>>3)+load_nb_byte-2*load_nb_byte*((num_store_byte/load_nb_byte)+1));
     446
     447// //                                           num_load_byte =num_store_byte+diff;
     448
     449// //                                           log_printf(TRACE,Load_store_unit,FUNCTION,"              * load_nb_byte   : %d",load_nb_byte);
     450// //                                           log_printf(TRACE,Load_store_unit,FUNCTION,"              * diff           : %d",diff);
     451
     452
     453//                                           num_load_byte = num_store_byte;
     454//                                         }
     455//                                       else
     456//                                         {
     457//                                           // sd 0 : 0 1 2 3 4 5 6 7
     458//                                           // ld 0 : 0 1 2 3 4 5 6 7 >>  0
     459//                                           // lw 0 :         4 5 6 7 >>  0
     460//                                           // lw 4 : 0 1 2 3         >> 32
     461//                                           // lh 0 :             6 7 >>  0
     462//                                           // lh 2 :         4 5     >> 16
     463//                                           // lh 4 :     2 3         >> 32
     464//                                           // lh 6 : 0 1             >> 48
     465//                                           // lb 0 :               7 >>  0
     466//                                           // lb 1 :             6   >>  8
     467//                                           // lb 2 :           5     >> 16
     468//                                           // lb 3 :         4       >> 24
     469//                                           // lb 4 :       3         >> 32
     470//                                           // lb 5 :     2           >> 40
     471//                                           // lb 6 :   1             >> 48
     472//                                           // lb 7 : 0               >> 56
    208473                                         
    209 
    210                                           num_load_byte =num_store_byte+((_param->_size_general_data>>3)+load_nb_byte-2*load_nb_byte*((num_store_byte/load_nb_byte)+1));
    211                                         }
    212                                       else
    213                                         {
    214                                           // sd 0 : 0 1 2 3 4 5 6 7
    215                                           // ld 0 : 0 1 2 3 4 5 6 7 >>  0
    216                                           // lw 0 :         4 5 6 7 >>  0
    217                                           // lw 4 : 0 1 2 3         >> 32
    218                                           // lh 0 :             6 7 >>  0
    219                                           // lh 2 :         4 5     >> 16
    220                                           // lh 4 :     2 3         >> 32
    221                                           // lh 6 : 0 1             >> 48
    222                                           // lb 0 :               7 >>  0
    223                                           // lb 1 :             6   >>  8
    224                                           // lb 2 :           5     >> 16
    225                                           // lb 3 :         4       >> 24
    226                                           // lb 4 :       3         >> 32
    227                                           // lb 5 :     2           >> 40
    228                                           // lb 6 :   1             >> 48
    229                                           // lb 7 : 0               >> 56
    230                                          
    231                                           num_load_byte = num_store_byte;
    232                                         }
    233                                      
     474//                                           num_load_byte = num_store_byte;
     475//                                         }
     476
    234477                                      uint32_t mask  = 1<<num_load_byte;
    235478
     
    241484                                      //   * they have not a previous bypass with an another store
    242485                                      //   * it's a valid request of load
    243                                       if ((_load_queue[index_load]._check_hit_byte&mask)==0)
     486                                      if ((check_hit_byte&mask)==0)
    244487                                        {
    245488                                          // Note : Store is duplicate = all store access can be see as full size_data store
    246489
    247490                                          uint32_t num_store_bit_min = num_store_byte<<3; //*8
    248 //                                         uint32_t num_store_bit_max = num_store_bit_min+8-1;
     491//                                        uint32_t num_store_bit_max = num_store_bit_min+8-1;
    249492                                          uint32_t num_load_bit_min  = num_load_byte <<3; //*8
    250493                                          uint32_t num_load_bit_max  = num_load_bit_min+8-1;
     
    259502                                                       mask_not<Tdcache_data_t>(load_data,num_load_bit_max,num_load_bit_min));
    260503
    261                                           _load_queue[index_load]._check_hit_byte |= mask;
    262                                           _load_queue[index_load]._check_hit       = 1;
     504                                          check_hit_byte |= mask;
     505                                          check_hit       = 1;
    263506                                          change_state = true;
    264507
     
    267510                                    }
    268511
    269                                   _load_queue[index_load]._rdata = load_data;
     512                                  if (is_big_endian)
     513                                    {
     514                                      // swap in little endian
     515                                      load_data      = swapBytes<Tgeneral_data_t  >(load_data     , _param->_size_general_data>>3,load_size_access);
     516                                      check_hit_byte = swapBits <Tdcache_address_t>(check_hit_byte, _param->_size_general_data>>3,load_size_access);
     517                                     
     518                                     
     519                                      log_printf(TRACE,Load_store_unit,FUNCTION,"            * load_data      (swap 2) : 0x%.8x",load_data);
     520                                      log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit_byte (swap 2) : %x",check_hit_byte);
     521                                    }
     522
     523                                  _load_queue[index_load]._rdata          = load_data;
     524                                  _load_queue[index_load]._check_hit_byte = check_hit_byte;
     525                                  _load_queue[index_load]._check_hit      = check_hit;
     526
    270527                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * load_data  (after) : 0x%.8x",load_data);
    271528
    272                                   log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit          : %x",_load_queue[index_load]._check_hit);
    273                                   log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit_byte     : %x",_load_queue[index_load]._check_hit_byte);
     529                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit          : %x",check_hit);
     530                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit_byte     : %x",check_hit_byte);
    274531
    275532                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * mask_end_check     : %x",(-1& _param->_mask_address_lsb));
     
    295552                  {
    296553                    log_printf(TRACE,Load_store_unit,FUNCTION,"              * next");
     554                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * new store_queue_ptr_write : %d",index_store);
    297555//                  if (_load_queue[index_load]._store_queue_ptr_write == 0)
    298556//                    _load_queue[index_load]._store_queue_ptr_write = _param->_size_store_queue-1;
     
    312570                  {
    313571                    log_printf(TRACE,Load_store_unit,FUNCTION,"              * change_state");
     572                    log_printf(TRACE,Load_store_unit,FUNCTION,"              * end_check : %d",end_check);
     573
     574                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * state old : %s",toString(_load_queue[index_load]._state).c_str());
    314575
    315576                    switch (_load_queue[index_load]._state)
    316577                      {
    317                       case LOAD_QUEUE_WAIT_CHECK   : _load_queue[index_load]._state = LOAD_QUEUE_WAIT  ; break;
     578                      case LOAD_QUEUE_WAIT_CHECK   :
     579                        {
     580                          if (end_check)
     581                            _load_queue[index_load]._state = LOAD_QUEUE_WAIT  ;
     582                          break;
     583                        }
    318584                      case LOAD_QUEUE_COMMIT_CHECK :
    319585                        {
     
    321587                            _load_queue[index_load]._state = LOAD_QUEUE_COMMIT;
    322588                          else
    323                             _load_queue[index_load]._state = LOAD_QUEUE_CHECK;
     589                            _load_queue[index_load]._state = LOAD_QUEUE_CHECK; // No commit : check hit and no end
    324590                          break;
    325591                        }
     
    328594                          if (end_check)
    329595                            _load_queue[index_load]._state     = LOAD_QUEUE_COMMIT;
     596
    330597                          // check find a bypass. A speculative load have been committed : report a speculation miss.
    331                           if (_load_queue[index_load]._check_hit != 0)
     598                          if ((_load_queue[index_load]._check_hit != 0)//  and
     599//                               (_load_queue[index_load]._write_rd  == 0)
     600                              )
    332601                            {
    333602                              _load_queue[index_load]._exception = EXCEPTION_MEMORY_MISS_SPECULATION;
     
    339608                      default : break;
    340609                      }
    341                     log_printf(TRACE,Load_store_unit,FUNCTION,"                * new state : %d",_load_queue[index_load]._state);
     610                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * state new : %s",toString(_load_queue[index_load]._state).c_str());
    342611                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * exception : %d",_load_queue[index_load]._exception);
    343612                  }
     
    712981
    713982            log_printf(TRACE,Load_store_unit,FUNCTION,"    * original packet_id : %d"  , packet_id);
     983            log_printf(TRACE,Load_store_unit,FUNCTION,"    * packet_id          : %d"  , packet_id>>1);
    714984            log_printf(TRACE,Load_store_unit,FUNCTION,"    * rdata              : %.8x", rdata);
    715985            log_printf(TRACE,Load_store_unit,FUNCTION,"    * error              : %d"  , error);
     
    719989                packet_id >>= 1;
    720990
    721                 log_printf(TRACE,Load_store_unit,FUNCTION,"    * packet is a LOAD  : %d", packet_id);
     991                log_printf(TRACE,Load_store_unit,FUNCTION,"    * packet is a LOAD");
    722992 
    723 
    724993#ifdef DEBUG_TEST
    725994                if (not have_dcache_rsp(_load_queue [packet_id]._operation))
     
    7541023                  {
    7551024                    log_printf(TRACE,Load_store_unit,FUNCTION,"    * have no bus error.");
    756                     log_printf(TRACE,Load_store_unit,FUNCTION,"      * previous state : %d.",_load_queue [packet_id]._state);
     1025                    log_printf(TRACE,Load_store_unit,FUNCTION,"      * previous state : %s",toString(_load_queue [packet_id]._state).c_str());
    7571026
    7581027                    // FIXME : convention : if bus error, the cache return the fautive address !
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/config_min.cfg

    r98 r106  
    331       1       +1      # nb_decod_unit
    441       1       +1      # nb_inst_branch_complete
    5 0       0       +1      # size_depth                    [0] [nb_context]
     51       1       +1      # nb_inst_branch_speculated     [0] [nb_context]
    6632      32      +1      # size_general_data             
    771       1       +1      # size_inst_decod               [0] [nb_decod_unit]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/config_mono_context.cfg

    r98 r106  
    331       1       *4      # nb_decod_unit
    441       4       *4      # nb_inst_branch_complete
    5 0       2       +1      # size_depth                    [0] [nb_context]
     51       4       *2      # nb_inst_branch_speculated     [0] [nb_context]
    6632      32      +1      # size_general_data             
    771       4       *4      # size_inst_decod               [0] [nb_decod_unit]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/config_multi_context.cfg

    r98 r106  
    334       4       *4      # nb_decod_unit
    442       2       *4      # nb_inst_branch_complete
    5 4       4       +1      # size_depth                    [0] [nb_context]
    6 2       2       +1      # size_depth                    [1] [nb_context]
    7 1       1       +1      # size_depth                    [2] [nb_context]
    8 0       0       +1      # size_depth                    [3] [nb_context]
    9 4       4       +1      # size_depth                    [4] [nb_context]
    10 2       2       +1      # size_depth                    [5] [nb_context]
    11 1       1       +1      # size_depth                    [6] [nb_context]
    12 0       0       +1      # size_depth                    [7] [nb_context]
     56       6       +1      # nb_inst_branch_speculated     [0] [nb_context]
     63       3       +1      # nb_inst_branch_speculated     [1] [nb_context]
     72       2       +1      # nb_inst_branch_speculated     [2] [nb_context]
     81       1       +1      # nb_inst_branch_speculated     [3] [nb_context]
     98       8       +1      # nb_inst_branch_speculated     [4] [nb_context]
     104       4       +1      # nb_inst_branch_speculated     [5] [nb_context]
     112       2       +1      # nb_inst_branch_speculated     [6] [nb_context]
     121       1       +1      # nb_inst_branch_speculated     [7] [nb_context]
    131332      32      +1      # size_general_data             
    14144       4       *4      # size_inst_decod               [0] [nb_decod_unit]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/src/main.cpp

    r98 r106  
    1717  err (_(" * nb_decod_unit                                 (uint32_t)\n"));
    1818  err (_(" * nb_inst_branch_complete                       (uint32_t)\n"));
    19   err (_(" * size_depth                    [nb_context]    (uint32_t)\n"));
     19  err (_(" * nb_inst_branch_speculated     [nb_context]    (uint32_t)\n"));
    2020  err (_(" * size_general_data                             (uint32_t)\n"));
    2121  err (_(" * size_inst_decod               [nb_decod_unit] (uint32_t)\n"));
     
    4848    usage (argc, argv);
    4949
    50   uint32_t * _size_depth                    = new uint32_t [_nb_context];
     50  uint32_t * _nb_inst_branch_speculated     = new uint32_t [_nb_context];
    5151  for (uint32_t i=0; i<_nb_context; i++)
    52     _size_depth [i] = fromString<uint32_t>(argv[x++]);
     52    _nb_inst_branch_speculated [i] = fromString<uint32_t>(argv[x++]);
    5353
    5454  uint32_t   _size_general_data = fromString<uint32_t>(argv[x++]);
     
    6969         _nb_decod_unit                ,
    7070         _nb_inst_branch_complete      ,
    71          _size_depth                   ,
     71         _nb_inst_branch_speculated    ,
    7272         _size_general_data            ,
    7373         _size_inst_decod              ,
     
    8787    }
    8888
    89   delete [] _size_depth;                   
     89  delete [] _nb_inst_branch_speculated;                   
    9090  delete [] _size_inst_decod;             
    9191  delete [] _link_context_to_decod_unit;   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/src/test.cpp

    r105 r106  
    275275      for (uint32_t i=0; i<_param->_nb_context; i++)
    276276        if (_param->_have_port_depth)
    277           in_DEPTH_MIN  [i]->write((_param->_array_size_depth[i]==0)?0:(i%_param->_array_size_depth[i]));
     277          in_DEPTH_MIN  [i]->write((log2(_param->_nb_inst_branch_speculated[i])==0)?0:(i%log2(_param->_nb_inst_branch_speculated[i])));
    278278     
    279279      uint32_t context    = rand()%_param->_nb_context;
     
    295295          in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdeadbeef);
    296296          if (_param->_have_port_depth)
    297           in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     297          in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    298298          in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_MSYNC);
    299299         
     
    350350          in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdeadbebe);
    351351          if (_param->_have_port_depth)
    352           in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     352          in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    353353          in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_PSYNC);
    354354         
     
    428428          in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdead0300);
    429429          if (_param->_have_port_depth)
    430           in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     430          in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    431431          in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_CSYNC);
    432432         
     
    507507          in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdead0400);
    508508          if (_param->_have_port_depth)
    509           in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     509          in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    510510          in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_SPR_ACCESS);
    511511         
     
    559559//        in_BRANCH_COMPLETE_CONTEXT_ID       [port]->write(context);
    560560//        if (_param->_have_port_depth)
    561 //        in_BRANCH_COMPLETE_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     561//        in_BRANCH_COMPLETE_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    562562//        in_BRANCH_COMPLETE_ADDRESS_SRC      [port]->write(0x400);
    563563//        in_BRANCH_COMPLETE_ADDRESS_DEST     [port]->write(0x500);
     
    580580         
    581581          if (_param->_have_port_depth)
    582           in_BRANCH_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     582          in_BRANCH_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    583583          in_BRANCH_EVENT_ADDRESS_SRC      [port]->write(0x400);
    584584          in_BRANCH_EVENT_ADDRESS_DEST     [port]->write(0x500);
     
    649649//        in_BRANCH_COMPLETE_CONTEXT_ID       [port]->write(context);
    650650//        if (_param->_have_port_depth)
    651 //        in_BRANCH_COMPLETE_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     651//        in_BRANCH_COMPLETE_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    652652//        in_BRANCH_COMPLETE_ADDRESS_SRC      [port]->write(0x600);
    653653//        in_BRANCH_COMPLETE_ADDRESS_DEST     [port]->write(0x700);
     
    669669          uint32_t port = context;
    670670         
    671           in_BRANCH_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     671          in_BRANCH_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    672672          in_BRANCH_EVENT_ADDRESS_SRC      [port]->write(0x600);
    673673          in_BRANCH_EVENT_ADDRESS_DEST     [port]->write(0x700);
     
    736736          in_DECOD_EVENT_CONTEXT_ID       [port]->write(context);
    737737          if (_param->_have_port_depth)
    738           in_DECOD_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     738          in_DECOD_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    739739          in_DECOD_EVENT_TYPE             [port]->write(EVENT_TYPE_EXCEPTION);
    740740          in_DECOD_EVENT_IS_DELAY_SLOT    [port]->write(0);
     
    830830          in_DECOD_EVENT_CONTEXT_ID       [port]->write(context);
    831831          if (_param->_have_port_depth)
    832           in_DECOD_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     832          in_DECOD_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    833833          in_DECOD_EVENT_TYPE             [port]->write(EVENT_TYPE_EXCEPTION);
    834834          in_DECOD_EVENT_IS_DELAY_SLOT    [port]->write(1);
     
    922922          in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
    923923          if (_param->_have_port_depth)
    924           in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     924          in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    925925          in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
    926926          in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(0);
     
    10171017          in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
    10181018          if (_param->_have_port_depth)
    1019           in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     1019          in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    10201020          in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
    10211021          in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(1);
     
    11121112          in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
    11131113          if (_param->_have_port_depth)
    1114           in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     1114          in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    11151115          in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
    11161116          in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(0);
     
    12071207          in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
    12081208          if (_param->_have_port_depth)
    1209           in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     1209          in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    12101210          in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
    12111211          in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(1);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Parameters.h

    r98 r106  
    2727  public : uint32_t   _nb_decod_unit                ;
    2828  public : uint32_t   _nb_inst_branch_complete      ;
    29   public : uint32_t * _array_size_depth             ; //[nb_context]
     29  public : uint32_t * _nb_inst_branch_speculated    ; //[nb_context]
    3030//public : uint32_t * _size_depth                   ; //[nb_context]
    3131//public : uint32_t   _size_general_data            ;
     
    3838                        uint32_t   nb_decod_unit,
    3939                        uint32_t   nb_inst_branch_complete,
    40                         uint32_t * size_depth,               
     40                        uint32_t * nb_inst_branch_speculated,
    4141                        uint32_t   size_general_data,
    4242                        uint32_t * size_nb_inst_decod,           
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp

    r105 r106  
    196196              log_printf(TRACE,Context_State,FUNCTION,"  * BRANCH_EVENT [%d]",i);
    197197
    198 //               throw ERRORMORPHEO(FUNCTION,_("Not yet implemented (Comming Soon).\n"));
    199 
    200198              context_state_t state = reg_STATE [i];
    201199
     
    203201              Tdepth_t   depth_cur  = reg_EVENT_DEPTH [i];
    204202              Tdepth_t   depth_min  = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [i]):0;
    205               Tdepth_t   depth_max  = _param->_array_size_depth [i];
     203              Tdepth_t   depth_max  = _param->_nb_inst_branch_speculated [i];
    206204             
    207 //               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
    208 //               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
    209               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
    210               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
     205              Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
     206              Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
     207//               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
     208//               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
    211209
    212210              // priority : miss > excep > spr/sync
    213               uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR) or (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR) or (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND))?2:((state == EVENT_TYPE_EXCEPTION)?1:0);
     211              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR   ) or
     212                                       (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR     ) or
     213                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or
     214                                       (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND  ))?2:((state == EVENT_TYPE_EXCEPTION)?1:0);
    214215              uint8_t    priority1  = 2; // miss
    215216
     
    217218              //   if context_state_ok : yes
    218219              //   if context_state_ko : test the depth, and the priority of event
    219 
    220220              bool       is_valid   = ((state == CONTEXT_STATE_OK) or
    221221                                       (depth1< depth0) or
    222222                                       ((depth1==depth0) and (priority1>=priority0))); // >= because another branch can be a miss prediction with same depth
     223
     224              log_printf(TRACE,Context_State,FUNCTION,"    * depth     : %d",depth     );
     225              log_printf(TRACE,Context_State,FUNCTION,"    * depth_cur : %d",depth_cur );
     226              log_printf(TRACE,Context_State,FUNCTION,"    * depth_min : %d",depth_min );
     227              log_printf(TRACE,Context_State,FUNCTION,"    * depth_max : %d",depth_max );
     228              log_printf(TRACE,Context_State,FUNCTION,"    * depth0    : %d",depth0    );
     229              log_printf(TRACE,Context_State,FUNCTION,"    * depth1    : %d",depth1    );
     230              log_printf(TRACE,Context_State,FUNCTION,"    * priority0 : %d",priority0 );
     231              log_printf(TRACE,Context_State,FUNCTION,"    * priority1 : %d",priority1 );
     232              log_printf(TRACE,Context_State,FUNCTION,"  * is_valid    : %d",is_valid  );
    223233
    224234              if (is_valid)
     
    251261              Tdepth_t   depth_cur  = reg_EVENT_DEPTH [context];
    252262              Tdepth_t   depth_min = (_param->_have_port_depth      )?PORT_READ(in_DEPTH_MIN [context]):0;
    253               Tdepth_t   depth_max  = _param->_array_size_depth [context];
     263              Tdepth_t   depth_max  = _param->_nb_inst_branch_speculated [context];
    254264             
    255 //               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
    256 //               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
    257               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
    258               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
     265              Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
     266              Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
     267//               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
     268//               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
    259269
    260270              context_state_t state = reg_STATE [context];
     
    262272             
    263273              // miss > excep > spr/sync
    264               uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR) or (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR) or (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
     274              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR   ) or
     275                                       (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR     ) or
     276                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or
     277                                       (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND  ))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
    265278              uint8_t    priority1  = (state == EVENT_TYPE_EXCEPTION)?1:0;
    266279
     
    272285                                       (depth1< depth0) or
    273286                                       ((depth1==depth0) and (priority1>=priority0)));
     287
     288              log_printf(TRACE,Context_State,FUNCTION,"    * depth     : %d",depth     );
     289              log_printf(TRACE,Context_State,FUNCTION,"    * depth_cur : %d",depth_cur );
     290              log_printf(TRACE,Context_State,FUNCTION,"    * depth_min : %d",depth_min );
     291              log_printf(TRACE,Context_State,FUNCTION,"    * depth_max : %d",depth_max );
     292              log_printf(TRACE,Context_State,FUNCTION,"    * depth0    : %d",depth0    );
     293              log_printf(TRACE,Context_State,FUNCTION,"    * depth1    : %d",depth1    );
     294              log_printf(TRACE,Context_State,FUNCTION,"    * priority0 : %d",priority0 );
     295              log_printf(TRACE,Context_State,FUNCTION,"    * priority1 : %d",priority1 );
     296              log_printf(TRACE,Context_State,FUNCTION,"  * is_valid    : %d",is_valid  );
    274297
    275298              if (is_valid)
     
    371394            Tdepth_t   depth_cur  = reg_EVENT_DEPTH [context];
    372395            Tdepth_t   depth_min = (_param->_have_port_depth     )?PORT_READ(in_DEPTH_MIN [context]):0;
    373             Tdepth_t   depth_max  = _param->_array_size_depth [context];
     396            Tdepth_t   depth_max  = _param->_nb_inst_branch_speculated [context];
    374397           
    375 //          Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
    376 //          Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
    377             Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
    378             Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
     398            Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
     399            Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
     400//             Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
     401//             Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
    379402
    380403            context_state_t state = reg_STATE [context];
     
    382405           
    383406            // miss > excep > spr/sync
    384             uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR) or (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR) or (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
     407            uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR   ) or
     408                                     (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR     ) or
     409                                     (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or
     410                                     (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND  ))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
    385411            uint8_t    priority1  = (state == EVENT_TYPE_EXCEPTION)?1:2; // else load_miss_speculation (EVENT_TYPE_MISS_SPECULATION)
    386412
     
    392418                                     (depth1< depth0) or
    393419                                     ((depth1==depth0) and (priority1>=priority0)));
     420
     421            log_printf(TRACE,Context_State,FUNCTION,"    * depth     : %d",depth     );
     422            log_printf(TRACE,Context_State,FUNCTION,"    * depth_cur : %d",depth_cur );
     423            log_printf(TRACE,Context_State,FUNCTION,"    * depth_min : %d",depth_min );
     424            log_printf(TRACE,Context_State,FUNCTION,"    * depth_max : %d",depth_max );
     425            log_printf(TRACE,Context_State,FUNCTION,"    * depth0    : %d",depth0    );
     426            log_printf(TRACE,Context_State,FUNCTION,"    * depth1    : %d",depth1    );
     427            log_printf(TRACE,Context_State,FUNCTION,"    * priority0 : %d",priority0 );
     428            log_printf(TRACE,Context_State,FUNCTION,"    * priority1 : %d",priority1 );
     429            log_printf(TRACE,Context_State,FUNCTION,"  * is_valid    : %d",is_valid  );
    394430
    395431            if (is_valid)
     
    427463
    428464        // -------------------------------------------------------------------
    429         // -----[ BRANCH_COMPLETE ]-------------------------------------------
    430         // -------------------------------------------------------------------
    431 
    432 //         for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
    433 //           if (PORT_READ(in_BRANCH_COMPLETE_VAL [i]) and internal_BRANCH_COMPLETE_ACK [i])
    434 //             {
    435 //               log_printf(TRACE,Context_State,FUNCTION,"  * BRANCH_COMPLETE [%d]",i);
    436 //               if (PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i]))
    437 //                 {
    438 //                   Tcontext_t context    = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0;
    439 //                   Tdepth_t   depth      = (_param->_have_port_depth     )?PORT_READ(in_BRANCH_COMPLETE_DEPTH      [i]):0;
    440 //                   Tdepth_t   depth_cur  = reg_EVENT_DEPTH [context];
    441 //                   Tdepth_t   depth_min = (_param->_have_port_depth     )?PORT_READ(in_DEPTH_MIN [context]):0;
    442 //                   Tdepth_t   depth_max  = _param->_array_size_depth [context];
    443                  
    444 // //                   Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
    445 // //                   Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
    446 //                   Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
    447 //                   Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
    448                  
    449 //                   context_state_t state = reg_STATE [context];
    450                  
    451 //                   // miss > excep > spr/sync
    452 //                   uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR) or (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR) or (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
    453 //                   uint8_t    priority1  = 2; // miss
    454                  
    455 //                   // is_valid = can modify local information
    456 //                   //  if context_state_ok : yes
    457 //                   //  if context_state_ko : test the depth, and the priority of envent
    458                  
    459 //                   bool       is_valid   = ((state == CONTEXT_STATE_OK) or
    460 //                                            (depth1< depth0) or
    461 //                                            ((depth1==depth0) and (priority1>=priority0)));
    462                  
    463 //                   if (is_valid)
    464 //                     {
    465 //                       // commit
    466 //                       Tcontrol_t take = PORT_READ(in_BRANCH_COMPLETE_TAKE [i]);
    467 //                       reg_STATE                  [context] = CONTEXT_STATE_KO_MISS;
    468 //                       reg_EVENT_ADDRESS          [context] = PORT_READ(in_BRANCH_COMPLETE_ADDRESS_SRC  [i])+1; //DELAY_SLOT
    469 //                       reg_EVENT_ADDRESS_EPCR     [context] = PORT_READ(in_BRANCH_COMPLETE_ADDRESS_DEST [i]);
    470 //                       reg_EVENT_ADDRESS_EPCR_VAL [context] = take; // if not take : in sequence
    471 //                     //reg_EVENT_ADDRESS_EEAR     [context];
    472 //                       reg_EVENT_ADDRESS_EEAR_VAL [context] = 0;
    473 //                       reg_EVENT_IS_DELAY_SLOT    [context] = take;
    474 //                       reg_EVENT_IS_DS_TAKE       [context] = take;
    475 //                       reg_EVENT_DEPTH            [context] = depth;
    476 //                     }
    477 //                 }
    478 //             }
    479 
    480         // -------------------------------------------------------------------
    481465        // -----[ EVENT ]-----------------------------------------------------
    482466        // -------------------------------------------------------------------
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Parameters.cpp

    r98 r106  
    2222                          uint32_t   nb_decod_unit,
    2323                          uint32_t   nb_inst_branch_complete,
    24                           uint32_t * size_depth,               
     24                          uint32_t * nb_inst_branch_speculated,               
    2525                          uint32_t   size_general_data,
    2626                          uint32_t * size_nb_inst_decod,           
     
    3434    _nb_decod_unit                 = nb_decod_unit                ;
    3535    _nb_inst_branch_complete       = nb_inst_branch_complete      ;
    36     _array_size_depth              = size_depth                   ;
     36    _nb_inst_branch_speculated     = nb_inst_branch_speculated    ;
    3737//  _size_general_data             = size_general_data            ;
    3838//  _size_nb_inst_decod            = size_nb_inst_decod           ;
     
    4545      {
    4646        _size_context_id               = log2(_nb_context);
    47         _size_depth                    = log2(max<uint32_t>(size_depth,_nb_context));
     47        _size_depth                    = log2(max<uint32_t>(nb_inst_branch_speculated,_nb_context));
    4848        _size_general_data             = size_general_data;
    4949        _size_instruction_address      = size_general_data-2;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_genMealy_decod_out.cpp

    r105 r106  
    8585            else
    8686              {
    87                 // Cusume the instruction (to erase)
     87                // Consume the instruction (to erase)
    8888                internal_DECOD_OUT_ACK [i] = 1;
    8989              }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_predict.cpp

    r101 r106  
    144144                //   * BTB hit and the branchement is the PC current and it's the last slot.
    145145                //     -> next pc must be the delay slot
    146                 if ((not pc_current_is_ds_take) and // if pc_current is ds_take, alors pc_next is the destination of branchement
     146                if ((not pc_current_is_ds_take) and // if pc_current is ds_take, then pc_next is the destination of branchement
    147147                    (address_src_lsb == (_param->_nb_instruction [context]-1)))
    148148                  {
     
    173173                          log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"      * BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK");
    174174                         
    175                           // use none unit (dir, upt and ras)
     175                          // use none unit (dir and ras)
     176                          use_upt      = true;
    176177                          direction    = true;
    177178                          pc_next      = address_dest;
     
    324325                               );
    325326                   
     327                    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * btb_{     val, ack}   :    %d, %d",        btb_val, btb_ack);
     328                    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * dir_{use, val, ack}   : %d, %d, %d",use_dir,dir_val, dir_ack);
     329                    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * ras_{use, val, ack}   : %d, %d, %d",use_ras,ras_val, ras_ack);
     330                    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * upt_{use, val, ack}   : %d, %d, %d",use_upt,upt_val, upt_ack);
     331
     332                   
    326333//                  pc_next      - is previously computed
    327334//                  branch_state - is previously computed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp

    r105 r106  
    14241424                 (upt_top    [context] != out_DEPTH_MAX [context]->read()))
    14251425            SC_START(1);
    1426 
    14271426        }
    14281427      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h

    r105 r106  
    4747      UPDATE_PREDICTION_STATE_KO                , // this branch is a miss prediction
    4848      UPDATE_PREDICTION_STATE_EVENT             , // previous branch is a miss prediction
    49       UPDATE_PREDICTION_STATE_END_OK            , // branch is updated,       update pointer
    50       UPDATE_PREDICTION_STATE_END_KO_WAIT_END   , // branch is updated, don't update pointer
     49      UPDATE_PREDICTION_STATE_END               , // update pointer
     50//    UPDATE_PREDICTION_STATE_END_OK            , // branch is updated,       update pointer
     51//    UPDATE_PREDICTION_STATE_END_KO_WAIT_END   , // branch is updated, don't update pointer
    5152      UPDATE_PREDICTION_STATE_END_KO              // branch is updated, don't update pointer
    5253    } upt_state_t;
     
    153154      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_KO         : return "ko"        ; break;
    154155      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_EVENT      : return "event"     ; break;
    155       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_OK     : return "end_ok"    ; break;
    156       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_KO_WAIT_END: return "end_ko_wait_end"    ; break;
     156      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END        : return "end"       ; break;
     157//    case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_OK     : return "end_ok"    ; break;
     158//    case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_KO_WAIT_END: return "end_ko_wait_end"    ; break;
    157159      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_KO     : return "end_ko"    ; break;
    158160      default    : return ""      ; break;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h

    r105 r106  
    168168  private   : uint32_t                      * reg_UFPT_UPDATE                    ; //[nb_context]
    169169  private   : uint32_t                      * reg_UFPT_NB_NEED_UPDATE            ; //[nb_context]
     170  private   : uint32_t                      * reg_UFPT_NB_UPDATE                 ; //[nb_context]
    170171                                                                                             
    171172  private   : upt_entry_t                  ** reg_UPDATE_PREDICTION_TABLE        ; //[nb_context][size_upt_queue]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp

    r105 r106  
    197197    ALLOC1(reg_UFPT_UPDATE                  ,uint32_t     ,_param->_nb_context);
    198198    ALLOC1(reg_UFPT_NB_NEED_UPDATE          ,uint32_t     ,_param->_nb_context);
     199    ALLOC1(reg_UFPT_NB_UPDATE               ,uint32_t     ,_param->_nb_context);
    199200                                                         
    200201    ALLOC2(reg_UPDATE_PREDICTION_TABLE      ,upt_entry_t  ,_param->_nb_context,_param->_size_upt_queue[it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp

    r105 r106  
    150150        DELETE1(reg_UFPT_UPDATE                  ,_param->_nb_context);
    151151        DELETE1(reg_UFPT_NB_NEED_UPDATE          ,_param->_nb_context);
     152        DELETE1(reg_UFPT_NB_UPDATE               ,_param->_nb_context);
    152153       
    153154        DELETE2(reg_UPDATE_PREDICTION_TABLE      ,_param->_nb_context,_param->_size_upt_queue[it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp

    r105 r106  
    6161    bool     retire_ras_from_ufpt [_param->_nb_context]; // event ufpt -> restore RAS, else update upt
    6262    bool     retire_ras_from_upt  [_param->_nb_context]; // event upt  -> restore RAS, else restore others structure
    63 //     bool     have_event           [_param->_nb_context];
     63//  bool     have_event           [_param->_nb_context];
    6464    bool     ufpt_update          [_param->_nb_context];
    6565    bool     upt_update           [_param->_nb_context];
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp

    r105 r106  
    3939            reg_UFPT_UPDATE          [i] = 0;
    4040            reg_UFPT_NB_NEED_UPDATE  [i] = 0;
     41            reg_UFPT_NB_UPDATE       [i] = 0;
    4142                                                               
    4243            for (uint32_t j=0; j<_param->_size_upt_queue[i]; ++j)
     
    9293            {
    9394              uint32_t      bottom      = reg_UPT_BOTTOM [i];
    94               bool          end_ok      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_OK);
    95               bool          end_ko      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_KO);
     95              bool          end         = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END);
     96//               bool          end_ok      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_OK);
     97//               bool          end_ko      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_KO);
    9698//               event_state_t event_state = reg_EVENT_STATE [i];
    9799
    98100              // Test if state is end
    99 //               if ((end_ok or end_ko) and
    100 //                   ((event_state != EVENT_STATE_UPDATE_CONTEXT) and
    101 //                    (event_state != EVENT_STATE_WAIT_END_EVENT)))
    102               if (end_ok or end_ko)
     101//               if (end_ok or end_ko)
     102              if (end)
    103103                {
    104104                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT [%d][%d]",i,bottom);
    105105                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT [%d][%d]._state =  UPDATE_PREDICTION_STATE_EMPTY",i,bottom);
    106 
    107106                  // Free slot
    108107                  reg_UPDATE_PREDICTION_TABLE [i][bottom]._state = UPDATE_PREDICTION_STATE_EMPTY;
     
    110109                  // Update pointer
    111110                  reg_UPT_BOTTOM [i] = (bottom+1)%_param->_size_upt_queue[i];
    112 
     111                 
    113112                  if (reg_UPT_BOTTOM [i] == reg_UPT_TOP [i])
    114113                    reg_UPT_EMPTY [i] = true; // free a slot
     
    118117
    119118                  if (reg_EVENT_VAL [i] and (reg_EVENT_UPT_PTR [i] == bottom))
    120 //                   if (end_ko) // free
    121119                    {
    122120                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * END EVENT");
     
    129127                        reg_UPT_EMPTY [i] = false;
    130128                    }
     129
    131130                }
    132131            }
    133132          }
     133
    134134        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * GARBAGE COLLECTOR (END)");
    135135
     
    450450                      // if free a slot, also all queue is updated
    451451                      // Last slot ?
    452                       if (reg_UFPT_UPDATE [context] == reg_UFPT_BOTTOM [context])
     452//                       if (reg_UFPT_UPDATE [context] == reg_UFPT_BOTTOM [context])
     453                      if ((--reg_UFPT_NB_UPDATE [context])==0)
    453454                        switch (reg_EVENT_STATE [context])
    454455                          {
     
    472473                     
    473474                      reg_UPDATE_FETCH_PREDICTION_TABLE [context][depth]._state = UPDATE_FETCH_PREDICTION_STATE_END;
    474                      
    475                      
     475                                           
    476476                      // Update pointer
    477477                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_UPDATE (before) : %d",reg_UFPT_UPDATE [context]);
     
    531531                      else
    532532                        {
    533                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_OK (update)",context,depth);
    534                          
    535                           reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_OK;
    536 
     533//                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_OK (update)",context,depth);
     534//                           reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_OK;
     535
     536                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END (update)",context,depth);
     537                          reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END;
    537538
    538539#ifdef STATISTICS
     
    650651                    reg_EVENT_STATE [i] = EVENT_STATE_OK;
    651652                    reg_IS_ACCURATE [i] = true;
    652                    
    653 //                  Tdepth_t depth = reg_UPT_TOP [i];
    654 
    655 #ifdef DEBUG_TEST
    656 //                  if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO_WAIT_END)
    657 //                    throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
     653
     654                    Tdepth_t depth = reg_EVENT_UPT_PTR [i];
     655
     656                    if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state == UPDATE_PREDICTION_STATE_END_KO)
     657                      {
     658                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END (event)",i,depth);
     659                       
     660                        reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END;
     661                      }
     662
     663#ifdef DEBUG_TEST
     664//                     if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO_WAIT_END)
     665//                       throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
    658666//                  if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO)
    659667//                    throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
    660668#endif
    661                  
    662 //                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",i,depth);
    663                          
    664 //                  reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
    665 
     669
     670//                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",i,depth);
     671                   
     672//                     reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
     673                   
    666674                    break;
    667675                  }
     
    685693                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * new_update : %d",new_update);
    686694
    687                    
    688 #ifdef DEBUG_TEST
    689                     if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_WAIT_END)
    690                       throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state."));
    691 #endif
    692 
    693                     // flush all slot after the event
    694                     for (uint32_t j=depth;
    695                          j!=top;
    696                          j=(j+1)%_param->_size_upt_queue[i])
    697                       reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
    698                      
    699                     // test full :
    700                     if (full)
    701                       reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
     695                    // Test empty
     696                    if (not reg_UPT_EMPTY [i])
     697                      {
     698#ifdef DEBUG_TEST
     699                        if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_WAIT_END)
     700                          throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state."));
     701#endif
     702                        reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
     703
     704                        // flush all slot after the event
     705                        for (uint32_t j=(depth+1)%_param->_size_upt_queue[i];
     706                             j!=top;
     707                             j=(j+1)%_param->_size_upt_queue[i])
     708                          reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
     709                      }
    702710             
    703711//                  reg_UPT_BOTTOM    [i];
     
    802810                {
    803811                  for (uint32_t j=0; j<_param->_size_ufpt_queue[i]; ++j)
    804                     reg_UPDATE_FETCH_PREDICTION_TABLE [i][j]._state = UPDATE_FETCH_PREDICTION_STATE_EVENT;
    805                  
     812                    {
     813                      reg_UFPT_NB_UPDATE [i] ++;
     814                      reg_UPDATE_FETCH_PREDICTION_TABLE [i][j]._state = UPDATE_FETCH_PREDICTION_STATE_EVENT;
     815                    }
     816
    806817                  // TOP is next write slot : last slot is TOP-1
    807818                  uint32_t top = reg_UFPT_TOP [i];
    808                   reg_UFPT_UPDATE [i] = ((top==0)?_param->_size_ufpt_queue[i]:top)-1;
    809                  
    810 //                reg_UFPT_BOTTOM [i];
    811 //                reg_UFPT_TOP    [i];
     819                  reg_UFPT_UPDATE    [i] = ((top==0)?_param->_size_ufpt_queue[i]:top)-1;
     820
     821//                reg_UFPT_BOTTOM    [i];
     822//                reg_UFPT_TOP       [i];
    812823                }
    813824
     
    853864        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UFPT_UPDATE         : %d",reg_UFPT_UPDATE         [i]);
    854865        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UFPT_NB_NEED_UPDATE : %d",reg_UFPT_NB_NEED_UPDATE [i]);
     866        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UFPT_NB_UPDATE      : %d",reg_UFPT_NB_UPDATE      [i]);
    855867        for (uint32_t j=0; j<_param->_size_ufpt_queue[i]; j++)
    856868          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"        [%d] %.4d, %.8x %.8x, %.1d   %.1d, %.8d %.8x %.4d - %s",
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/include/Parameters.h

    r95 r106  
    8080//public : uint32_t                _size_context_id                      ;
    8181//public : uint32_t                _size_address                         ;
     82  public : uint32_t              * _array_size_depth                     ;//[nb_context]
    8283  public : uint32_t              * _array_size_nb_inst_decod             ;//[nb_decod_unit]
    83   public : uint32_t              * _array_size_depth                     ;//[nb_context]
    8484//public : uint32_t                _max_size_depth                       ;
    8585//public : uint32_t              * _size_ifetch_queue_ptr                ;//[nb_context]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Parameters.cpp

    r95 r106  
    100100//  _size_context_id                     = log2(_nb_context);
    101101    uint32_t size_instruction_address   = size_general_data - 2;
    102    
     102
    103103    _array_size_depth                   = new uint32_t [_nb_context];
    104104    for (uint32_t i=0; i<_nb_context; i++)
    105105      _array_size_depth [i] = log2(_upt_size_queue[i]);
    106 
     106   
    107107    _array_size_nb_inst_decod = new uint32_t [_nb_decod_unit];
    108108    for (uint32_t i=0; i<_nb_decod_unit; i++)
     
    221221       _nb_decod_unit,
    222222       _nb_inst_branch_complete,
    223        _array_size_depth,               
     223       _upt_size_queue,               
    224224        size_instruction_address,
    225225       _array_size_nb_inst_decod,           
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp

    r105 r106  
    364364                  reg_PC_CURRENT_IS_DS_TAKE [front_end_id][context_id] = entry->no_sequence;
    365365                  reg_PC_NEXT               [front_end_id][context_id] = (entry->no_sequence)?(entry->address_next):(reg_PC_CURRENT [front_end_id][context_id]+1);
     366
     367//                   if (entry->address_next != reg_PC_NEXT [front_end_id][context_id])
     368//                     throw ERRORMORPHEO(FUNCTION,toString(_("Retire : Instruction's address_next (%.8x) is different of commit_unit's address_next (%.8x)"),entry->address_next,reg_PC_NEXT [front_end_id][context_id]));
    366369                }
    367370
     
    606609          log_printf(TRACE,Commit_unit,FUNCTION,"    * num_inst_all : %d",reg_NB_INST_COMMIT_ALL[i][j]);
    607610          log_printf(TRACE,Commit_unit,FUNCTION,"    * num_inst_mem : %d",reg_NB_INST_COMMIT_MEM[i][j]);
    608           log_printf(TRACE,Commit_unit,FUNCTION,"    * PC_CURRENT   : %.8x - %d %d",reg_PC_CURRENT [i][j], reg_PC_CURRENT_IS_DS [i][j], reg_PC_CURRENT_IS_DS_TAKE [i][j]);
    609           log_printf(TRACE,Commit_unit,FUNCTION,"    * PC_NEXT      : %.8x",reg_PC_NEXT [i][j]);
     611          log_printf(TRACE,Commit_unit,FUNCTION,"    * PC_CURRENT   : %.8x (%.8x) - %d %d",reg_PC_CURRENT [i][j],reg_PC_CURRENT [i][j]<<2, reg_PC_CURRENT_IS_DS [i][j], reg_PC_CURRENT_IS_DS_TAKE [i][j]);
     612          log_printf(TRACE,Commit_unit,FUNCTION,"    * PC_NEXT      : %.8x (%.8x)",reg_PC_NEXT [i][j],reg_PC_NEXT [i][j]<<2);
    610613        }
    611614       
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/src/Free_List_unit_transition.cpp

    r88 r106  
    7979
    8080#if (DEBUG >= DEBUG_TRACE) and (DEBUG_Free_List_unit == true)
    81         log_printf(TRACE,Free_List_unit,FUNCTION,"  * Dump Free List");
     81        {
     82          uint32_t limit = 4;
     83     
     84          log_printf(TRACE,Free_List_unit,FUNCTION,"  * Dump Free List");
     85         
     86          for (uint32_t i=0; i<_param->_nb_bank; ++i)
     87            {
     88              uint32_t j=0;
     89              for (std::list<Tgeneral_address_t>::iterator it=_gpr_list->begin();
     90                   it!=_gpr_list->end();
     91                   )
     92                {
     93                  std::string str = "";
     94             
     95                  for (uint32_t x=0; x<limit; x++)
     96                    {
     97                      if (it==_gpr_list->end())
     98                        break;
     99                      else
     100                        str+=toString("GPR[%.4d][%.4d] : %.5d | ",i,j,*it);
     101                      ++it;
     102                      ++j;
     103                    }
     104                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
     105                }
     106            }
    82107
    83         for (uint32_t i=0; i<_param->_nb_bank; ++i)
     108          for (uint32_t i=0; i<_param->_nb_bank; ++i)
     109            {
     110              uint32_t j=0;
     111              for (std::list<Tspecial_address_t>::iterator it=_spr_list->begin();
     112                   it!=_spr_list->end();
     113                   )
     114                {
     115                  std::string str = "";
     116
     117                  for (uint32_t x=0; x<limit; x++)
     118                    {
     119                      if (it==_spr_list->end())
     120                        break;
     121                      else
     122                        str+=toString("SPR[%.4d][%.4d] : %.5d | ",i,j,*it);
     123                      ++it;
     124                      ++j;
     125                    }
     126                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
     127                }
     128            }
     129        }
     130#endif
     131
     132#ifdef DEBUG_TEST
     133        if (1)
    84134          {
    85             uint32_t j=0;
    86             for (std::list<Tgeneral_address_t>::iterator it=_gpr_list->begin();
    87                  it!=_gpr_list->end();
    88                  ++it)
     135            for (std::list<Tgeneral_address_t>::iterator it1=_gpr_list->begin();
     136                 it1!=_gpr_list->end();
     137                 ++it1
     138                 )
    89139              {
    90                 log_printf(TRACE,Free_List_unit,FUNCTION,"    * GPR_LIST[%.5d][%.5d] : %.5d",i,j,*it);
    91                 ++j;
     140                std::list<Tgeneral_address_t>::iterator it2 = it1;
     141
     142                it2 ++;
     143                while (it2 != _gpr_list->end())
     144                  {
     145                    if (*it1 == *it2)
     146                      throw ERRORMORPHEO (FUNCTION,toString(_("In free list, Same GPR (%d)"),*it1));
     147                    it2 ++;
     148                  }
     149              }
     150
     151            for (std::list<Tspecial_address_t>::iterator it1=_spr_list->begin();
     152                 it1!=_spr_list->end();
     153                 ++it1
     154                 )
     155              {
     156                std::list<Tspecial_address_t>::iterator it2 = it1;
     157
     158                it2 ++;
     159                while (it2 != _spr_list->end())
     160                  {
     161                    if (*it1 == *it2)
     162                      throw ERRORMORPHEO (FUNCTION,toString(_("In free list, Same SPR (%d)"),*it1));
     163                    it2 ++;
     164                  }
    92165              }
    93166          }
    94         for (uint32_t i=0; i<_param->_nb_bank; ++i)
    95           {
    96             uint32_t j=0;
    97             for (std::list<Tspecial_address_t>::iterator it=_spr_list->begin();
    98                  it!=_spr_list->end();
    99                  ++it)
    100               {
    101                 log_printf(TRACE,Free_List_unit,FUNCTION,"    * SPR_LIST[%.5d][%.5d] : %.5d",i,j,*it);
    102                 ++j;
    103               }
    104           }
     167#endif
    105168
    106 #endif
    107169      }
    108170
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/SelfTest/src/test.cpp

    r104 r106  
    245245              in_INSERT_WRITE_RE        [i]->write(rand() % 2);
    246246              in_INSERT_NUM_REG_RD_LOG  [i]->write((rand() % (_param->_nb_general_register_logic-1))+1);
    247               in_INSERT_NUM_REG_RE_LOG  [i]->write( rand() %  _param->_nb_special_register_logic);
    248               in_INSERT_NUM_REG_RD_PHY  [i]->write(rand() % _param->_nb_general_register);
    249               in_INSERT_NUM_REG_RE_PHY  [i]->write(rand() % _param->_nb_special_register);
     247              in_INSERT_NUM_REG_RE_LOG  [i]->write( rand() %  _param->_nb_special_register_logic      );
     248              in_INSERT_NUM_REG_RD_PHY  [i]->write((rand() % (_param->_nb_general_register      -1))+1);
     249              in_INSERT_NUM_REG_RE_PHY  [i]->write( rand() %  _param->_nb_special_register            );
    250250            }
    251251
     
    285285              if (in_INSERT_VAL [i]->read() and out_INSERT_ACK [i]->read())
    286286                {
     287                  // ERROR BECAUSE write same register
    287288                  if (in_INSERT_WRITE_RD [i]->read() == 1)
    288289                    rat_gpr[front_end_id][context_id][in_INSERT_NUM_REG_RD_LOG[i]->read()] = in_INSERT_NUM_REG_RD_PHY[i]->read();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit.cpp

    r104 r106  
    154154        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
    155155          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
    156             sensitive << (*(in_RETIRE_EVENT_STATE [i][j]));
     156            sensitive << (*(in_RETIRE_EVENT_VAL   [i][j]))
     157                      << (*(in_RETIRE_EVENT_STATE [i][j]));
    157158       
    158159# ifdef SYSTEMCASS_SPECIFIC
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_retire.cpp

    r104 r106  
    3030      for (uint32_t j=0; j<_param->_nb_context[i]; j++)
    3131        {
     32          // An event occure
     33          bool no_event = not (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) and (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT));
    3234          for (uint32_t k=0; k<_param->_nb_general_register_logic; ++k)
    33             internal_rat_gpr_update_table [i][j][k] = rat_gpr_update_table [i][j][k];
     35            internal_rat_gpr_update_table [i][j][k] = rat_gpr_update_table [i][j][k] and no_event;
    3436          for (uint32_t k=0; k<_param->_nb_special_register_logic; ++k)
    35             internal_rat_spr_update_table [i][j][k] = rat_spr_update_table [i][j][k];
     37            internal_rat_spr_update_table [i][j][k] = rat_spr_update_table [i][j][k] and no_event;
    3638        }
    3739
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_transition.cpp

    r104 r106  
    6464              Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0;
    6565              Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_CONTEXT_ID   [i]):0;
     66
     67              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end      : %d",front_end_id);
     68              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context        : %d",context_id);
    6669             
    6770              // Test if write
     71              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd       : %d",PORT_READ(in_INSERT_WRITE_RD [i]));
    6872              if (PORT_READ(in_INSERT_WRITE_RD [i]) == 1)
    69                 rat_gpr[front_end_id][context_id][PORT_READ(in_INSERT_NUM_REG_RD_LOG [i])] = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]);
     73                {
     74                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_phy : %d",PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]));
     75                  rat_gpr[front_end_id][context_id][PORT_READ(in_INSERT_NUM_REG_RD_LOG [i])] = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]);
     76                }
     77
     78              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re       : %d",PORT_READ(in_INSERT_WRITE_RE [i]));
    7079              if (PORT_READ(in_INSERT_WRITE_RE [i]) == 1)
    71                 rat_spr[front_end_id][context_id][PORT_READ(in_INSERT_NUM_REG_RE_LOG [i])] = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]);
     80                {
     81                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_phy : %d",PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]));
     82                  rat_spr[front_end_id][context_id][PORT_READ(in_INSERT_NUM_REG_RE_LOG [i])] = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]);
     83                }
    7284            }
    7385
     
    109121              Tevent_state_t     event_state  = PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]);
    110122
     123              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id : %d",front_end_id);
     124              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id   : %d",context_id);
     125              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * event_state  : %d",event_state);
     126
    111127              if (event_state != EVENT_STATE_NO_EVENT)
    112128                {
    113                   log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id : %d",front_end_id);
    114                   log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id   : %d",context_id);
    115                   log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * event_state  : %d",event_state);
    116 
    117129                  // Test if write and have not a previous update
    118130                  if (PORT_READ(in_RETIRE_WRITE_RD [i]) == 1)
     
    150162
    151163#if (DEBUG >= DEBUG_TRACE) and (DEBUG_Register_Address_Translation_unit == true)
    152     log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * Dump RAT (Register_Address_Translation_unit)");
    153     for (uint32_t i=0; i<_param->_nb_front_end; ++i)
    154       for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
    155         {
    156           log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end[%d].context[%d]",i,j);
    157 
    158           for (uint32_t k=0; k<_param->_nb_general_register_logic; ++k)
    159             log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * GPR[%.4d] - %.5d %.1d",k,rat_gpr[i][j][k],rat_gpr_update_table[i][j][k]);
    160 
    161           for (uint32_t k=0; k<_param->_nb_special_register_logic; ++k)
    162             log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * SPR[%.4d] - %.5d %.1d",k,rat_spr[i][j][k],rat_spr_update_table[i][j][k]);
    163         }
     164    {
     165      uint32_t limit = 4;
     166     
     167      log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * Dump RAT (Register_Address_Translation_unit)");
     168      for (uint32_t i=0; i<_param->_nb_front_end; ++i)
     169        for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
     170          {
     171            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end[%d].context[%d]",i,j);
     172         
     173            for (uint32_t k=0; k<_param->_nb_general_register_logic; k+=limit)
     174              {
     175                std::string str = "";
     176                for (uint32_t x=0; x<limit; x++)
     177                  {
     178                    uint32_t index = k+x;
     179                    if (index >= _param->_nb_general_register_logic)
     180                      break;
     181                    else
     182                      str+=toString("GPR[%.4d] - %.5d %.1d | ",index,rat_gpr[i][j][index],rat_gpr_update_table[i][j][index]);
     183                  }
     184                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
     185              }
     186     
     187            for (uint32_t k=0; k<_param->_nb_special_register_logic; k+=limit)
     188              {
     189                std::string str = "";
     190               
     191                for (uint32_t x=0; x<limit; x++)
     192                  {
     193                    uint32_t index = k+x;
     194                    if (index >= _param->_nb_special_register_logic)
     195                      break;
     196                    else
     197                      str+=toString("SPR[%.4d] - %.5d %.1d | ",index,rat_spr[i][j][index],rat_spr_update_table[i][j][index]);
     198                  }
     199                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
     200              }
     201          }
     202    }
     203#endif
     204
     205#ifdef DEBUG_TEST
     206        if (1)
     207          {
     208            for (uint32_t i=0; i<_param->_nb_front_end; ++i)
     209              for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
     210                {
     211                  for (uint32_t x=0; x<_param->_nb_general_register_logic; ++x)
     212                    for (uint32_t y=x+1; y<_param->_nb_general_register_logic; ++y)
     213                      if (rat_gpr[i][j][x] == rat_gpr[i][j][y])
     214                        throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr[%d][%d][%d] == rat_gpr[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr[i][j][x]));
     215                  for (uint32_t x=0; x<_param->_nb_special_register_logic; ++x)
     216                    for (uint32_t y=x+1; y<_param->_nb_special_register_logic; ++y)
     217                      if (rat_spr[i][j][x] == rat_spr[i][j][y])
     218                        throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr[%d][%d][%d] == rat_spr[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr[i][j][x]));
     219                }
     220
     221          }
    164222#endif
    165223
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Stat_List_unit_transition.cpp

    r88 r106  
    4949          if (PORT_READ(in_INSERT_VAL[i]) and internal_INSERT_ACK[i])
    5050            {
     51              log_printf(TRACE,Stat_List_unit,FUNCTION,"  * INSERT [%d]",i);
     52             
    5153              if (PORT_READ(in_INSERT_READ_RA [i]))
    5254                {
    5355                  Tgeneral_address_t num_reg = PORT_READ(in_INSERT_NUM_REG_RA_PHY [i]);
     56
     57                  log_printf(TRACE,Stat_List_unit,FUNCTION,"    * READ_RA  - num_reg     : %d",num_reg);
     58
    5459                  uint32_t bank = num_reg >> _param->_shift_gpr;
    5560                  uint32_t reg  = num_reg  & _param->_mask_gpr ;
     
    6065                {
    6166                  Tgeneral_address_t num_reg = PORT_READ(in_INSERT_NUM_REG_RB_PHY [i]);
     67
     68                  log_printf(TRACE,Stat_List_unit,FUNCTION,"    * READ_RB  - num_reg     : %d",num_reg);
     69
    6270                  uint32_t bank = num_reg >> _param->_shift_gpr;
    6371                  uint32_t reg  = num_reg  & _param->_mask_gpr ;
     
    6876                {
    6977                  Tgeneral_address_t num_reg = PORT_READ(in_INSERT_NUM_REG_RC_PHY [i]);
     78
     79                  log_printf(TRACE,Stat_List_unit,FUNCTION,"    * READ_RC  - num_reg     : %d",num_reg);
     80
    7081                  uint32_t bank = num_reg >> _param->_shift_spr;
    7182                  uint32_t reg  = num_reg  & _param->_mask_spr ;
     
    7687                {
    7788                  Tgeneral_address_t num_reg = PORT_READ(in_INSERT_NUM_REG_RD_PHY_NEW [i]);
     89
     90                  log_printf(TRACE,Stat_List_unit,FUNCTION,"    * WRITE_RD - num_reg     : %d",num_reg);
     91
    7892                  uint32_t bank = num_reg >> _param->_shift_gpr;
    7993                  uint32_t reg  = num_reg  & _param->_mask_gpr ;
     
    8498                {
    8599                  Tgeneral_address_t num_reg = PORT_READ(in_INSERT_NUM_REG_RE_PHY_NEW [i]);
     100
     101                  log_printf(TRACE,Stat_List_unit,FUNCTION,"    * WRITE_RE - num_reg     : %d",num_reg);
     102
    86103                  uint32_t bank = num_reg >> _param->_shift_spr;
    87104                  uint32_t reg  = num_reg  & _param->_mask_spr ;
     
    96113          if (PORT_READ(in_RETIRE_VAL[i]) and internal_RETIRE_ACK[i])
    97114            {
     115              log_printf(TRACE,Stat_List_unit,FUNCTION,"  * RETIRE [%d]",i);
     116
    98117              if (PORT_READ(in_RETIRE_READ_RA [i]))
    99118                {
    100119                  Tgeneral_address_t num_reg = PORT_READ(in_RETIRE_NUM_REG_RA_PHY [i]);
     120
     121                  log_printf(TRACE,Stat_List_unit,FUNCTION,"    * READ_RA  - num_reg     : %d",num_reg);
     122
    101123                  uint32_t bank = num_reg >> _param->_shift_gpr;
    102124                  uint32_t reg  = num_reg  & _param->_mask_gpr ;
     
    107129                {
    108130                  Tgeneral_address_t num_reg = PORT_READ(in_RETIRE_NUM_REG_RB_PHY [i]);
     131
     132                  log_printf(TRACE,Stat_List_unit,FUNCTION,"    * READ_RD  - num_reg     : %d",num_reg);
     133
    109134                  uint32_t bank = num_reg >> _param->_shift_gpr;
    110135                  uint32_t reg  = num_reg  & _param->_mask_gpr ;
     
    115140                {
    116141                  Tgeneral_address_t num_reg = PORT_READ(in_RETIRE_NUM_REG_RC_PHY [i]);
     142
     143                  log_printf(TRACE,Stat_List_unit,FUNCTION,"    * READ_RC  - num_reg     : %d",num_reg);
     144
    117145                  uint32_t bank = num_reg >> _param->_shift_spr;
    118146                  uint32_t reg  = num_reg  & _param->_mask_spr ;
     
    123151                {
    124152                  Tcontrol_t restore_old = PORT_READ(in_RETIRE_RESTORE_RD_PHY_OLD [i]);
     153
     154                  log_printf(TRACE,Stat_List_unit,FUNCTION,"    * WRITE_RD - restore_old : %d",restore_old);
     155
    125156                  {
    126157                    Tgeneral_address_t num_reg = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_OLD [i]);
     158
     159                    log_printf(TRACE,Stat_List_unit,FUNCTION,"    * WRITE_RD - num_reg_old : %d",num_reg);
     160                 
    127161                    uint32_t bank = num_reg >> _param->_shift_gpr;
    128162                    uint32_t reg  = num_reg  & _param->_mask_gpr ;
     
    131165                  {
    132166                    Tgeneral_address_t num_reg = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_NEW [i]);
     167
     168                    log_printf(TRACE,Stat_List_unit,FUNCTION,"    * WRITE_RD - num_reg_new : %d",num_reg);
     169
    133170                    uint32_t bank = num_reg >> _param->_shift_gpr;
    134171                    uint32_t reg  = num_reg  & _param->_mask_gpr ;
     
    140177                {
    141178                  Tcontrol_t restore_old = PORT_READ(in_RETIRE_RESTORE_RE_PHY_OLD [i]);
     179
     180                  log_printf(TRACE,Stat_List_unit,FUNCTION,"    * WRITE_RE - restore_old : %d",restore_old);
     181
    142182                  {
    143183                    Tgeneral_address_t num_reg = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_OLD [i]);
     184
     185                    log_printf(TRACE,Stat_List_unit,FUNCTION,"    * WRITE_RE - num_reg_new : %d",num_reg);
     186
    144187                    uint32_t bank = num_reg >> _param->_shift_spr;
    145188                    uint32_t reg  = num_reg  & _param->_mask_spr ;
     
    148191                  {
    149192                    Tgeneral_address_t num_reg = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_NEW [i]);
     193
     194                    log_printf(TRACE,Stat_List_unit,FUNCTION,"    * WRITE_RE - num_reg_new : %d",num_reg);
     195
    150196                    uint32_t bank = num_reg >> _param->_shift_spr;
    151197                    uint32_t reg  = num_reg  & _param->_mask_spr ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_genMealy_read.cpp

    r81 r106  
    1515namespace registerfile_monolithic    {
    1616
     17#undef  FUNCTION
     18#define FUNCTION "RegisterFile_Monolithic::genMealy_read"
    1719  void RegisterFile_Monolithic::genMealy_read (void)
    1820  {
    19     log_printf(FUNC,RegisterFile,"genMealy_read","Begin");
     21    log_begin(RegisterFile_Monolithic,FUNCTION);
     22    log_function(RegisterFile_Monolithic,FUNCTION,_name.c_str());
    2023
    2124    for (uint32_t i=0; i<_param->_nb_port_read; i++)
     
    3134            Tdata_t    data    = reg_DATA[address];
    3235
    33             log_printf(TRACE,RegisterFile,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
     36            log_printf(TRACE,RegisterFile,FUNCTION,"  * [%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
    3437
    3538            // Write in registerFile
     
    3841        else
    3942          {
    40             //log_printf(TRACE,RegisterFile,"genMealy_read","Read  [%d] : No   transaction",i);
     43            //log_printf(TRACE,RegisterFile,FUNCTION,"Read  [%d] : No   transaction",i);
    4144            PORT_WRITE(out_READ_DATA[i],0);
    4245          }
     
    6063            data = reg_DATA[address];
    6164
    62             log_printf(TRACE,RegisterFile,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
     65            log_printf(TRACE,RegisterFile,FUNCTION,"  * [%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
    6366          }
    6467        else
    6568          {
    66             //log_printf(TRACE,RegisterFile,"genMealy_read","Read  [%d] : No   transaction",i);
     69            //log_printf(TRACE,RegisterFile,FUNCTION,"Read  [%d] : No   transaction",i);
    6770            data = 0;
    6871          }
     
    7174      }
    7275
    73     log_printf(FUNC,RegisterFile,"genMealy_read","End");
    74        
     76    log_end(RegisterFile_Monolithic,FUNCTION);
    7577  };
    7678
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp

    r101 r106  
    1414namespace registerfile               {
    1515namespace registerfile_monolithic    {
     16
     17#undef  FUNCTION
     18#define FUNCTION "RegisterFile_Monolithic::transition"
    1619  void RegisterFile_Monolithic::transition (void)
    1720  {
    18     log_printf(FUNC,RegisterFile,"transition","Begin");
     21    log_begin(RegisterFile_Monolithic,FUNCTION);
     22    log_function(RegisterFile_Monolithic,FUNCTION,_name.c_str());
    1923
    2024    if (_param->_have_init_value and (PORT_READ(in_NRESET) == 0))
     
    3842                Tdata_t    data    = PORT_READ(in_WRITE_DATA   [i]);
    3943               
    40                 log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
     44                log_printf(TRACE,RegisterFile,FUNCTION,"  * [%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
    4145               
    4246                // Write in registerFile
     
    5963                    Tdata_t    data    = PORT_READ(in_READ_WRITE_WDATA  [i]);
    6064                   
    61                     log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
     65                    log_printf(TRACE,RegisterFile,FUNCTION,"  * [%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
    6266                   
    6367                    // Write in registerFile
     
    8286#endif   
    8387
     88#if defined(DEBUG_RegisterFile_Monolithic) and DEBUG_RegisterFile_Monolithic and (DEBUG >= DEBUG_TRACE)
     89    {
     90      log_printf(TRACE,RegisterFile,FUNCTION,"  * Dump RegisterFile");
     91
     92      uint32_t limit = 4;
     93     
     94      for (uint32_t i=0; i<_param->_nb_word; i+=limit)
     95        {
     96          std::string str = "";
     97         
     98          for (uint32_t j=0; j<limit; j++)
     99            {
     100              uint32_t index = i+j;
     101              if (index >= _param->_nb_word)
     102                break;
     103              else
     104                str+=toString("[%.4d] %.8x ",index,reg_DATA[index]);
     105            }
     106
     107          log_printf(TRACE,RegisterFile,FUNCTION,"  %s",str.c_str());
     108        }
     109    }
     110#endif
     111
    84112#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    85113    end_cycle();
    86114#endif
    87     log_printf(FUNC,RegisterFile,"transition","End");
     115
     116    log_end(RegisterFile_Monolithic,FUNCTION);
    88117  };
    89118
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_full_crossbar_genMealy_read.cpp

    r81 r106  
    1717
    1818
     19#undef  FUNCTION
     20#define FUNCTION "RegisterFile_Multi_Banked::full_crossbar_genMealy_read"
    1921  void RegisterFile_Multi_Banked::full_crossbar_genMealy_read (void)
    2022  {
    21     log_printf(FUNC,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read","Begin");
     23    log_begin(RegisterFile_Multi_Banked,FUNCTION);
     24    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
    2225
    2326    bool read_port_use [_param->_nb_bank][_param->_nb_port_read_by_bank];
     
    3235        bool ack = false;
    3336
    34         log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read","read[%d] : %d",i,val);
     37        log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"  * read [%d] : %d",i,val);
    3538
    3639        if (val == true)
     
    4346              address = 0;
    4447
    45             log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * address   : %d",address);
     48            log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * address   : %d",address);
    4649            Taddress_t bank    = address_bank    (address);
    47             log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * bank      : %d",bank   );
     50            log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * bank      : %d",bank   );
    4851
    4952            // Search loop
     
    5962                    Taddress_t num_reg = address_num_reg (address);
    6063
    61                     log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * num_reg   : %d",num_reg);
    62                     log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * bank_port : %d",j);
     64                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * num_reg   : %d",num_reg);
     65                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * bank_port : %d",j);
    6366
    6467                    Tdata_t    data    = reg_DATA[bank][num_reg];
    6568                   
    66                     log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * data      : %d",data);
     69                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * data      : %d",data);
    6770
    6871                    PORT_WRITE(out_READ_DATA [i], data);
     
    7780      }
    7881
    79     log_printf(FUNC,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read","End");
     82    log_end(RegisterFile_Multi_Banked,FUNCTION);
    8083  };
    8184
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_full_crossbar_genMealy_write.cpp

    r81 r106  
    1717
    1818
     19#undef  FUNCTION
     20#define FUNCTION "RegisterFile_Multi_Banked::full_crossbar_genMealy_write"
    1921  void RegisterFile_Multi_Banked::full_crossbar_genMealy_write (void)
    2022  {
    21     log_printf(FUNC,RegisterFile_Multi_Banked,"full_crossbar_genMealy_write","Begin");
     23    log_begin(RegisterFile_Multi_Banked,FUNCTION);
     24    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
    2225
    2326    bool write_port_use [_param->_nb_bank][_param->_nb_port_write_by_bank];
     
    3235        bool ack = false;
    3336
    34         log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_write","write[%d] : %d",i,val);
     37        log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"  * write [%d] : %d",i,val);
    3538
    3639        if (val == true)
     
    4346            else
    4447              address = 0;
    45             log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_write"," * address   : %d",address);
     48            log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * address   : %d",address);
    4649            Taddress_t bank    = address_bank    (address);
    47             log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_write"," * bank      : %d",bank   );
     50            log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * bank      : %d",bank   );
    4851
    4952            // Search loop
     
    6063                    Taddress_t num_reg = address_num_reg (address);
    6164
    62                     log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_write"," * num_reg   : %d",num_reg);
    63                     log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_write"," * bank_port : %d",j      );
     65                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * num_reg   : %d",num_reg);
     66                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * bank_port : %d",j      );
    6467                                   
    6568                    internal_WRITE_NUM_REG [i] = num_reg;
     
    7780      }
    7881
    79     log_printf(FUNC,RegisterFile_Multi_Banked,"full_crossbar_genMealy_write","End");
     82    log_end(RegisterFile_Multi_Banked,FUNCTION);
    8083  };
    8184
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_full_crossbar_transition.cpp

    r81 r106  
    1717
    1818
     19#undef  FUNCTION
     20#define FUNCTION "RegisterFile_Multi_Banked::full_crossbar_genMealy_transition"
    1921  void RegisterFile_Multi_Banked::full_crossbar_transition (void)
    2022  {
    21     log_printf(FUNC,RegisterFile_Multi_Banked,"full_crossbar_transition","Begin");
     23    log_begin(RegisterFile_Multi_Banked,FUNCTION);
     24    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
    2225
    23     log_printf(FUNC,RegisterFile_Multi_Banked,"full_crossbar_transition","End");
     26    log_end(RegisterFile_Multi_Banked,FUNCTION);
    2427  };
    2528
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_genMealy_read.cpp

    r81 r106  
    1717
    1818
     19#undef  FUNCTION
     20#define FUNCTION "RegisterFile_Multi_Banked::genMealy_read"
    1921  void RegisterFile_Multi_Banked::genMealy_read (void)
    2022  {
    21     log_printf(FUNC,RegisterFile_Multi_Banked,"genMealy_read","Begin");
     23    log_begin(RegisterFile_Multi_Banked,FUNCTION);
     24    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
    2225
    2326    // call function pointer
    2427    (this->*function_genMealy_read) ();
    2528
    26 
    27     log_printf(FUNC,RegisterFile_Multi_Banked,"genMealy_read","End");
     29    log_end(RegisterFile_Multi_Banked,FUNCTION);
    2830  };
    2931
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_genMealy_write.cpp

    r81 r106  
    1717
    1818
     19#undef  FUNCTION
     20#define FUNCTION "RegisterFile_Multi_Banked::genMealy_write"
    1921  void RegisterFile_Multi_Banked::genMealy_write (void)
    2022  {
    21     log_printf(FUNC,RegisterFile_Multi_Banked,"genMealy_write","Begin");
     23    log_begin(RegisterFile_Multi_Banked,FUNCTION);
     24    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
    2225
    2326    // call function pointer
    2427    (this->*function_genMealy_write) ();
    2528
    26     log_printf(FUNC,RegisterFile_Multi_Banked,"genMealy_write","End");
     29    log_end(RegisterFile_Multi_Banked,FUNCTION);
    2730  };
    2831
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_partial_crossbar_genMealy_read.cpp

    r81 r106  
    1717
    1818
     19#undef  FUNCTION
     20#define FUNCTION "RegisterFile_Multi_Banked::partial_crossbar_genMealy_read"
    1921  void RegisterFile_Multi_Banked::partial_crossbar_genMealy_read (void)
    2022  {
    21     log_printf(FUNC,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_read","Begin");
     23    log_begin(RegisterFile_Multi_Banked,FUNCTION);
     24    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
    2225
    2326    bool read_port_use [_param->_nb_bank][_param->_nb_port_read_by_bank];
     
    3235        bool ack = false;
    3336
    34         log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read","read[%d] : %d",i,val);
     37        log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"  * read [%d] : %d",i,val);
    3538
    3639        if (val == true)
     
    4245            else
    4346              address = 0;
    44             log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * address   : %d",address);
     47            log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * address   : %d",address);
    4548            Taddress_t bank    = address_bank    (address);
    46             log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * bank      : %d",bank   );
     49            log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * bank      : %d",bank   );
    4750
    4851//          // Search loop
     
    6164                    Taddress_t num_reg = address_num_reg (address);
    6265
    63                     log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * num_reg   : %d",num_reg);
    64                     log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * bank_port : %d",j);
     66                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * num_reg   : %d",num_reg);
     67                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * bank_port : %d",j);
    6568
    6669                    Tdata_t    data    = reg_DATA[bank][num_reg];
    6770                   
    68                     log_printf(TRACE,RegisterFile_Multi_Banked,"full_crossbar_genMealy_read"," * data      : %d",data);
     71                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * data      : %d",data);
    6972
    7073                    PORT_WRITE(out_READ_DATA [i], data);
     
    7982      }
    8083
    81     log_printf(FUNC,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_read","End");
     84    log_end(RegisterFile_Multi_Banked,FUNCTION);
    8285  };
    8386
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_partial_crossbar_genMealy_write.cpp

    r81 r106  
    1717
    1818
     19#undef  FUNCTION
     20#define FUNCTION "RegisterFile_Multi_Banked::partial_crossbar_genMealy_write"
    1921  void RegisterFile_Multi_Banked::partial_crossbar_genMealy_write (void)
    2022  {
    21     log_printf(FUNC,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_write","Begin");
     23    log_begin(RegisterFile_Multi_Banked,FUNCTION);
     24    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
    2225
    2326    bool write_port_use [_param->_nb_bank][_param->_nb_port_write_by_bank];
     
    3134        bool ack = false;
    3235
    33         log_printf(TRACE,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_write","write[%d] : %d",i,val);
     36        log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"  * write [%d] : %d",i,val);
    3437
    3538        if (val == true)
     
    4245            else
    4346              address = 0;
    44             log_printf(TRACE,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_write"," * address   : %d",address);
     47            log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * address   : %d",address);
    4548            Taddress_t bank    = address_bank    (address);
    46             log_printf(TRACE,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_write"," * bank      : %d",bank   );
     49            log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * bank      : %d",bank   );
    4750
    4851//          // Search loop
     
    6164                    Taddress_t num_reg = address_num_reg (address);
    6265
    63                     log_printf(TRACE,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_write"," * num_reg   : %d",num_reg);
    64                     log_printf(TRACE,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_write"," * bank_port : %d",j      );
     66                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * num_reg   : %d",num_reg);
     67                    log_printf(TRACE,RegisterFile_Multi_Banked,FUNCTION,"    * bank_port : %d",j      );
    6568                                   
    6669                    internal_WRITE_NUM_REG [i] = num_reg;
     
    7982      }
    8083
    81     log_printf(FUNC,RegisterFile_Multi_Banked,"partial_crossbar_genMealy_write","End");
     84    log_end(RegisterFile_Multi_Banked,FUNCTION);
    8285  };
    8386
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_partial_crossbar_transition.cpp

    r81 r106  
    1717
    1818
     19#undef  FUNCTION
     20#define FUNCTION "RegisterFile_Multi_Banked::partial_crossbar_transition"
    1921  void RegisterFile_Multi_Banked::partial_crossbar_transition (void)
    2022  {
    21     log_printf(FUNC,RegisterFile_Multi_Banked,"partial_crossbar_transition","Begin");
     23    log_begin(RegisterFile_Multi_Banked,FUNCTION);
     24    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
    2225
    23     log_printf(FUNC,RegisterFile_Multi_Banked,"partial_crossbar_transition","End");
     26    log_end(RegisterFile_Multi_Banked,FUNCTION);
    2427  };
    2528
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_transition.cpp

    r81 r106  
    1616namespace registerfile_multi_banked {
    1717
    18 
     18#undef  FUNCTION
     19#define FUNCTION "RegisterFile_Multi_Banked::transition"
    1920  void RegisterFile_Multi_Banked::transition (void)
    2021  {
    21     log_printf(FUNC,RegisterFile_Multi_Banked,"transition","Begin");
     22    log_begin(RegisterFile_Multi_Banked,FUNCTION);
     23    log_function(RegisterFile_Multi_Banked,FUNCTION,_name.c_str());
    2224   
    2325    // call function pointer
     
    3537      }
    3638
     39#if defined(DEBUG_RegisterFile_Multi_Banked) and DEBUG_RegisterFile_Multi_Banked and (DEBUG >= DEBUG_TRACE)
     40    {
     41      log_printf(TRACE,RegisterFile,FUNCTION,"  * Dump RegisterFile");
     42
     43      uint32_t limit = 4;
     44     
     45      for (uint32_t i=0; i<_param->_nb_bank; i++)
     46        {
     47         
     48          log_printf(TRACE,RegisterFile,FUNCTION,"  Bank %d",i);
     49
     50          for (uint32_t j=0; j<_param->_nb_word_by_bank; j+=limit)
     51            {
     52              std::string str = "";
     53             
     54              for (uint32_t k=0; k<limit; k++)
     55                {
     56                  uint32_t index = j+k;
     57                  if (index >= _param->_nb_word)
     58                    break;
     59                  else
     60                    str+=toString("[%.4d] %.8x ",index,reg_DATA[i][index]);
     61                }
     62             
     63              log_printf(TRACE,RegisterFile,FUNCTION,"  %s",str.c_str());
     64            }
     65        }
     66    }
     67#endif
     68
    3769#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    3870    end_cycle();
    3971#endif
    4072
    41     log_printf(FUNC,RegisterFile_Multi_Banked,"transition","End");
     73    log_end(RegisterFile_Multi_Banked,FUNCTION);
    4274  };
    4375
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h

    r105 r106  
    1010#define MORPHEO_MAJOR_VERSION 0
    1111#define MORPHEO_MINOR_VERSION 2
    12 #define MORPHEO_REVISION      "105"
     12#define MORPHEO_REVISION      "106"
    1313#define MORPHEO_CODENAME      "Castor"
    1414
    15 #define MORPHEO_DATE_DAY      "05
     15#define MORPHEO_DATE_DAY      "09
    1616#define MORPHEO_DATE_MONTH    "02"
    1717#define MORPHEO_DATE_YEAR     "2009"
  • trunk/IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg

    r105 r106  
    7676    <parameter name="nb_inst_branch_decod"                  value="1" />
    7777    <parameter name="nb_inst_branch_update"                 value="1" />
    78     <parameter name="btb_size_queue"                        value="1" />
     78    <parameter name="btb_size_queue"                        value="4" />
    7979    <parameter name="btb_associativity"                     value="1" />
    8080    <parameter name="btb_size_counter"                      value="2" />
    81     <parameter name="btb_victim_scheme"                     value="1" />
    82     <parameter name="dir_predictor_scheme"                  value="3" />
     81    <parameter name="btb_victim_scheme"                     value="3" />
     82    <parameter name="dir_predictor_scheme"                  value="1" />
    8383                                                           
    8484    <predictor id="0">                                     
  • trunk/IPs/systemC/processor/Morpheo/Files/Morpheo.sim

    r105 r106  
    1515  <parameter name="statistics_period"          value="0" />
    1616                                               
    17   <parameter name="simulation_nb_cycle"        value="100000" />
     17  <parameter name="simulation_nb_cycle"        value="50000" />
    1818  <parameter name="simulation_nb_instruction"  value="0"   />
    1919
     
    2424
    2525  <parameter name="debug_level"                value="0" />
    26   <parameter name="debug_cycle_start"          value="0" />
    27   <parameter name="debug_cycle_stop"           value="200" />
     26  <parameter name="debug_cycle_start"          value="800" />
     27  <parameter name="debug_cycle_stop"           value="1000" />
    2828  <parameter name="debug_have_log_file"        value="0" />
    2929
  • trunk/Softwares/Test/Test_046/src/sys/crt0.s

    r102 r106  
    3939        l.ori   r1, r1, lo(_stack)
    4040
    41         l.movhi r2,     hi(0x00000010) /* iteration */
    42         l.ori   r2, r2, lo(0x00000010)
     41        l.movhi r2,     hi(0x0000002) /* iteration */
     42        l.ori   r2, r2, lo(0x0000002)
    4343
    4444        l.movhi r3,     hi(0xdeadbeef) /* data */
Note: See TracChangeset for help on using the changeset viewer.