Changeset 101


Ignore:
Timestamp:
Jan 15, 2009, 6:19:08 PM (15 years ago)
Author:
rosiere
Message:

1) Add soc test
2) fix bug (Pc management, Decod and execute, Update prediction ...)

Location:
trunk
Files:
25 deleted
191 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/Environment/Cache/include/Cache_OneLevel.h

    r81 r101  
    3232
    3333
    34   public    : void             reset             (void);
    35   public    : void             transition        (void);
    36   private   : void             update_lru        (uint32_t familly, uint32_t num_associativity);
    37   private   : uint32_t         index_victim      (uint32_t familly);
    38   private   : Address          translate_address (uint32_t address);
    39   public    : type_rsp_cache_t access            (uint32_t num_port, uint32_t address, uint32_t trdid, type_req_cache_t type, direction_req_cache_t dir);
    40   private   : type_rsp_cache_t access_cached     (uint32_t num_port, uint32_t address, uint32_t trdid,                        direction_req_cache_t dir);
    41   private   : type_rsp_cache_t access_uncached   (uint32_t num_port, uint32_t address, uint32_t trdid);
    42   private   : type_rsp_cache_t access_invalidate (uint32_t num_port, uint32_t address, uint32_t trdid);
    43   private   : type_rsp_cache_t access_flush      (uint32_t num_port, uint32_t address, uint32_t trdid);
    44   private   : uint32_t         hit_write_buffer  (uint32_t trdid, Address address);
    45   private   : uint32_t         hit_cache         (uint32_t trdid, Address address);
    46   private   : uint32_t         hit_access_port   (uint32_t trdid, Address address);
    47   public    : uint32_t         need_slot         (void);
    48   public    : uint32_t         latence           (uint32_t num_port);
    49   public    : uint32_t         update_latence    (uint32_t num_port, uint32_t latence);
    50   public    : std::string      information       (uint32_t depth);
     34  public    : void             reset                  (void);
     35  public    : void             transition             (void);
     36  private   : void             update_lru             (uint32_t familly, uint32_t num_associativity);
     37  private   : uint32_t         index_victim           (uint32_t familly);
     38  private   : Address          translate_address      (uint32_t address);
     39  public    : type_rsp_cache_t access                 (uint32_t num_port, uint32_t address, uint32_t trdid, type_req_cache_t type, direction_req_cache_t dir);
     40  private   : type_rsp_cache_t access_cached          (uint32_t num_port, uint32_t address, uint32_t trdid,                        direction_req_cache_t dir);
     41  private   : type_rsp_cache_t access_uncached        (uint32_t num_port, uint32_t address, uint32_t trdid);
     42  private   : type_rsp_cache_t access_invalidate      (uint32_t num_port, uint32_t address, uint32_t trdid);
     43  private   : type_rsp_cache_t access_flush           (uint32_t num_port, uint32_t address, uint32_t trdid);
     44  private   : type_rsp_cache_t access_lock            (uint32_t num_port, uint32_t address, uint32_t trdid);
     45  private   : type_rsp_cache_t access_prefetch        (uint32_t num_port, uint32_t address, uint32_t trdid);
     46  private   : type_rsp_cache_t access_synchronization (uint32_t num_port, uint32_t address, uint32_t trdid);
     47  private   : uint32_t         hit_write_buffer       (uint32_t trdid, Address address);
     48  private   : uint32_t         hit_cache              (uint32_t trdid, Address address);
     49  private   : uint32_t         hit_access_port        (uint32_t trdid, Address address);
     50  public    : uint32_t         need_slot              (void);
     51  public    : uint32_t         latence                (uint32_t num_port);
     52  public    : uint32_t         update_latence         (uint32_t num_port, uint32_t latence);
     53  public    : std::string      information            (uint32_t depth);
    5154
    5255  public    : friend std::ostream& operator<< (std::ostream& output, Cache_OneLevel & x);
  • trunk/IPs/systemC/Environment/Cache/include/Types.h

    r81 r101  
    3232  typedef enum
    3333    {
    34       CACHED     , // address can be in the cache
    35       UNCACHED   , // Always miss (not address in cache)
    36       INVALIDATE , // The direction is not used
    37       PREFETCH   , // The direction is not used
    38       FLUSH        // The direction is not used
     34      CACHED         , // address can be in the cache
     35      UNCACHED       , // Always miss (not address in cache)
     36      INVALIDATE     , // The direction is not used
     37      PREFETCH       , // The direction is not used
     38      FLUSH          , // The direction is not used
     39      LOCK           , // The direction is not used
     40      SYNCHRONIZATION  // The direction is not used
    3941    } type_req_cache_t;
    4042
  • trunk/IPs/systemC/Environment/Cache/src/Cache_OneLevel_access.cpp

    r81 r101  
    2020//            << " * direction  : " << dir      << std::endl;
    2121
     22 // no difference with the simple read cached (have no add a prefetch cache)
    2223    switch (type)
    2324      {
    24       case UNCACHED   : return access_uncached   (num_port,address,trdid    ); break;
    25       case INVALIDATE : return access_invalidate (num_port,address,trdid    ); break;
    26       case FLUSH      : return access_flush      (num_port,address,trdid    ); break;
    27       case PREFETCH   : // no difference with the simple read cached (have no add a prefetch cache)
    28       case CACHED     : return access_cached     (num_port,address,trdid,dir); break;
    29       default         : std::cout << "<Cache_Onelevel.access> unknow type : " << std::endl; exit(1); break;
     25      case UNCACHED        : return access_uncached        (num_port,address,trdid    ); break;
     26      case INVALIDATE      : return access_invalidate      (num_port,address,trdid    ); break;
     27      case FLUSH           : return access_flush           (num_port,address,trdid    ); break;
     28      case PREFETCH        : return access_prefetch        (num_port,address,trdid    ); break;
     29      case LOCK            : return access_lock            (num_port,address,trdid    ); break;
     30      case SYNCHRONIZATION : return access_synchronization (num_port,address,trdid    ); break;
     31      case CACHED          : return access_cached          (num_port,address,trdid,dir); break;
     32      default              : std::cout << "<Cache_Onelevel.access> unknow type : " << std::endl; exit(1); break;
    3033      }
    3134  }
  • trunk/IPs/systemC/Environment/Data/src/Data_entity.cpp

    r81 r101  
    11#include "../include/Data.h"
     2#include "../../Common/include/Debug.h"
    23
    34namespace environment {
     
    67  Entity Data::entity (uint32_t address, uint32_t size)
    78  {
     9//     _cout(DATA, "  * Data::entity\n");
     10//     _cout(DATA, "    * address      : %.8x\n",address);
     11//     _cout(DATA, "    * size         : %d\n"  ,size   );
     12
    813    for (uint32_t num_seg = 0; num_seg < nb_seg; num_seg ++)
    914      if (segment[num_seg]->test (address,size) == true)
  • trunk/IPs/systemC/Environment/Data/src/Segment_test.cpp

    r81 r101  
    11#include "../include/Segment.h"
     2#include "../../Common/include/Debug.h"
    23
    34namespace environment {
     
    1112  bool Segment::test (uint32_t address, uint32_t size)
    1213  {
     14//     _cout(DATA,"  * Segment::test\n");
     15//     _cout(DATA,"    * address      : %.8x\n",address   );
     16//     _cout(DATA,"    * size         : %d\n"  ,size      );
     17//     _cout(DATA,"    * segment base : %.8x\n",this->base);
     18//     _cout(DATA,"    * segment size : %.8x\n",this->size);
     19
    1320    bool res = (((address     ) >= (this->base           )) and
    1421                ((address+size) <= (this->base+this->size)));
  • trunk/IPs/systemC/Environment/src/Cache_Access_dreq_type2cache_type.cpp

    r81 r101  
    1010    switch (dreq_type)
    1111      {
    12       case DCACHE_TYPE_LOAD_8     : direction=cache::READ ; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 1; break;
    13       case DCACHE_TYPE_LOAD_16    : direction=cache::READ ; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 2; break;
    14       case DCACHE_TYPE_LOAD_32    : direction=cache::READ ; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 4; break;
    15       case DCACHE_TYPE_LOAD_64    : direction=cache::READ ; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 8; break;
    16       case DCACHE_TYPE_INVALIDATE : direction=cache::NONE ; type=cache::INVALIDATE                        ; nb_bytes = 1; break;
    17       case DCACHE_TYPE_FLUSH      : direction=cache::NONE ; type=cache::FLUSH                             ; nb_bytes = 1; break;
    18       case DCACHE_TYPE_PREFETCH   : direction=cache::NONE ; type=cache::INVALIDATE                        ; nb_bytes = 1; break;
    19 //    case DCACHE_TYPE_STORE_8_ACK: direction=cache::WRITE; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 1; break;
    20       case DCACHE_TYPE_STORE_8    : direction=cache::WRITE; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 1; break;
    21       case DCACHE_TYPE_STORE_16   : direction=cache::WRITE; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 2; break;
    22       case DCACHE_TYPE_STORE_32   : direction=cache::WRITE; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 4; break;
    23       case DCACHE_TYPE_STORE_64   : direction=cache::WRITE; type=((uncached==true)?cache::UNCACHED:cache::CACHED); nb_bytes = 8; break;
    24       case DCACHE_TYPE_LOCK            :
    25       case DCACHE_TYPE_SYNCHRONIZATION :
     12      case DCACHE_TYPE_LOAD_8          : direction=cache::READ ;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 1;break;
     13      case DCACHE_TYPE_LOAD_16         : direction=cache::READ ;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 2;break;
     14      case DCACHE_TYPE_LOAD_32         : direction=cache::READ ;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 4;break;
     15      case DCACHE_TYPE_LOAD_64         : direction=cache::READ ;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 8;break;
     16      case DCACHE_TYPE_INVALIDATE      : direction=cache::NONE ;type=cache::INVALIDATE                               ;nb_bytes = 1;break;
     17      case DCACHE_TYPE_FLUSH           : direction=cache::NONE ;type=cache::FLUSH                                    ;nb_bytes = 1;break;
     18      case DCACHE_TYPE_PREFETCH        : direction=cache::NONE ;type=cache::PREFETCH                                 ;nb_bytes = 1;break;
     19//    case DCACHE_TYPE_STORE_8_ACK     : direction=cache::WRITE;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 1;break;
     20      case DCACHE_TYPE_STORE_8         : direction=cache::WRITE;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 1;break;
     21      case DCACHE_TYPE_STORE_16        : direction=cache::WRITE;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 2;break;
     22      case DCACHE_TYPE_STORE_32        : direction=cache::WRITE;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 4;break;
     23      case DCACHE_TYPE_STORE_64        : direction=cache::WRITE;type=((uncached==true)?cache::UNCACHED:cache::CACHED);nb_bytes = 8;break;
     24      case DCACHE_TYPE_SYNCHRONIZATION : direction=cache::NONE ;type=cache::SYNCHRONIZATION                          ;nb_bytes = 1;break;
     25      case DCACHE_TYPE_LOCK            : direction=cache::NONE ;type=cache::LOCK                                     ;nb_bytes = 1;break;
    2626      default : {std::cerr << "<ireq_type2cache_type> Unkown type (" << dreq_type << ")" << std::endl; exit(1);}
    2727      }
  • trunk/IPs/systemC/Environment/src/Cache_Access_ireq_type2cache_type.cpp

    r81 r101  
    1313      case ICACHE_TYPE_INVALIDATE : {direction=cache::NONE ; type=cache::INVALIDATE; break;}
    1414      case ICACHE_TYPE_PREFETCH   : {direction=cache::NONE ; type=cache::PREFETCH  ; break;}
    15       case ICACHE_TYPE_LOCK       :
     15      case ICACHE_TYPE_LOCK       : {direction=cache::NONE ; type=cache::LOCK      ; break;}
    1616      default : {std::cerr << "<ireq_type2cache_type> Unkown type (" << ireq_type << ")" << std::endl; exit(1);}
    1717      }
  • trunk/IPs/systemC/Environment/src/Environment_transition.cpp

    r88 r101  
    11#include "../include/Environment.h"
     2
     3#define CYCLE_MAX 0
     4#include "../../processor/Morpheo/Common/include/Test.h"
    25
    36using namespace morpheo;
     
    171174                uint32_t          size      = param->daccess_size_data [i]/8;
    172175
    173 //              _cout(ENVIRONMENT," * information\n");
    174 //              _cout(ENVIRONMENT,"   * context : %d\n" ,static_cast<uint32_t>(context));
    175 //              _cout(ENVIRONMENT,"   * packet  : %d\n" ,static_cast<uint32_t>(packet ));
    176 //              _cout(ENVIRONMENT,"   * address : %.x\n",static_cast<uint32_t>(address));
    177 //              _cout(ENVIRONMENT,"   * type    : %d\n" ,static_cast<uint32_t>(type   ));
    178 //              _cout(ENVIRONMENT,"   * size    : %d\n" ,static_cast<uint32_t>(size   ));
    179 
    180                 // search the entity
    181                 data::Entity      entity    = component_data->entity(static_cast<uint32_t>(address),size);
    182 
    183                 std::cout << entity << std::endl;
     176                _cout(ENVIRONMENT," * information\n");
     177                _cout(ENVIRONMENT,"   * context : %d\n" ,static_cast<uint32_t>(context));
     178                _cout(ENVIRONMENT,"   * packet  : %d\n" ,static_cast<uint32_t>(packet ));
     179                _cout(ENVIRONMENT,"   * address : %.x\n",static_cast<uint32_t>(address));
     180                _cout(ENVIRONMENT,"   * type    : %d\n" ,static_cast<uint32_t>(type   ));
     181                _cout(ENVIRONMENT,"   * size    : %d\n" ,static_cast<uint32_t>(size   ));
    184182
    185183                bool              uncached  = false;
     
    209207                  default                          :{            must_read=false; must_write=false; must_ack=false; must_ack_on_error=false; break;}
    210208                  }
     209               
     210                // search the entity
     211                data::Entity      entity    = component_data->entity(static_cast<uint32_t>(address),nb_bytes);
     212
     213                std::cout << entity << std::endl;
    211214               
    212215                // Test the type of the address
     
    250253                                       ,static_cast<uint32_t>((wdata>> 0)&0xff)
    251254                                       );
     255
     256                                if (wdata == 0)
     257                                  std::cout << STR_OK << std::endl;
     258                                else
     259                                  std::cout << STR_KO << std::endl;
    252260
    253261                                stop (context);
     
    289297                              // Read
    290298                              _cout(ENVIRONMENT," * Read  (%d bytes)\n",size);
    291                               bus_error |= !component_data->read(address,size,read_dram[0]); // always read a complete word
     299                              bus_error |= !component_data->read(address,nb_bytes,read_dram[0]); // always read a complete word
    292300
    293301                              _cout(ENVIRONMENT," * Rdata : ");
    294                               for (uint32_t i=0; i<size; i++)
     302                              for (uint32_t i=0; i<nb_bytes; i++)
    295303                                _cout(ENVIRONMENT,"%.2x",0xff&static_cast<uint32_t>(read_dram[0][i]));
    296304                              _cout(ENVIRONMENT,".\n");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Configuration/SelfTest/src/test.cpp

    r97 r101  
    8080  }
    8181
     82  {
     83    cout << "------------------------------------------------------" << endl;
     84
     85    Instance * instance = new Instance ("../../../Files/Instance_scalar_3.cfg",
     86                                        generator1,
     87                                        _get_custom_information
     88                                        );
     89    instance->toFile("data_out");
     90   
     91    delete instance;
     92  }
     93
     94  {
     95    cout << "------------------------------------------------------" << endl;
     96
     97    Instance * instance = new Instance ("../../../Files/Instance_scalar_4.cfg",
     98                                        generator1,
     99                                        _get_custom_information
     100                                        );
     101    instance->toFile("data_out");
     102   
     103    delete instance;
     104  }
     105
    82106  delete configuration1;
    83107  delete instance1;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/Operation/include/Operation.h

    r81 r101  
    2828  void operation_l_addc          (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
    2929  void operation_l_sub           (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
    30 //void operation_l_mul           (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
    31 //void operation_l_mulu          (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
    32 //void operation_l_div           (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
    33 //void operation_l_divu          (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
     30  void operation_l_mul           (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
     31  void operation_l_mulu          (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
     32  void operation_l_div           (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
     33  void operation_l_divu          (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
    3434  void operation_l_and           (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
    3535  void operation_l_or            (execute_operation_t * op, execute_register_t  * reg, execute_param_t * param);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/Operation/src/Operation.cpp

    r100 r101  
    9090
    9191    bool            overflow  = ovf  (param->_size_data,gpr1,gpr2,gpr3);
    92     bool            carry_out = carry(param->_size_data,gpr1,gpr2,gpr3);
     92//  bool            carry_out = carry(param->_size_data,gpr1,gpr2,gpr3);
     93    // In ISA : l.sub don't change flag carry
     94    bool            carry_out  = get_flag(op->_data_rc,FLAG_CY);
    9395
    9496    // Result
     
    104106
    105107#undef  FUNCTION
     108#define FUNCTION "Functionnal_unit::operation_l_mul"
     109  void operation_l_mul         (execute_operation_t * op, execute_register_t * reg, execute_param_t * param)
     110  {
     111    log_printf(TRACE,Functionnal_unit,FUNCTION,"Operation : l_mul");
     112
     113    Tgeneral_data_t gpr1      = unsigned(param->_size_data,op->_data_ra);
     114    Tgeneral_data_t gpr2      = unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb);
     115    Tgeneral_data_t gpr3      ;
     116    bool            overflow  ;
     117    bool            carry_out ;
     118
     119    if (param->_size_data == 32)
     120      {
     121        int64_t res = static_cast<int64_t>(gpr1) * static_cast<int64_t>(gpr2);
     122
     123        log_printf(TRACE,Functionnal_unit,FUNCTION,"  * res   : %llx",res);
     124
     125        gpr3      = param->_mask_data & static_cast<Tgeneral_data_t>(res);
     126        carry_out = res != gpr3;
     127        overflow  = carry_out;
     128      }
     129    else
     130      {
     131        throw ERRORMORPHEO(FUNCTION,_("64 bits multiplcation : not yet implemented\n"));
     132      }
     133
     134    // Result
     135    op->_timing       = param->_timing[op->_type][op->_operation];
     136    op->_data_rd      = gpr3;
     137    op->_data_re      = 0;
     138    op->_data_re      = set_flag(op->_data_re,FLAG_OV,overflow );
     139    op->_data_re      = set_flag(op->_data_re,FLAG_CY,carry_out);
     140    op->_exception    = (overflow==1)?EXCEPTION_ALU_RANGE:EXCEPTION_ALU_NONE;
     141    op->_no_sequence  = 0;
     142  //op->_address      = 0;
     143  };
     144
     145#undef  FUNCTION
     146#define FUNCTION "Functionnal_unit::operation_l_mulu"
     147  void operation_l_mulu        (execute_operation_t * op, execute_register_t * reg, execute_param_t * param)
     148  {
     149    log_printf(TRACE,Functionnal_unit,FUNCTION,"Operation : l_mulu");
     150
     151    Tgeneral_data_t gpr1      = unsigned(param->_size_data,op->_data_ra);
     152    Tgeneral_data_t gpr2      = unsigned(param->_size_data,op->_data_rb);
     153    Tgeneral_data_t gpr3      ;
     154    bool            overflow  ;
     155    bool            carry_out ;
     156
     157    if (param->_size_data == 32)
     158      {
     159        uint64_t res = static_cast<uint64_t>(gpr1) * static_cast<uint64_t>(gpr2);
     160
     161        log_printf(TRACE,Functionnal_unit,FUNCTION,"  * res   : %llx",res);
     162
     163        gpr3      = param->_mask_data & static_cast<Tgeneral_data_t>(res);
     164        carry_out = res != gpr3;
     165        overflow  = carry_out;
     166      }
     167    else
     168      {
     169        throw ERRORMORPHEO(FUNCTION,_("64 bits multiplcation : not yet implemented\n"));
     170      }
     171
     172    // Result
     173    op->_timing       = param->_timing[op->_type][op->_operation];
     174    op->_data_rd      = gpr3;
     175    op->_data_re      = 0;
     176    op->_data_re      = set_flag(op->_data_re,FLAG_OV,overflow );
     177    op->_data_re      = set_flag(op->_data_re,FLAG_CY,carry_out);
     178    op->_exception    = (overflow==1)?EXCEPTION_ALU_RANGE:EXCEPTION_ALU_NONE;
     179    op->_no_sequence  = 0;
     180  //op->_address      = 0;
     181  };
     182
     183#undef  FUNCTION
     184#define FUNCTION "Functionnal_unit::operation_l_div"
     185  void operation_l_div         (execute_operation_t * op, execute_register_t * reg, execute_param_t * param)
     186  {
     187    log_printf(TRACE,Functionnal_unit,FUNCTION,"Operation : l_div");
     188
     189    Tgeneral_data_t gpr1      = signed(param->_size_data,op->_data_ra);
     190    Tgeneral_data_t gpr2      = signed(param->_size_data,op->_data_rb);
     191    Tgeneral_data_t gpr3      = (gpr2!=0)?(gpr1/gpr2):0;
     192    bool            overflow  = ovf  (param->_size_data,gpr1,gpr2,gpr3);
     193    bool            carry_out = (gpr2==0);
     194
     195    // Result
     196    op->_timing       = param->_timing[op->_type][op->_operation];
     197    op->_data_rd      = gpr3;
     198    op->_data_re      = 0;
     199    op->_data_re      = set_flag(op->_data_re,FLAG_OV,overflow );
     200    op->_data_re      = set_flag(op->_data_re,FLAG_CY,carry_out);
     201    op->_exception    = (overflow==1)?EXCEPTION_ALU_RANGE:EXCEPTION_ALU_NONE;
     202    op->_no_sequence  = 0;
     203  //op->_address      = 0;
     204  };
     205
     206#undef  FUNCTION
     207#define FUNCTION "Functionnal_unit::operation_l_divu"
     208  void operation_l_divu        (execute_operation_t * op, execute_register_t * reg, execute_param_t * param)
     209  {
     210    log_printf(TRACE,Functionnal_unit,FUNCTION,"Operation : l_divu");
     211
     212    Tgeneral_data_t gpr1      = unsigned(param->_size_data,op->_data_ra);
     213    Tgeneral_data_t gpr2      = unsigned(param->_size_data,op->_data_rb);
     214    Tgeneral_data_t gpr3      = (gpr2!=0)?(gpr1/gpr2):0;
     215    bool            overflow  = ovf  (param->_size_data,gpr1,gpr2,gpr3);
     216    bool            carry_out = (gpr2==0);
     217
     218    // Result
     219    op->_timing       = param->_timing[op->_type][op->_operation];
     220    op->_data_rd      = gpr3;
     221    op->_data_re      = 0;
     222    op->_data_re      = set_flag(op->_data_re,FLAG_OV,overflow );
     223    op->_data_re      = set_flag(op->_data_re,FLAG_CY,carry_out);
     224    op->_exception    = (overflow==1)?EXCEPTION_ALU_RANGE:EXCEPTION_ALU_NONE;
     225    op->_no_sequence  = 0;
     226  //op->_address      = 0;
     227  };
     228
     229#undef  FUNCTION
    106230#define FUNCTION "Functionnal_unit::operation_l_and"
    107231  void operation_l_and         (execute_operation_t * op, execute_register_t * reg, execute_param_t * param)
     
    465589    Tgeneral_data_t gpr2       = unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb);
    466590
     591    // Tgeneral_data_t is unsigned
    467592    bool            f_out      = (gpr1 >= gpr2);
    468593
     
    485610    Tgeneral_data_t gpr2       = unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb);
    486611
     612    // Tgeneral_data_t is unsigned
    487613    bool            f_out      = (gpr1 >  gpr2);
    488614
     
    505631    Tgeneral_data_t gpr2       = unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb);
    506632
     633    // Tgeneral_data_t is unsigned
    507634    bool            f_out      = (gpr1 <= gpr2);
    508635
     
    525652    Tgeneral_data_t gpr2       = unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb);
    526653
     654    // Tgeneral_data_t is unsigned
    527655    bool            f_out      = (gpr1 <  gpr2);
    528656
     
    544672    Tgeneral_data_t gpr1       =   op->_data_ra;
    545673    Tgeneral_data_t gpr2       =   (op->_has_immediat==1)?op->_immediat:op->_data_rb;
    546    
    547     log_printf(TRACE,Functionnal_unit,FUNCTION," * data_ra  : %.8x",unsigned(param->_size_data,op->_data_ra));
    548     log_printf(TRACE,Functionnal_unit,FUNCTION," * data_ras : %.8x",  signed(param->_size_data,op->_data_ra));
    549     log_printf(TRACE,Functionnal_unit,FUNCTION," * data_rb  : %.8x",unsigned(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb));
    550     log_printf(TRACE,Functionnal_unit,FUNCTION," * data_rbs : %.8x",  signed(param->_size_data,(op->_has_immediat==1)?op->_immediat:op->_data_rb));
    551    
     674       
    552675    bool            f_out;
    553676
    554     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
    555       {
    556       case 1 /*b01*/ : f_out = 1                               ; break;
    557       case 2 /*b10*/ : f_out = 0                               ; break;
    558       default        : f_out = signed(param->_size_data,gpr1) >= signed(param->_size_data,gpr2); break;
    559       }
    560 
    561     log_printf(TRACE,Functionnal_unit,FUNCTION," * f_out    : %.8x",f_out);
     677    if (param->_size_data == 32)
     678      f_out = static_cast<int32_t>(gpr1) >= static_cast<int32_t>(gpr2);
     679    else
     680      f_out = static_cast<int64_t>(gpr1) >= static_cast<int64_t>(gpr2);
     681
     682//     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
     683//       {
     684//       case 1 /*b01*/ : f_out = 1                               ; break;
     685//       case 2 /*b10*/ : f_out = 0                               ; break;
     686//       default        : f_out = signed(param->_size_data,gpr1) >= signed(param->_size_data,gpr2); break;
     687//       }
    562688
    563689    // Result
     
    581707    bool            f_out;
    582708
    583     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
    584       {
    585       case 1 /*b01*/ : f_out = 1; break;
    586       case 2 /*b10*/ : f_out = 0; break;
    587       default        : f_out = signed(param->_size_data,gpr1) >  signed(param->_size_data,gpr2); break;
    588       }
     709    if (param->_size_data == 32)
     710      f_out = static_cast<int32_t>(gpr1) >  static_cast<int32_t>(gpr2);
     711    else
     712      f_out = static_cast<int64_t>(gpr1) >  static_cast<int64_t>(gpr2);
     713
     714//     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
     715//       {
     716//       case 1 /*b01*/ : f_out = 1; break;
     717//       case 2 /*b10*/ : f_out = 0; break;
     718//       default        : f_out = signed(param->_size_data,gpr1) >  signed(param->_size_data,gpr2); break;
     719//       }
    589720
    590721    // Result
     
    608739    bool            f_out;
    609740
    610     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
    611       {
    612       case 1 /*b01*/ : f_out = 0; break;
    613       case 2 /*b10*/ : f_out = 1; break;
    614       default        : f_out = signed(param->_size_data,gpr1) <= signed(param->_size_data,gpr2); break;
    615       }
     741    if (param->_size_data == 32)
     742      f_out = static_cast<int32_t>(gpr1) <= static_cast<int32_t>(gpr2);
     743    else
     744      f_out = static_cast<int64_t>(gpr1) <= static_cast<int64_t>(gpr2);
     745
     746//     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
     747//       {
     748//       case 1 /*b01*/ : f_out = 0; break;
     749//       case 2 /*b10*/ : f_out = 1; break;
     750//       default        : f_out = signed(param->_size_data,gpr1) <= signed(param->_size_data,gpr2); break;
     751//       }
    616752   
    617753    // Result
     
    635771    bool            f_out;
    636772
    637     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
    638       {
    639       case 1 /*b01*/ : f_out = 0; break;
    640       case 2 /*b10*/ : f_out = 1; break;
    641       default        : f_out = signed(param->_size_data,gpr1) <  signed(param->_size_data,gpr2); break;
    642       }
     773    if (param->_size_data == 32)
     774      f_out = static_cast<int32_t>(gpr1) <  static_cast<int32_t>(gpr2);
     775    else
     776      f_out = static_cast<int64_t>(gpr1) <  static_cast<int64_t>(gpr2);
     777
     778//     switch (concatenation_bool(sign(param->_size_data,gpr1),sign(param->_size_data,gpr2)))
     779//       {
     780//       case 1 /*b01*/ : f_out = 0; break;
     781//       case 2 /*b10*/ : f_out = 1; break;
     782//       default        : f_out = signed(param->_size_data,gpr1) <  signed(param->_size_data,gpr2); break;
     783//       }
    643784
    644785    // Result
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/SelfTest/src/test.cpp

    r100 r101  
    1818public : const Tcontext_t         _front_end_id ;
    1919public : const Tcontext_t         _ooo_engine_id;
    20 public : const Tpacket_t          _packet_id    ;
     20public : const uint32_t           _packet_id    ;
    2121public : const Toperation_t       _operation    ;
    2222public : const Ttype_t            _type         ;
     
    4040                              Tcontext_t         front_end_id ,
    4141                              Tcontext_t         ooo_engine_id,
    42                               Tpacket_t          packet_id    ,
     42                              uint32_t           packet_id    ,
    4343                              Toperation_t       operation    ,
    4444                              Ttype_t            type         ,
     
    356356  transaction_in.push_back(execute_transaction(_param,0,0,0, 99,OPERATION_FIND_L_FL1     ,TYPE_FIND,0,0         ,0x80000000,0x0       ,0              ,1,63,32         ,0,15,FLAG_CY        ,EXCEPTION_NONE     ,0));
    357357
    358 //   transaction_in.push_back(execute_transaction(_param,0,0,0,100,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x12344321,0x1       ,0              ,1,63,0x12344320,1,15,0              ,EXCEPTION_NONE     ,0));
    359 //   transaction_in.push_back(execute_transaction(_param,0,0,0,101,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x12345678,0xffffffff,0              ,1,56,0x12345679,1,3 ,0              ,EXCEPTION_NONE     ,0));
    360 //   transaction_in.push_back(execute_transaction(_param,0,0,0,102,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x12345678,0x12345678,0              ,1,56,0x0       ,1,3 ,0              ,EXCEPTION_NONE     ,0));
    361 //   transaction_in.push_back(execute_transaction(_param,0,0,0,103,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x0       ,0x0       ,0              ,1,56,0x0       ,1,3 ,0              ,EXCEPTION_NONE     ,0));
    362 //   transaction_in.push_back(execute_transaction(_param,0,0,0,104,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x70000000,0x90000000,0              ,1,56,0x0       ,1,3 ,FLAG_CY        ,EXCEPTION_NONE     ,0));
    363 //   transaction_in.push_back(execute_transaction(_param,0,0,0,105,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x80001000,0x80000000,0              ,1,1 ,0x1000    ,1,0 ,FLAG_CY|FLAG_OV,EXCEPTION_ALU_RANGE,0));
    364 //   transaction_in.push_back(execute_transaction(_param,0,0,0,106,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x00000001,0x7fffffff,FLAG_CY|FLAG_OV,1,1 ,0x80000000,1,0 ,        FLAG_OV,EXCEPTION_ALU_RANGE,0));
     358  transaction_in.push_back(execute_transaction(_param,0,0,0,100,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x12344321,0x1       ,0              ,1,63,0x12344320,1,15,0              ,EXCEPTION_NONE     ,0));
     359  transaction_in.push_back(execute_transaction(_param,0,0,0,101,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x12345678,0xffffffff,0              ,1,56,0x12345679,1,3 ,0              ,EXCEPTION_NONE     ,0));
     360  transaction_in.push_back(execute_transaction(_param,0,0,0,102,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x12345678,0x12345678,0              ,1,56,0x0       ,1,3 ,0              ,EXCEPTION_NONE     ,0));
     361  transaction_in.push_back(execute_transaction(_param,0,0,0,103,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x0       ,0x0       ,0              ,1,56,0x0       ,1,3 ,0              ,EXCEPTION_NONE     ,0));
     362  transaction_in.push_back(execute_transaction(_param,0,0,0,104,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x70000000,0x90000000,0              ,1,56,0xe0000000,1,3 ,        FLAG_OV,EXCEPTION_ALU_RANGE,0));
     363  transaction_in.push_back(execute_transaction(_param,0,0,0,105,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x80001000,0x80000000,0              ,1,1 ,0x1000    ,1,0 ,        FLAG_OV,EXCEPTION_ALU_RANGE,0));
     364  transaction_in.push_back(execute_transaction(_param,0,0,0,106,OPERATION_ALU_L_SUB     ,TYPE_ALU,0,0         ,0x00000001,0x7fffffff,FLAG_CY|FLAG_OV,1,1 ,0x80000002,1,0 ,FLAG_CY        ,EXCEPTION_NONE     ,0));
    365365
    366366  transaction_in.push_back(execute_transaction(_param,0,0,0,120,OPERATION_TEST_L_SFEQ    ,TYPE_TEST,0,0         ,0xdead    ,0xdead    ,0              ,0,63,0x0       ,1,15,FLAG_F         ,EXCEPTION_NONE     ,0)); // + == +
     
    440440  transaction_in.push_back(execute_transaction(_param,0,0,0,232,OPERATION_TEST_L_SFGES   ,TYPE_TEST,0,0         ,0x21071981,0x25071959,0              ,0,63,0x0       ,1,15,0              ,EXCEPTION_NONE     ,0)); // + <  +
    441441  transaction_in.push_back(execute_transaction(_param,0,0,0,233,OPERATION_TEST_L_SFGES   ,TYPE_TEST,0,0         ,0xdeadbeef,0xdeadbeef,0              ,0,63,0x0       ,1,15,FLAG_F         ,EXCEPTION_NONE     ,0)); // - == -
    442   transaction_in.push_back(execute_transaction(_param,0,0,0,234,OPERATION_TEST_L_SFGES   ,TYPE_TEST,0,0         ,0xdeadbabe,0xdeadbeef,0              ,0,63,0x0       ,1,15,FLAG_F         ,EXCEPTION_NONE     ,0)); // - >  -
     442  transaction_in.push_back(execute_transaction(_param,0,0,0,234,OPERATION_TEST_L_SFGES   ,TYPE_TEST,0,0         ,0xdeadbabe,0xdeadbeef,0              ,0,63,0x0       ,1,15,0              ,EXCEPTION_NONE     ,0)); // - >  -
    443443  transaction_in.push_back(execute_transaction(_param,0,0,0,235,OPERATION_TEST_L_SFGES   ,TYPE_TEST,0,0         ,0xdeadbeef,0xdeadbabe,0              ,0,63,0x0       ,1,15,0              ,EXCEPTION_NONE     ,0)); // - <  -
    444444  transaction_in.push_back(execute_transaction(_param,0,0,0,236,OPERATION_TEST_L_SFGES   ,TYPE_TEST,0,0         ,0xdeadbeef,0x21524111,0              ,0,63,0x0       ,1,15,0              ,EXCEPTION_NONE     ,0)); // - == + (in unsigned)
     
    569569  transaction_in.push_back(execute_transaction(_param,0,0,0,628,OPERATION_SPECIAL_L_MFSPR   ,TYPE_SPECIAL,1,GROUP_CUSTOM_7<<11, 0,0x0       ,0              ,1,63,0xa       ,0, 0,0              ,EXCEPTION_ALU_NONE                   ,0,(GROUP_CUSTOM_7<<11)|0));
    570570
     571  transaction_in.push_back(execute_transaction(_param,0,0,0,700,OPERATION_MUL_L_MUL     ,TYPE_MUL,0,0         ,0x00000001,0x00000001,0              ,1,63,0x00000001,1,15,0              ,EXCEPTION_NONE     ,0));
     572  transaction_in.push_back(execute_transaction(_param,0,0,0,701,OPERATION_MUL_L_MUL     ,TYPE_MUL,0,0         ,0x00002107,0x00001981,0              ,1,63,0x034a5387,1,15,0              ,EXCEPTION_NONE     ,0));
     573  transaction_in.push_back(execute_transaction(_param,0,0,0,702,OPERATION_MUL_L_MUL     ,TYPE_MUL,0,0         ,0x00048698,0x0000dead,0              ,1,63,0xefc6c4b8,1,15,FLAG_CY|FLAG_OV,EXCEPTION_ALU_RANGE,0));
     574  transaction_in.push_back(execute_transaction(_param,0,0,0,702,OPERATION_MUL_L_MUL     ,TYPE_MUL,0,0         ,0x40000000,0x00000002,0              ,1,63,0x80000000,1,15,        FLAG_OV,EXCEPTION_ALU_RANGE,0));
     575  transaction_in.push_back(execute_transaction(_param,0,0,0,702,OPERATION_MUL_L_MUL     ,TYPE_MUL,0,0         ,0x40000000,0x00000004,0              ,1,63,0x00000000,1,15,FLAG_CY        ,EXCEPTION_NONE     ,0));
     576
     577  transaction_in.push_back(execute_transaction(_param,0,0,0,700,OPERATION_MUL_L_MULU    ,TYPE_MUL,0,0         ,0x00000001,0x00000001,0              ,1,63,0x00000001,1,15,0              ,EXCEPTION_NONE     ,0));
     578  transaction_in.push_back(execute_transaction(_param,0,0,0,701,OPERATION_MUL_L_MULU    ,TYPE_MUL,0,0         ,0x00002107,0x00001981,0              ,1,63,0x034a5387,1,15,0              ,EXCEPTION_NONE     ,0));
     579  transaction_in.push_back(execute_transaction(_param,0,0,0,702,OPERATION_MUL_L_MULU    ,TYPE_MUL,0,0         ,0x00048698,0x0000dead,0              ,1,63,0xefc6c4b8,1,15,FLAG_CY|FLAG_OV,EXCEPTION_ALU_RANGE,0));
     580  transaction_in.push_back(execute_transaction(_param,0,0,0,702,OPERATION_MUL_L_MULU    ,TYPE_MUL,0,0         ,0x40000000,0x00000002,0              ,1,63,0x80000000,1,15,        FLAG_OV,EXCEPTION_ALU_RANGE,0));
     581  transaction_in.push_back(execute_transaction(_param,0,0,0,702,OPERATION_MUL_L_MULU    ,TYPE_MUL,0,0         ,0x40000000,0x00000004,0              ,1,63,0x00000000,1,15,FLAG_CY        ,EXCEPTION_NONE     ,0));
     582
     583
     584
    571585  LABEL("Reset");
    572586  in_NRESET.write(0);
     
    585599
    586600      LABEL("Iteration %d",iteration);
    587 
     601     
    588602      while (nb_transaction_out > 0)
    589         {
     603      {
    590604          Tcontrol_t val = ((rand()%100) < percent_transaction_execute_in) and not transaction_in.empty();
    591605          in_EXECUTE_IN_VAL .write(val);
     
    601615              in_EXECUTE_IN_OOO_ENGINE_ID .write(transaction_in.front()._ooo_engine_id);
    602616              if (_param->_have_port_rob_ptr)
    603               in_EXECUTE_IN_PACKET_ID     .write(transaction_in.front()._packet_id    );
     617              in_EXECUTE_IN_PACKET_ID     .write(static_cast<Tpacket_t>(transaction_in.front()._packet_id));
    604618              in_EXECUTE_IN_OPERATION     .write(transaction_in.front()._operation    );
    605619              in_EXECUTE_IN_TYPE          .write(transaction_in.front()._type         );
     
    624638              // TEST
    625639              if (_param->_have_port_rob_ptr)
    626               TEST(Tpacket_t         , out_EXECUTE_OUT_PACKET_ID    .read(), transaction_out.front()._packet_id    );
     640              TEST(Tpacket_t         , out_EXECUTE_OUT_PACKET_ID    .read(), static_cast<Tpacket_t>(transaction_out.front()._packet_id    ));
    627641              if (_param->_have_port_context_id)
    628642              TEST(Tcontext_t        , out_EXECUTE_OUT_CONTEXT_ID   .read(), transaction_out.front()._context_id   );
     
    649663                  TEST(Tgeneral_data_t   , out_EXECUTE_OUT_DATA_RD      .read(), transaction_out.front()._data_rd      );
    650664                  TEST(Tgeneral_data_t   , out_EXECUTE_OUT_ADDRESS      .read(), transaction_out.front()._address      );
    651                   break;
    652665                }
    653666
     
    659672                  TEST(Tgeneral_data_t   , out_EXECUTE_OUT_DATA_RD      .read(), transaction_out.front()._data_rd      );
    660673                  TEST(Tgeneral_data_t   , out_EXECUTE_OUT_ADDRESS      .read(), transaction_out.front()._address      );
    661                   break;
    662674                }
    663675             
     
    685697
    686698          SC_START(1);
    687         }
     699      }
    688700
    689701    }
     702
    690703  /********************************************************
    691704   * Simulation - End
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_allocation.cpp

    r97 r101  
    174174     if (_param->_timing[TYPE_ALU    ][OPERATION_ALU_L_ADDC        ]._latence > 0)
    175175       _function_execute[TYPE_ALU    ][OPERATION_ALU_L_ADDC        ] = &(operation_l_addc    );
    176 //   if (_param->_timing[TYPE_ALU    ][OPERATION_ALU_L_SUB         ]._latence > 0)
    177 //     _function_execute[TYPE_ALU    ][OPERATION_ALU_L_SUB         ] = &(operation_l_sub     );
     176     if (_param->_timing[TYPE_ALU    ][OPERATION_ALU_L_SUB         ]._latence > 0)
     177       _function_execute[TYPE_ALU    ][OPERATION_ALU_L_SUB         ] = &(operation_l_sub     );
    178178     if (_param->_timing[TYPE_ALU    ][OPERATION_ALU_L_AND         ]._latence > 0)
    179179       _function_execute[TYPE_ALU    ][OPERATION_ALU_L_AND         ] = &(operation_l_and     );
     
    214214     if (_param->_timing[TYPE_TEST   ][OPERATION_TEST_L_SFNE       ]._latence > 0)
    215215       _function_execute[TYPE_TEST   ][OPERATION_TEST_L_SFNE       ] = &(operation_l_sfne    );
    216 //   if (_param->_timing[TYPE_MUL    ][OPERATION_MUL_L_MUL         ]._latence > 0)
    217 //     _function_execute[TYPE_MUL    ][OPERATION_MUL_L_MUL         ] = &(operation_l_mul     );
    218 //   if (_param->_timing[TYPE_MUL    ][OPERATION_MUL_L_MULU        ]._latence > 0)
    219 //     _function_execute[TYPE_DIV    ][OPERATION_MUL_L_MULU        ] = &(operation_l_mulu    );
    220 //   if (_param->_timing[TYPE_DIV    ][OPERATION_DIV_L_DIV         ]._latence > 0)
    221 //     _function_execute[TYPE_DIV    ][OPERATION_DIV_L_DIV         ] = &(operation_l_div     );
    222 //   if (_param->_timing[TYPE_DIV    ][OPERATION_DIV_L_DIVU        ]._latence > 0)
    223 //     _function_execute[TYPE_DIV    ][OPERATION_DIV_L_DIVU        ] = &(operation_l_divu    );
     216     if (_param->_timing[TYPE_MUL    ][OPERATION_MUL_L_MUL         ]._latence > 0)
     217       _function_execute[TYPE_MUL    ][OPERATION_MUL_L_MUL         ] = &(operation_l_mul     );
     218     if (_param->_timing[TYPE_MUL    ][OPERATION_MUL_L_MULU        ]._latence > 0)
     219       _function_execute[TYPE_MUL    ][OPERATION_MUL_L_MULU        ] = &(operation_l_mulu    );
     220     if (_param->_timing[TYPE_DIV    ][OPERATION_DIV_L_DIV         ]._latence > 0)
     221       _function_execute[TYPE_DIV    ][OPERATION_DIV_L_DIV         ] = &(operation_l_div     );
     222     if (_param->_timing[TYPE_DIV    ][OPERATION_DIV_L_DIVU        ]._latence > 0)
     223       _function_execute[TYPE_DIV    ][OPERATION_DIV_L_DIVU        ] = &(operation_l_divu    );
    224224     if (_param->_timing[TYPE_EXTEND ][OPERATION_EXTEND_L_EXTEND_S ]._latence > 0)
    225225       _function_execute[TYPE_EXTEND ][OPERATION_EXTEND_L_EXTEND_S ] = &(operation_l_extend_s);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/Memory.h

    r88 r101  
    133133    // Address's Read must be aligned
    134134
    135     if ((address & _mask_addr) != 0)
    136       TEST_KO("<Memory_t::read> Address is not aligned");
     135//     if ((address & _mask_addr) != 0)
     136//       TEST_KO("<Memory_t::read> Address is not aligned");
    137137
    138138    if (context>_nb_context)
  • 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_genMealy_dcache.cpp

    r81 r101  
    2424  void Load_store_unit::function_speculative_load_commit_genMealy_dcache (void)
    2525  {
    26     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
    27     log_printf(FUNC,Load_store_unit,FUNCTION,"End");
     26    log_begin(Load_store_unit,FUNCTION);
     27    log_end  (Load_store_unit,FUNCTION);
    2828  };
    2929
  • 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_genMealy_insert.cpp

    r88 r101  
    2424  void Load_store_unit::function_speculative_load_commit_genMealy_insert (void)
    2525  {
    26     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
     26    log_begin(Load_store_unit,FUNCTION);
     27    log_function(Load_store_unit,FUNCTION,_name.c_str());
    2728
    2829    // ~~~~~[ Output "memory_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    5253      PORT_WRITE(out_MEMORY_IN_ACK [i], ack [i]);
    5354
    54     log_printf(FUNC,Load_store_unit,FUNCTION,"End");
     55    log_end(Load_store_unit,FUNCTION);
    5556  };
    5657
  • 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_genMealy_retire.cpp

    r81 r101  
    2424  void Load_store_unit::function_speculative_load_commit_genMealy_retire (void)
    2525  {
    26     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
    27     log_printf(FUNC,Load_store_unit,FUNCTION,"End");
     26    log_begin(Load_store_unit,FUNCTION);
     27    log_end  (Load_store_unit,FUNCTION);
    2828  };
    2929
  • 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_genMoore.cpp

    r97 r101  
    2424  void Load_store_unit::function_speculative_load_commit_genMoore (void)
    2525  {
    26     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
     26    log_begin(Load_store_unit,FUNCTION);
     27    log_function(Load_store_unit,FUNCTION,_name.c_str());
    2728
    2829    // ~~~~~[ Interface "memory_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    4445    // Test store and load queue
    4546
    46     log_printf(TRACE,Load_store_unit,FUNCTION,"genMoore : Test MEMORY_OUT");
    47 
    48     log_printf(TRACE,Load_store_unit,FUNCTION,"  * Load  queue");
     47    log_printf(TRACE,Load_store_unit,FUNCTION,"  * Test MEMORY_OUT");
     48
     49    log_printf(TRACE,Load_store_unit,FUNCTION,"    * Load  queue");
    4950    for (internal_MEMORY_OUT_PTR=0; internal_MEMORY_OUT_PTR<_param->_size_load_queue; internal_MEMORY_OUT_PTR++)
    5051//     for (uin32_t i=0; (i<_param->_size_load_queue) and not (find_load); i++)
     
    7172                                                             _load_queue [internal_MEMORY_OUT_PTR]._is_load_signed,
    7273                                                             _load_queue [internal_MEMORY_OUT_PTR]._access_size);
    73             log_printf(TRACE,Load_store_unit,FUNCTION,"    * data : %.8x",data_new);
     74            log_printf(TRACE,Load_store_unit,FUNCTION,"    * data (old) : %.8x",data_old);
     75            log_printf(TRACE,Load_store_unit,FUNCTION,"    * data (new) : %.8x",data_new);
    7476            log_printf(TRACE,Load_store_unit,FUNCTION,"      * rdata        : %.8x",_load_queue [internal_MEMORY_OUT_PTR]._rdata);
    7577            log_printf(TRACE,Load_store_unit,FUNCTION,"      * shift        : %d",_load_queue [internal_MEMORY_OUT_PTR]._shift);
     
    9193    if (not internal_MEMORY_OUT_VAL)
    9294      {
    93         log_printf(TRACE,Load_store_unit,FUNCTION,"  * Store queue");
     95        log_printf(TRACE,Load_store_unit,FUNCTION,"    * Store queue");
    9496        if (_store_queue [reg_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_COMMIT)
    9597          {
     
    143145    Tdcache_data_t    dcache_req_wdata     ;
    144146
    145     log_printf(TRACE,Load_store_unit,FUNCTION,"genMoore : Test DCACHE_REQ");
     147    log_printf(TRACE,Load_store_unit,FUNCTION,"  * Test DCACHE_REQ");
    146148
    147149    internal_DCACHE_REQ_VAL = 0;
     
    152154    if (_speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._state == SPECULATIVE_ACCESS_QUEUE_WAIT_CACHE)
    153155      {
    154         log_printf(TRACE,Load_store_unit,FUNCTION," * speculative_access_queue[%d]",internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ);
     156        log_printf(TRACE,Load_store_unit,FUNCTION,"    * speculative_access_queue [%d]",internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ);
    155157
    156158        internal_DCACHE_REQ_VAL          = 1;
     
    169171
    170172        dcache_req_packet_id  = DCACHE_REQ_IS_LOAD(_speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._load_queue_ptr_write);
    171         dcache_req_address    = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._address & _param->_mask_address_msb;
     173        dcache_req_address    = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._address;// & _param->_mask_address_msb;
    172174        dcache_req_type       = operation_to_dcache_type(_speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._operation);
     175
     176//      log_printf(TRACE,Load_store_unit,FUNCTION,"      * address            : %.8x",_speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._address);
     177//      log_printf(TRACE,Load_store_unit,FUNCTION,"      * mask               : %.8x",_param->_mask_address_msb);
     178        log_printf(TRACE,Load_store_unit,FUNCTION,"      * dcache_req_address : %.8x",dcache_req_address);
     179
    173180#ifdef SYSTEMC_VHDL_COMPATIBILITY
    174181        dcache_req_wdata      = 0;
     
    210217    PORT_WRITE(out_DCACHE_REQ_WDATA     [0], dcache_req_wdata     );
    211218   
    212     log_printf(FUNC,Load_store_unit,FUNCTION,"End");
     219    log_end(Load_store_unit,FUNCTION);
    213220  };
    214221
  • 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

    r97 r101  
    260260            (    internal_MEMORY_IN_ACK  == 1))
    261261          {
     262            log_printf(TRACE,Load_store_unit,FUNCTION,"  * MEMORY_IN [%d]",internal_MEMORY_IN_PORT);
     263
    262264            // Test operation :
    263265            //~~~~~~~~~~~~~~~~~
     
    440442            (PORT_READ(in_MEMORY_OUT_ACK[0]) == 1))
    441443          {
    442             log_printf(TRACE,Load_store_unit,FUNCTION,"  * MEMORY_OUT transaction");
     444            log_printf(TRACE,Load_store_unit,FUNCTION,"  * MEMORY_OUT[0] transaction");
    443445
    444446            switch (internal_MEMORY_OUT_SELECT_QUEUE)
     
    498500            (PORT_READ(in_DCACHE_REQ_ACK[0]) == 1))
    499501          {
    500             log_printf(TRACE,Load_store_unit,FUNCTION,"  * DCACHE_REQ");
     502            log_printf(TRACE,Load_store_unit,FUNCTION,"  * DCACHE_REQ[0]");
    501503
    502504            switch (internal_DCACHE_REQ_SELECT_QUEUE)
     
    602604            (    internal_DCACHE_RSP_ACK == 1))
    603605          {
    604             log_printf(TRACE,Load_store_unit,FUNCTION,"  * DCACHE_RSP");
     606            log_printf(TRACE,Load_store_unit,FUNCTION,"  * DCACHE_RSP [0]");
    605607
    606608            // don't use context_id : because there are one queue for all thread
     
    610612            Tdcache_error_t error      = PORT_READ(in_DCACHE_RSP_ERROR     [0]);
    611613
    612             log_printf(TRACE,Load_store_unit,FUNCTION,"    * original packet_id : %d", packet_id);
     614            log_printf(TRACE,Load_store_unit,FUNCTION,"    * original packet_id : %d"  , packet_id);
     615            log_printf(TRACE,Load_store_unit,FUNCTION,"    * rdata              : %.8x", rdata);
     616            log_printf(TRACE,Load_store_unit,FUNCTION,"    * error              : %d"  , error);
    613617           
    614618            if (DCACHE_RSP_IS_LOAD(packet_id) == 1)
     
    623627                  throw ErrorMorpheo(_("Receive of respons, but the corresponding operation don't wait a respons."));
    624628#endif
    625                
     629
     630                _load_queue [packet_id]._rdata = rdata;
    626631               
    627632                if (error != DCACHE_ERROR_NONE)
     
    639644                    // FIXME : convention : if bus error, the cache return the fautive address !
    640645                    // But, the load's address is aligned !
    641                     _load_queue [packet_id]._rdata = rdata;
    642                
     646
    643647                    switch (_load_queue [packet_id]._state)
    644648                      {
     
    695699            uint32_t j = (*_speculative_access_queue_control)[i];
    696700
    697             log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d %.4d, %.8x, %.1d %.6d, %.2d, %s",
     701            log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d %.4d, %.8x, %.1d %.4d, %.2d, %s",
    698702                       j,
    699703                       _speculative_access_queue[j]._context_id          ,
     
    719723            uint32_t j = i;
    720724
    721             log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.1x %.1d %.2d %.1d %.2d, %.8x, %.1d %.6d, %.2d, %s",
     725            log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.1x %.1d %.2d %.1d %.2d, %.8x, %.1d %.4d, %.2d, %s",
    722726                       j,
    723727                       _load_queue[j]._context_id          ,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_vhdl.cpp

    r100 r101  
    3333      (_param->_size_queue,
    3434       _param->_size_internal_queue,
    35        0
     35       0,
     36       false,
     37       false
    3638       );
    3739   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Execute_queue.h

    r97 r101  
    1414
    1515#include <iostream>
    16 #include <queue>
     16#include <list>
    1717#include "Common/include/ToString.h"
    1818#include "Common/include/Debug.h"
     
    9999   
    100100    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    101   private   : std::queue<execute_queue_entry_t *> * _queue;
     101  private   : std::list<execute_queue_entry_t *> * _queue;
    102102    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    103103  private   : Tcontrol_t                       internal_EXECUTE_QUEUE_IN_ACK ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_allocation.cpp

    r97 r101  
    9696    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    9797
    98      _queue = new std::queue<execute_queue_entry_t *>;
     98     _queue = new std::list<execute_queue_entry_t *>;
    9999
    100100#ifdef POSITION
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_deallocation.cpp

    r88 r101  
    7272      {
    7373        delete _queue->front();
    74         _queue->pop();
     74        _queue->pop_front();
    7575      }
    7676    delete _queue;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_genMoore.cpp

    r96 r101  
    2323  void Execute_queue::genMoore (void)
    2424  {
    25     log_printf(FUNC,Execute_queue,FUNCTION,"Begin");
     25    log_begin(Execute_queue,FUNCTION);
     26    log_function(Execute_queue,FUNCTION,_name.c_str());
    2627
    2728    // -----[ Interface "execute_queue_in" ]--------------------------------
     
    5960    }
    6061
    61     log_printf(FUNC,Execute_queue,FUNCTION,"End");
     62    log_end(Execute_queue,FUNCTION);
    6263  };
    6364
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_transition.cpp

    r96 r101  
    2323  void Execute_queue::transition (void)
    2424  {
    25     log_printf(FUNC,Execute_queue,FUNCTION,"Begin");
     25    log_begin(Execute_queue,FUNCTION);
     26    log_function(Execute_queue,FUNCTION,_name.c_str());
    2627
    2728    if (PORT_READ(in_NRESET) == 0)
     
    3233        // > 2) flush all slot in one cycle
    3334
    34         while (_queue->empty() == false)
    35           _queue->pop();
     35        _queue->clear();
    3636      }
    3737    else
     
    5353               PORT_READ(in_EXECUTE_QUEUE_IN_DATA         ));
    5454           
    55             _queue->push(entry);
     55            _queue->push_back(entry);
    5656          }
    5757
     
    6060          {
    6161            delete _queue->front();
    62             _queue->pop();
     62            _queue->pop_front();
    6363          }
    6464      }
     
    6969#endif
    7070   
     71#if DEBUG_Execute_queue and (DEBUG >= DEBUG_TRACE)
     72    log_printf(TRACE,Execute_queue,FUNCTION,"  * Dump Execute_queue");
     73    {
     74      uint32_t i=0;
     75      for (std::list<execute_queue_entry_t *>::iterator it=_queue->begin();
     76           it!=_queue->end();
     77           ++it)
     78        {
     79          log_printf(TRACE,Execute_queue,FUNCTION,"  [%d] %.2d %.2d %.2d, %.4d, %.1d, %.2d %.1d, %.8x %.8x",
     80                     i,
     81                     (*it)->_context_id   ,
     82                     (*it)->_front_end_id ,
     83                     (*it)->_ooo_engine_id,
     84                     (*it)->_packet_id    ,
     85                   //(*it)->_operation    ,
     86                   //(*it)->_type         ,
     87                     (*it)->_flags        ,
     88                     (*it)->_exception    ,
     89                     (*it)->_no_sequence  ,
     90                     (*it)->_address      ,
     91                     (*it)->_data
     92                     );
     93          i++;
     94        }
     95    }
     96#endif
     97
    7198
    7299#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     
    74101#endif
    75102
    76     log_printf(FUNC,Execute_queue,FUNCTION,"End");
     103    log_end(Execute_queue,FUNCTION);
    77104  };
    78105
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/src/Execute_queue_vhdl.cpp

    r100 r101  
    3535      (_param->_size_queue,
    3636       _param->_size_internal_queue,
    37        0
     37       0,
     38       false,
     39       false
    3840       );
    3941   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Write_queue_genMoore.cpp

    r88 r101  
    2323  void Write_queue::genMoore (void)
    2424  {
    25     log_printf(FUNC,Write_queue,FUNCTION,"Begin");
     25    log_begin(Write_queue,FUNCTION);
     26    log_function(Write_queue,FUNCTION,_name.c_str());
    2627   
    2728    // -----[ Interface "Write_queue_in" ]--------------------------------
     
    109110        }
    110111    }
    111     log_printf(FUNC,Write_queue,FUNCTION,"End");
     112    log_end(Write_queue,FUNCTION);
    112113  };
    113114
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/src/Write_queue_transition.cpp

    r97 r101  
    2424  void Write_queue::transition (void)
    2525  {
    26     log_printf(FUNC,Write_queue,FUNCTION,"Begin");
     26    log_begin(Write_queue,FUNCTION);
     27    log_function(Write_queue,FUNCTION,_name.c_str());
    2728
    2829    if (PORT_READ(in_NRESET) == 0)
     
    8788#endif
    8889
     90#if DEBUG_Write_queue and (DEBUG >= DEBUG_TRACE)
     91    log_printf(TRACE,Write_queue,FUNCTION,"  * Dump Write_queue");
     92    {
     93      uint32_t i=0;
     94     
     95      for (std::list<write_queue_entry_t *>::iterator it=_queue->begin();
     96           it!=_queue->end();
     97           ++it)
     98        {
     99          log_printf(TRACE,Write_queue,FUNCTION,"  [%d] %.2d %.2d %.2d, %.4d, %.1d %.4d %.8x, %.1d %.4d %.1d, %.2d %.1d, %.8x",
     100                     i,
     101                     (*it)->_context_id   ,
     102                     (*it)->_front_end_id ,
     103                     (*it)->_ooo_engine_id,
     104                     (*it)->_packet_id    ,
     105                   //(*it)->_operation    ,
     106                   //(*it)->_type         ,
     107                     (*it)->_write_rd     ,
     108                     (*it)->_num_reg_rd   ,
     109                     (*it)->_data_rd      ,
     110                     (*it)->_write_re     ,
     111                     (*it)->_num_reg_re   ,
     112                     (*it)->_data_re      ,
     113                     (*it)->_exception    ,
     114                     (*it)->_no_sequence  ,
     115                     (*it)->_address      );
     116          i++;
     117        }
     118    }
     119#endif
     120
    89121#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    90122    end_cycle ();
    91123#endif
    92124
    93     log_printf(FUNC,Write_queue,FUNCTION,"End");
     125    log_end(Write_queue,FUNCTION);
    94126  };
    95127
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/src/Parameters.cpp

    r88 r101  
    104104           0,
    105105           nb_general_register[i],
    106            1);
     106           1,
     107           "1");
    107108       
    108109        __param_spr        [i] = new morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters
     
    122123           0,
    123124           nb_special_register[i],
    124            1);   
     125           1,
     126           "1");         
    125127       
    126128        _param_gpr        [i] = new morpheo::behavioural::generic::registerfile::Parameters (__param_gpr        [i]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/src/test.cpp

    r98 r101  
    213213  // Initialisation
    214214
     215  const bool test1  = true;
     216  const bool test2  = true;
     217  const bool test3  = true;
     218  const bool test4  = true;
     219  const bool test5  = true;
     220  const bool test6  = true;
     221  const bool test7  = true;
     222  const bool test8  = true;
     223  const bool test9  = true;
     224  const bool test10 = true;
     225  const bool test11 = true;
     226  const bool test12 = true;
     227
    215228  const uint32_t seed = 0;
    216229//const uint32_t seed = static_cast<uint32_t>(time(NULL));
     
    264277      uint32_t context    = rand()%_param->_nb_context;
    265278
    266       if (1)
     279      if (test1)
    267280        {
    268281          SC_START(3);
     
    285298          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
    286299         
    287           do
    288             {
    289               in_DECOD_EVENT_VAL [port]->write(rand()%percent_transaction_decod_event);
    290              
    291               SC_START(1);
    292             }
    293           while (not ( in_DECOD_EVENT_VAL [port]->read() and
    294                        out_DECOD_EVENT_ACK [port]->read()));
    295           in_DECOD_EVENT_VAL [port]->write(0);
     300          in_DECOD_EVENT_VAL           [port]->write(1);
     301
     302          SC_START(0);
     303          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     304          TEST(Tcontrol_t, out_DECOD_EVENT_ACK     [port]   ->read(), 0);
     305
     306          SC_START(1);
     307
     308          in_NB_INST_DECOD_ALL  [context]->write(0);
     309          in_NB_INST_COMMIT_ALL [context]->write(0);
     310          in_NB_INST_COMMIT_MEM [context]->write(0);
     311         
     312          LABEL("msync (send decod)");
     313          SC_START(0);
     314          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     315          TEST(Tcontrol_t, out_DECOD_EVENT_ACK     [port]   ->read(), 1);
     316
     317          SC_START(1);
     318
     319          in_DECOD_EVENT_VAL     [port]->write(0);
     320          in_NB_INST_COMMIT_ALL  [context]->write(1);
    296321         
    297322          LABEL("msync (wait end)");
     
    300325          SC_START(3);
    301326         
    302           in_NB_INST_DECOD_ALL  [context]->write(0);
    303           in_NB_INST_COMMIT_ALL [context]->write(1);
    304           in_NB_INST_COMMIT_MEM [context]->write(0);
    305          
    306           SC_START(1);
    307          
    308           LABEL("msync (send decod)");
    309           TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
    310          
    311           SC_START(3);
    312          
    313           in_NB_INST_DECOD_ALL  [context]->write(1);
    314           SC_START(1);
    315          
    316           LABEL("msync (wait end)");
    317           TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
    318           in_NB_INST_DECOD_ALL  [context]->write(0);
    319           in_NB_INST_COMMIT_MEM [context]->write(1);
    320          
    321           SC_START(3);
    322          
    323           in_NB_INST_COMMIT_MEM [context]->write(0);
     327          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
     328          in_NB_INST_COMMIT_ALL [context]->write(0);
     329
    324330          SC_START(1);
    325331          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
    326332        }
    327333     
    328       if (1)
     334      if (test2)
    329335        {
    330336          SC_START(3);
    331 
     337         
    332338          LABEL("psync (begin)");
    333           in_NB_INST_DECOD_ALL  [context]->write(1);
    334           in_NB_INST_COMMIT_ALL [context]->write(1);
    335           in_NB_INST_COMMIT_MEM [context]->write(1);
    336          
    337           uint32_t port = rand()%_param->_nb_decod_unit;
    338          
    339           in_DECOD_EVENT_CONTEXT_ID    [port]->write(context);
    340           in_DECOD_EVENT_IS_DELAY_SLOT [port]->write(0);
    341           in_DECOD_EVENT_ADDRESS       [port]->write(0x200);
    342           in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdeadbebe);
    343           if (_param->_have_port_depth)
    344           in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
    345           in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_PSYNC);
    346          
    347           TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
    348          
    349           do
    350             {
    351               in_DECOD_EVENT_VAL [port]->write(rand()%percent_transaction_decod_event);
    352          
    353               SC_START(1);
    354             }
    355           while (not ( in_DECOD_EVENT_VAL [port]->read() and
    356                        out_DECOD_EVENT_ACK [port]->read()));
    357           in_DECOD_EVENT_VAL [port]->write(0);
    358          
    359           LABEL("psync (wait end)");
    360           TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
    361          
    362           SC_START(3);
    363          
    364           in_NB_INST_DECOD_ALL  [context]->write(0);
    365           in_NB_INST_COMMIT_ALL [context]->write(0);
    366           in_NB_INST_COMMIT_MEM [context]->write(0);
    367          
    368           SC_START(1);
    369 
    370           bool find = false;
    371           do
    372             {
    373               in_EVENT_ACK [context]->write(rand()%percent_transaction_event);
    374          
    375               SC_START(0);
    376          
    377               if (out_EVENT_VAL [context]->read() and in_EVENT_ACK [context]->read())
    378                 {
    379                   TEST(Taddress_t,out_EVENT_ADDRESS          [context]->read(),0x201);
    380                   TEST(Taddress_t,out_EVENT_ADDRESS_NEXT     [context]->read(),0xdeadbebe);
    381                   TEST(Tcontrol_t,out_EVENT_ADDRESS_NEXT_VAL [context]->read(),0);
    382                   TEST(Tcontrol_t,out_EVENT_IS_DS_TAKE       [context]->read(),0);
    383                  
    384                   find = true;
    385                 }
    386              
    387               SC_START(1);
    388             }
    389           while (not find);
    390 
    391           in_EVENT_ACK [context]->write(0);
    392           TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
    393         }
    394 
    395       if (1)
    396         {
    397           SC_START(3);
    398 
    399           LABEL("csync (begin)");
    400339          in_NB_INST_DECOD_ALL  [context]->write(1);
    401340          in_NB_INST_COMMIT_ALL [context]->write(1);
     
    410349          if (_param->_have_port_depth)
    411350          in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
    412           in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_CSYNC);
    413          
    414           TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
    415          
    416           do
    417             {
    418               in_DECOD_EVENT_VAL [port]->write(rand()%percent_transaction_decod_event);
    419          
    420               SC_START(1);
    421             }
    422           while (not ( in_DECOD_EVENT_VAL [port]->read() and
    423                        out_DECOD_EVENT_ACK [port]->read()));
    424           in_DECOD_EVENT_VAL [port]->write(0);
    425          
    426           LABEL("csync (wait end)");
    427           TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
    428          
    429           SC_START(3);
    430          
     351          in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_PSYNC);
     352         
     353          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     354         
     355          in_DECOD_EVENT_VAL           [port]->write(1);
     356
     357          SC_START(0);
     358          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     359          TEST(Tcontrol_t, out_DECOD_EVENT_ACK     [port]   ->read(), 0);
     360
     361          SC_START(1);
     362
    431363          in_NB_INST_DECOD_ALL  [context]->write(0);
    432364          in_NB_INST_COMMIT_ALL [context]->write(0);
    433365          in_NB_INST_COMMIT_MEM [context]->write(0);
    434          
     366         
     367          LABEL("psync (send decod)");
     368          SC_START(0);
     369          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     370          TEST(Tcontrol_t, out_DECOD_EVENT_ACK     [port]   ->read(), 1);
     371
     372          SC_START(1);
     373
     374          in_DECOD_EVENT_VAL     [port]->write(0);
     375          in_NB_INST_COMMIT_ALL  [context]->write(1);
     376         
     377          LABEL("psync (wait end)");
     378          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
     379         
     380          SC_START(3);
     381         
     382          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
     383          in_NB_INST_COMMIT_ALL [context]->write(0);
     384
    435385          SC_START(1);
    436386
     
    448398                  TEST(Tcontrol_t,out_EVENT_ADDRESS_NEXT_VAL [context]->read(),0);
    449399                  TEST(Tcontrol_t,out_EVENT_IS_DS_TAKE       [context]->read(),0);
    450          
    451                   find = true;
    452                 }
    453              
    454               SC_START(1);
    455             }
    456           while (not find);
     400                 
     401                  find = true;
     402                }
     403             
     404              SC_START(1);
     405            }
     406          while (not find);
     407
    457408          in_EVENT_ACK [context]->write(0);
     409          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
    458410        }
    459411
    460       if (1)
     412      if (test3)
    461413        {
    462414          SC_START(3);
    463415         
    464           LABEL("spr (begin)");
     416          LABEL("csync (begin)");
    465417          in_NB_INST_DECOD_ALL  [context]->write(1);
    466418          in_NB_INST_COMMIT_ALL [context]->write(1);
     
    471423          in_DECOD_EVENT_CONTEXT_ID    [port]->write(context);
    472424          in_DECOD_EVENT_IS_DELAY_SLOT [port]->write(0);
    473           in_DECOD_EVENT_ADDRESS       [port]->write(0x100);
    474           in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdeadbeef);
     425          in_DECOD_EVENT_ADDRESS       [port]->write(0x300);
     426          in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdead0300);
     427          if (_param->_have_port_depth)
     428          in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     429          in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_CSYNC);
     430         
     431          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     432         
     433          in_DECOD_EVENT_VAL           [port]->write(1);
     434
     435          SC_START(0);
     436          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     437          TEST(Tcontrol_t, out_DECOD_EVENT_ACK     [port]   ->read(), 0);
     438
     439          SC_START(1);
     440
     441          in_NB_INST_DECOD_ALL  [context]->write(0);
     442          in_NB_INST_COMMIT_ALL [context]->write(0);
     443          in_NB_INST_COMMIT_MEM [context]->write(0);
     444         
     445          LABEL("csync (send decod)");
     446          SC_START(0);
     447          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     448          TEST(Tcontrol_t, out_DECOD_EVENT_ACK     [port]   ->read(), 1);
     449
     450          SC_START(1);
     451
     452          in_DECOD_EVENT_VAL     [port]->write(0);
     453          in_NB_INST_COMMIT_ALL  [context]->write(1);
     454         
     455          LABEL("csync (wait end)");
     456          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
     457         
     458          SC_START(3);
     459         
     460          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
     461          in_NB_INST_COMMIT_ALL [context]->write(0);
     462
     463          SC_START(1);
     464
     465          bool find = false;
     466          do
     467            {
     468              in_EVENT_ACK [context]->write(rand()%percent_transaction_event);
     469         
     470              SC_START(0);
     471         
     472              if (out_EVENT_VAL [context]->read() and in_EVENT_ACK [context]->read())
     473                {
     474                  TEST(Taddress_t,out_EVENT_ADDRESS          [context]->read(),0x301);
     475                  TEST(Taddress_t,out_EVENT_ADDRESS_NEXT     [context]->read(),0xdead0300);
     476                  TEST(Tcontrol_t,out_EVENT_ADDRESS_NEXT_VAL [context]->read(),0);
     477                  TEST(Tcontrol_t,out_EVENT_IS_DS_TAKE       [context]->read(),0);
     478                 
     479                  find = true;
     480                }
     481             
     482              SC_START(1);
     483            }
     484          while (not find);
     485
     486          in_EVENT_ACK [context]->write(0);
     487          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     488
     489        }
     490
     491      if (test4)
     492        {
     493          SC_START(3);
     494         
     495          LABEL("spr_access (begin)");
     496          in_NB_INST_DECOD_ALL  [context]->write(1);
     497          in_NB_INST_COMMIT_ALL [context]->write(1);
     498          in_NB_INST_COMMIT_MEM [context]->write(1);
     499         
     500          uint32_t port = rand()%_param->_nb_decod_unit;
     501         
     502          in_DECOD_EVENT_CONTEXT_ID    [port]->write(context);
     503          in_DECOD_EVENT_IS_DELAY_SLOT [port]->write(0);
     504          in_DECOD_EVENT_ADDRESS       [port]->write(0x400);
     505          in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdead0400);
    475506          if (_param->_have_port_depth)
    476507          in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     
    479510          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
    480511         
    481           do
    482             {
    483               in_DECOD_EVENT_VAL [port]->write(rand()%percent_transaction_decod_event);
    484              
    485               SC_START(1);
    486             }
    487           while (not ( in_DECOD_EVENT_VAL [port]->read() and
    488                        out_DECOD_EVENT_ACK [port]->read()));
    489           in_DECOD_EVENT_VAL [port]->write(0);
    490          
    491           LABEL("spr (wait end)");
    492           TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
    493          
    494           SC_START(3);
    495          
     512          in_DECOD_EVENT_VAL           [port]->write(1);
     513
     514          SC_START(0);
     515          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     516          TEST(Tcontrol_t, out_DECOD_EVENT_ACK     [port]   ->read(), 0);
     517
     518          SC_START(1);
     519
    496520          in_NB_INST_DECOD_ALL  [context]->write(0);
    497521          in_NB_INST_COMMIT_ALL [context]->write(0);
    498522          in_NB_INST_COMMIT_MEM [context]->write(0);
    499          
    500           SC_START(1);
    501          
    502           LABEL("spr (send decod)");
    503           TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
    504          
    505           SC_START(3);
    506          
    507           in_NB_INST_DECOD_ALL  [context]->write(1);
    508           SC_START(1);
    509          
    510           LABEL("spr (wait end)");
    511           TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
    512           in_NB_INST_DECOD_ALL  [context]->write(0);
    513           in_NB_INST_COMMIT_ALL [context]->write(1);
    514          
    515           SC_START(3);
    516          
    517           in_NB_INST_COMMIT_ALL [context]->write(0);
     523         
     524          LABEL("spr_access (send decod)");
     525          SC_START(0);
     526          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
     527          TEST(Tcontrol_t, out_DECOD_EVENT_ACK     [port]   ->read(), 1);
     528
     529          SC_START(1);
     530
     531          in_DECOD_EVENT_VAL     [port]->write(0);
     532          in_NB_INST_COMMIT_ALL  [context]->write(1);
     533         
     534          LABEL("spr_access (wait end)");
     535          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
     536         
     537          SC_START(3);
     538         
     539          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0);
     540          in_NB_INST_COMMIT_ALL [context]->write(0);
     541
    518542          SC_START(1);
    519543          TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1);
    520544        }
    521545
    522       if (1)
     546      if (test5)
    523547        {
    524548          SC_START(3);
     
    610634        }
    611635
    612       if (1)
     636      if (test6)
    613637        {
    614638          SC_START(3);
     
    697721        }
    698722
    699       if (1)
     723      if (test7)
    700724        {
    701725          SC_START(3);
     
    791815        }
    792816
    793       if (1)
     817      if (test8)
    794818        {
    795819          SC_START(3);
     
    885909        }
    886910
    887       if (1)
     911      if (test9)
    888912        {
    889913          SC_START(3);
     
    9791003        }
    9801004     
    981       if (1)
     1005      if (test10)
    9821006        {
    9831007          SC_START(3);
     
    10731097        }
    10741098
    1075       if (1)
     1099      if (test11)
    10761100        {
    10771101          SC_START(3);
     
    11671191        }
    11681192     
    1169       if (1)
     1193      if (test12)
    11701194        {
    11711195          SC_START(3);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Context_State.h

    r98 r101  
    197197  public  : void        transition                (void);
    198198  public  : void        genMoore                  (void);
     199  public  : void        genMealy_decod_event      (void);
    199200#endif                                         
    200201
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Types.h

    r83 r101  
    2929      CONTEXT_STATE_KO_EXCEP_ADDR   , // update address manager
    3030      CONTEXT_STATE_KO_EXCEP_SPR    , // update spr (epc, esr, sr[DSX])
    31       CONTEXT_STATE_KO_MISS         , // wait end of event (miss (branch, load))
    3231      CONTEXT_STATE_KO_MISS_ADDR    , // update address manager
    33       CONTEXT_STATE_KO_MSYNC        , // wait completion of all memory operation
    34       CONTEXT_STATE_KO_MSYNC_ISSUE  , // issue msync operation
     32      CONTEXT_STATE_KO_MISS_WAITEND , // wait end of event (miss (branch, load))
     33//    CONTEXT_STATE_KO_MSYNC        , // wait completion of all memory operation
     34//    CONTEXT_STATE_KO_MSYNC_ISSUE  , // issue msync operation
    3535      CONTEXT_STATE_KO_MSYNC_EXEC   , // wait completion of     msync  operation
    36       CONTEXT_STATE_KO_PSYNC        , // wait completion of all        operation and after flush pipeline
     36//    CONTEXT_STATE_KO_PSYNC        , // wait completion of all        operation and after flush pipeline
    3737      CONTEXT_STATE_KO_PSYNC_FLUSH  , // wait completion of all
    3838      CONTEXT_STATE_KO_PSYNC_ADDR   , // wait completion of all
    39       CONTEXT_STATE_KO_CSYNC        , // wait completion of all        operation and after flush pipeline and flush ALL units (MMU, cache ...)
     39//    CONTEXT_STATE_KO_CSYNC        , // wait completion of all        operation and after flush pipeline and flush ALL units (MMU, cache ...)
    4040      CONTEXT_STATE_KO_CSYNC_FLUSH  ,
    4141      CONTEXT_STATE_KO_CSYNC_ADDR   ,
    42       CONTEXT_STATE_KO_SPR          , // wait completion of all        operation
    43       CONTEXT_STATE_KO_SPR_ISSUE    , // issue spr's access
     42//    CONTEXT_STATE_KO_SPR          , // wait completion of all        operation
     43//    CONTEXT_STATE_KO_SPR_ISSUE    , // issue spr's access
    4444      CONTEXT_STATE_KO_SPR_EXEC       // wait completion of all        operation (spr access)
    4545    } context_state_t;
     
    6060      case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_EXCEP_ADDR   : return "context_state_ko_excep_addr"  ; break;
    6161      case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_EXCEP_SPR    : return "context_state_ko_excep_spr"   ; break;
    62       case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_MISS         : return "context_state_ko_miss"        ; break;
    6362      case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_MISS_ADDR    : return "context_state_ko_miss_addr"   ; break;
    64       case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_MSYNC        : return "context_state_ko_msync"       ; break;
    65       case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_MSYNC_ISSUE  : return "context_state_ko_msync_issue" ; break;
     63      case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_MISS_WAITEND : return "context_state_ko_miss_waitend"; break;
     64//       case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_MSYNC        : return "context_state_ko_msync"       ; break;
     65//    case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_MSYNC_ISSUE  : return "context_state_ko_msync_issue" ; break;
    6666      case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_MSYNC_EXEC   : return "context_state_ko_msync_exec"  ; break;
    67       case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_PSYNC        : return "context_state_ko_psync"       ; break;
     67//    case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_PSYNC        : return "context_state_ko_psync"       ; break;
    6868      case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_PSYNC_FLUSH  : return "context_state_ko_psync_flush" ; break;
    6969      case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_PSYNC_ADDR   : return "context_state_ko_psync_addr"  ; break;
    70       case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_CSYNC        : return "context_state_ko_csync"       ; break;
     70//    case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_CSYNC        : return "context_state_ko_csync"       ; break;
    7171      case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_CSYNC_FLUSH  : return "context_state_ko_csync_flush" ; break;
    7272      case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_CSYNC_ADDR   : return "context_state_ko_csync_addr"  ; break;
    73       case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_SPR          : return "context_state_ko_spr"         ; break;
    74       case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_SPR_ISSUE    : return "context_state_ko_spr_issue"   ; break;
     73//    case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_SPR          : return "context_state_ko_spr"         ; break;
     74//    case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_SPR_ISSUE    : return "context_state_ko_spr_issue"   ; break;
    7575      case morpheo::behavioural::core::multi_front_end::front_end::context_state::CONTEXT_STATE_KO_SPR_EXEC     : return "context_state_ko_spr_exec"    ; break;
    7676      default    : return ""      ; break;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State.cpp

    r88 r101  
    8282          }
    8383
    84         for (uint32_t i=0; i<_param->_nb_decod_unit; i++)
    85           {
    86             internal_DECOD_EVENT_ACK [i] = 1;
    87             PORT_WRITE(out_DECOD_EVENT_ACK [i], internal_DECOD_EVENT_ACK [i]);
    88           }
     84//      for (uint32_t i=0; i<_param->_nb_decod_unit; i++)
     85//        {
     86//          internal_DECOD_EVENT_ACK [i] = 1;
     87//          PORT_WRITE(out_DECOD_EVENT_ACK [i], internal_DECOD_EVENT_ACK [i]);
     88//        }
    8989
    9090        internal_COMMIT_EVENT_ACK = 1;
     
    112112        dont_initialize ();
    113113        sensitive << (*(in_CLOCK)).neg(); // use internal register
     114       
     115# ifdef SYSTEMCASS_SPECIFIC
     116        // List dependency information
     117# endif   
     118
     119        log_printf(INFO,Context_State,FUNCTION,_("Method - genMealy_decod_event"));
     120
     121        SC_METHOD (genMealy_decod_event);
     122        dont_initialize ();
     123        sensitive << (*(in_CLOCK)).neg(); // use internal register
     124        for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
     125          {
     126            sensitive << (*(in_DECOD_EVENT_VAL        [i])) // not necessary
     127                      << (*(in_DECOD_EVENT_TYPE       [i]));
     128            if (_param->_have_port_context_id)                                 
     129            sensitive << (*(in_DECOD_EVENT_CONTEXT_ID [i]));
     130          }
     131        for (uint32_t i=0; i<_param->_nb_context; ++i)
     132          {
     133            sensitive << (*(in_NB_INST_DECOD_ALL      [i]))
     134                      << (*(in_NB_INST_COMMIT_ALL     [i]))
     135                      << (*(in_NB_INST_COMMIT_MEM     [i]));
     136          }
    114137       
    115138# ifdef SYSTEMCASS_SPECIFIC
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_genMoore.cpp

    r97 r101  
    105105        context_state_t state = reg_STATE [i];
    106106
    107         PORT_WRITE(out_CONTEXT_DECOD_ENABLE [i], ((state==CONTEXT_STATE_OK            ) or
    108                                                   (state==CONTEXT_STATE_KO_MSYNC_ISSUE) or
    109                                                   (state==CONTEXT_STATE_KO_SPR_ISSUE  )));
     107//      PORT_WRITE(out_CONTEXT_DECOD_ENABLE [i], ((state==CONTEXT_STATE_OK            ) or
     108//                                                (state==CONTEXT_STATE_KO_MSYNC_ISSUE) or
     109//                                                (state==CONTEXT_STATE_KO_SPR_ISSUE  )));
     110        PORT_WRITE(out_CONTEXT_DECOD_ENABLE [i], (state==CONTEXT_STATE_OK));
    110111      }
    111112
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp

    r98 r101  
    3535      {
    3636        // -------------------------------------------------------------------
     37        // -----[ next state ]------------------------------------------------
     38        // -------------------------------------------------------------------
     39        for (uint32_t i=0; i<_param->_nb_context; i++)
     40          {
     41//             uint32_t x = _param->_link_context_to_decod_unit    [i];
     42
     43            Tcounter_t inst_all = PORT_READ(in_NB_INST_COMMIT_ALL[i]) + PORT_READ(in_NB_INST_DECOD_ALL [i]);
     44//          Tcounter_t inst_mem = PORT_READ(in_NB_INST_COMMIT_MEM[i]) + PORT_READ(in_NB_INST_DECOD_ALL [i]);
     45
     46            context_state_t state = reg_STATE [i];
     47
     48            switch (state)
     49              {
     50              case CONTEXT_STATE_OK              :
     51                {
     52                  // nothing, wait an event
     53                  break;
     54                }
     55              case CONTEXT_STATE_KO_EXCEP        :
     56                {
     57                  // Wait end of all instruction
     58                  if (inst_all == 0)
     59                    state = CONTEXT_STATE_KO_EXCEP_ADDR;
     60                  break;
     61                }
     62              case CONTEXT_STATE_KO_EXCEP_ADDR   :
     63                {
     64                  // nothing, wait the update of internal register (pc)
     65                  break;
     66                }
     67              case CONTEXT_STATE_KO_MISS_WAITEND :
     68                {
     69                  // Wait end of all instruction
     70                  if (inst_all == 0)
     71                   
     72//                  state = CONTEXT_STATE_OK; // @@@ TODO : make MISS fast (miss decod)
     73                    state = CONTEXT_STATE_KO_MISS_ADDR;
     74                  break;
     75                }
     76              case CONTEXT_STATE_KO_EXCEP_SPR    :
     77                {
     78                  // nothing, wait the update of internal register (epcr, eear, sr, esr)
     79                  break;
     80                }
     81              case CONTEXT_STATE_KO_MISS_ADDR    :
     82                {
     83                  // nothing, wait the update of internal register (pc)
     84                  break;
     85                }
     86//               case CONTEXT_STATE_KO_PSYNC        :
     87//                 {
     88//                   // Wait end of all instruction
     89//                   if (inst_all == 0)
     90//                     state = CONTEXT_STATE_KO_PSYNC_FLUSH;
     91//                   break;
     92//                 }
     93              case CONTEXT_STATE_KO_PSYNC_FLUSH  :
     94                {
     95                  // nothing, wait end of flush (ifetch)
     96                  if (inst_all == 0)
     97//                  state = CONTEXT_STATE_KO_PSYNC_ADDR;
     98                    state = CONTEXT_STATE_OK;
     99                   
     100                  break;
     101                }
     102              case CONTEXT_STATE_KO_PSYNC_ADDR   :
     103                {
     104                  // nothing, wait the pc write
     105                  break;
     106                }
     107//               case CONTEXT_STATE_KO_CSYNC        :
     108//                 {
     109//                   // Wait end of all instruction
     110//                   if (inst_all == 0)
     111//                     state = CONTEXT_STATE_KO_CSYNC_FLUSH;
     112//                   break;
     113//                 }
     114              case CONTEXT_STATE_KO_CSYNC_FLUSH  :
     115                {
     116                  // nothing, wait end of flush (all internal structure)
     117                  if (inst_all == 0)
     118                    state = CONTEXT_STATE_KO_CSYNC_ADDR;
     119                  break;
     120                }
     121              case CONTEXT_STATE_KO_CSYNC_ADDR   :
     122                {
     123                  // nothing, wait the pc write
     124                  break;
     125                }
     126//               case CONTEXT_STATE_KO_MSYNC        :
     127//                 {
     128//                   // Wait end of memory instruction
     129//                   if (inst_mem == 0)
     130//                     state = CONTEXT_STATE_KO_MSYNC_ISSUE;
     131//                   break;
     132//                 }
     133//               case CONTEXT_STATE_KO_MSYNC_ISSUE  :
     134//                 {
     135//                   // Wait the msync issue
     136//                   if (inst_mem != 0)
     137//                     state = CONTEXT_STATE_KO_MSYNC_EXEC;
     138//                   break;
     139//                 }
     140              case CONTEXT_STATE_KO_MSYNC_EXEC   :
     141                {
     142                  // Wait the end of msync
     143                  if (inst_all == 0)
     144                    state = CONTEXT_STATE_OK;
     145                  break;
     146                }
     147//               case CONTEXT_STATE_KO_SPR          :
     148//                 {
     149//                   // Wait end of all instruction
     150//                   if (inst_all == 0)
     151//                     state = CONTEXT_STATE_KO_SPR_ISSUE;
     152//                   break;
     153//                 }
     154//               case CONTEXT_STATE_KO_SPR_ISSUE    :
     155//                 {
     156//                   // Wait the spr_access issue
     157//                   if (inst_all != 0)
     158//                     state = CONTEXT_STATE_KO_SPR_EXEC;
     159//                   break;
     160//                 }
     161              case CONTEXT_STATE_KO_SPR_EXEC     :
     162                {
     163                  // Wait the spr_access execution
     164                  if (inst_all == 0)
     165                    state = CONTEXT_STATE_OK;
     166                  break;
     167                }
     168
     169              default :
     170                {
     171                  throw ERRORMORPHEO(FUNCTION,toString(_("Context[%d], Unknow state : %s.\n"),i,toString(state).c_str()));
     172                }
     173              }
     174            reg_STATE [i] = state;
     175          }
     176
     177        // -------------------------------------------------------------------
    37178        // -----[ BRANCH_EVENT ]----------------------------------------------
    38179        // -------------------------------------------------------------------
     
    57198
    58199              // priority : miss > excep > spr/sync
    59               uint8_t    priority0  = (state == CONTEXT_STATE_KO_MISS)?2:((state == EVENT_TYPE_EXCEPTION)?1:0);
     200              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_ADDR) or (state == CONTEXT_STATE_KO_MISS_WAITEND))?2:((state == EVENT_TYPE_EXCEPTION)?1:0);
    60201              uint8_t    priority1  = 2; // miss
    61202
     
    71212                {
    72213                  Tcontrol_t dest_val = PORT_READ(in_BRANCH_EVENT_ADDRESS_DEST_VAL[i]);
    73                   reg_STATE                  [i] =  CONTEXT_STATE_KO_MISS;
     214//                reg_STATE                  [i] =  CONTEXT_STATE_KO_MISS_ADDR;
     215                  reg_STATE                  [i] =  CONTEXT_STATE_KO_MISS_WAITEND; //@@@ TODO : make MISS fast (miss decod)
    74216                  reg_EVENT_ADDRESS          [i] =  PORT_READ(in_BRANCH_EVENT_ADDRESS_SRC  [i])+1; // address delay slot
    75217                  reg_EVENT_ADDRESS_EPCR     [i] =  PORT_READ(in_BRANCH_EVENT_ADDRESS_DEST [i]);   // address_next
     
    107249             
    108250              // miss > excep > spr/sync
    109               uint8_t    priority0  = (state == CONTEXT_STATE_KO_MISS)?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
     251              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_ADDR) or (state == CONTEXT_STATE_KO_MISS_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
    110252              uint8_t    priority1  = (state == EVENT_TYPE_EXCEPTION)?1:0;
    111253
     
    120262              if (is_valid)
    121263                {
     264                  log_printf(TRACE,Context_State,FUNCTION,"    * is_valid");
     265
    122266                  // decod :
    123267                  // type : csync, psync, msync, spr_access (l.mac, l.maci, l.macrc, l.msb, l.mfspr, l.mtspr), exception (l.sys)
     
    130274                    case EVENT_TYPE_EXCEPTION          :
    131275                      {
     276                        log_printf(TRACE,Context_State,FUNCTION,"    * EVENT_TYPE_EXCEPTION");
     277
    132278                        state_next = CONTEXT_STATE_KO_EXCEP;
    133279
     
    136282                    case EVENT_TYPE_SPR_ACCESS         :
    137283                      {
    138                         state_next = CONTEXT_STATE_KO_SPR  ;
     284                        log_printf(TRACE,Context_State,FUNCTION,"    * EVENT_TYPE_SPR_ACCESS");
     285
     286//                      state_next = CONTEXT_STATE_KO_SPR  ;
     287                        state_next = CONTEXT_STATE_KO_SPR_EXEC;
    139288                        address++; // take next address
    140                         if (is_delay_slot)
    141                           throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n");
     289//                         if (is_delay_slot)
     290//                           throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n");
    142291                        break;
    143292                      }
    144293                    case EVENT_TYPE_MSYNC              :
    145294                      {
    146                         state_next = CONTEXT_STATE_KO_MSYNC;
     295                        log_printf(TRACE,Context_State,FUNCTION,"    * EVENT_TYPE_MSYNC");
     296
     297//                      state_next = CONTEXT_STATE_KO_MSYNC;
     298                        state_next = CONTEXT_STATE_KO_MSYNC_EXEC;
    147299                        address++;  // take next address
    148                         if (is_delay_slot)
    149                           throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n");
     300//                         if (is_delay_slot)
     301//                           throw ERRORMORPHEO(FUNCTION,"MSYNC in delay slot, not supported.\n");
    150302                        break;
    151303                      }
    152304                    case EVENT_TYPE_PSYNC              :
    153305                      {
    154                         state_next = CONTEXT_STATE_KO_PSYNC;
     306                        log_printf(TRACE,Context_State,FUNCTION,"    * EVENT_TYPE_PSYNC");
     307
     308//                      state_next = CONTEXT_STATE_KO_PSYNC;
     309                        state_next = CONTEXT_STATE_KO_PSYNC_FLUSH;
    155310                        address++;  // take next address
    156311                        if (is_delay_slot)
    157                           throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n");
     312                          throw ERRORMORPHEO(FUNCTION,"PSYNC in delay slot, not supported.\n");
    158313                        break;
    159314                      }
    160315                    case EVENT_TYPE_CSYNC              :
    161316                      {
    162                         state_next = CONTEXT_STATE_KO_CSYNC;
     317                        log_printf(TRACE,Context_State,FUNCTION,"    * EVENT_TYPE_CSYNC");
     318
     319//                      state_next = CONTEXT_STATE_KO_CSYNC;
     320                        state_next = CONTEXT_STATE_KO_CSYNC_FLUSH;
    163321                        address++;  // take next address
    164322                        if (is_delay_slot)
    165                           throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n");
     323                          throw ERRORMORPHEO(FUNCTION,"CSYNC in delay slot, not supported.\n");
    166324                        break;
    167325                      }               
     
    210368           
    211369            // miss > excep > spr/sync
    212             uint8_t    priority0  = (state == CONTEXT_STATE_KO_MISS)?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
     370            uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_ADDR) or (state == CONTEXT_STATE_KO_MISS_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
    213371            uint8_t    priority1  = 1; // exception
    214372
     
    277435                 
    278436//                   // miss > excep > spr/sync
    279 //                   uint8_t    priority0  = (state == CONTEXT_STATE_KO_MISS)?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
     437//                   uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_ADDR) or (state == CONTEXT_STATE_KO_MISS_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
    280438//                   uint8_t    priority1  = 2; // miss
    281439                 
     
    323481                  }
    324482                case CONTEXT_STATE_KO_MISS_ADDR  :
     483//                   {
     484//                     reg_STATE [i] = CONTEXT_STATE_KO_MISS_WAITEND; //@@@ TODO : make MISS fast (miss decod)
     485//                     break;
     486//                   }
    325487                case CONTEXT_STATE_KO_PSYNC_ADDR :
    326488                case CONTEXT_STATE_KO_CSYNC_ADDR :
     
    357519              reg_STATE [i] = CONTEXT_STATE_OK;
    358520            }
    359 
    360         // -------------------------------------------------------------------
    361         // -----[ next state ]------------------------------------------------
    362         // -------------------------------------------------------------------
    363         for (uint32_t i=0; i<_param->_nb_context; i++)
    364           {
    365 //             uint32_t x = _param->_link_context_to_decod_unit    [i];
    366 
    367             Tcounter_t inst_all = PORT_READ(in_NB_INST_COMMIT_ALL[i]) + PORT_READ(in_NB_INST_DECOD_ALL [i]);
    368             Tcounter_t inst_mem = PORT_READ(in_NB_INST_COMMIT_MEM[i]) + PORT_READ(in_NB_INST_DECOD_ALL [i]);
    369 
    370             context_state_t state = reg_STATE [i];
    371 
    372             switch (state)
    373               {
    374               case CONTEXT_STATE_OK              :
    375                 {
    376                   // nothing, wait an event
    377                   break;
    378                 }
    379               case CONTEXT_STATE_KO_EXCEP        :
    380                 {
    381                   // Wait end of all instruction
    382                   if (inst_all == 0)
    383                     state = CONTEXT_STATE_KO_EXCEP_ADDR;
    384                   break;
    385                 }
    386               case CONTEXT_STATE_KO_MISS         :
    387                 {
    388                   // Wait end of all instruction
    389                   if (inst_all == 0)
    390                     state = CONTEXT_STATE_KO_MISS_ADDR;
    391                   break;
    392                 }
    393               case CONTEXT_STATE_KO_EXCEP_ADDR   :
    394                 {
    395                   // nothing, wait the update of internal register (pc)
    396                   break;
    397                 }
    398               case CONTEXT_STATE_KO_EXCEP_SPR    :
    399                 {
    400                   // nothing, wait the update of internal register (epcr, eear, sr, esr)
    401                   break;
    402                 }
    403               case CONTEXT_STATE_KO_MISS_ADDR    :
    404                 {
    405                   // nothing, wait the update of internal register (pc)
    406                   break;
    407                 }
    408               case CONTEXT_STATE_KO_PSYNC        :
    409                 {
    410                   // Wait end of all instruction
    411                   if (inst_all == 0)
    412 //                  state = CONTEXT_STATE_KO_PSYNC_FLUSH;
    413                     state = CONTEXT_STATE_KO_PSYNC_ADDR ;
    414                   break;
    415                 }
    416 //            case CONTEXT_STATE_KO_PSYNC_FLUSH  :
    417 //              {
    418 //                // nothing, wait end of flush (ifetch)
    419 //                break;
    420 //              }
    421               case CONTEXT_STATE_KO_PSYNC_ADDR   :
    422                 {
    423                   // nothing, wait the pc write
    424                   break;
    425                 }
    426               case CONTEXT_STATE_KO_CSYNC        :
    427                 {
    428                   // Wait end of all instruction
    429                   if (inst_all == 0)
    430                     state = CONTEXT_STATE_KO_CSYNC_ADDR ;
    431 //                  state = CONTEXT_STATE_KO_CSYNC_FLUSH;
    432                   break;
    433                 }
    434 //            case CONTEXT_STATE_KO_CSYNC_FLUSH  :
    435 //              {
    436 //                // nothing, wait end of flush (all internal structure)
    437 //                break;
    438 //              }
    439               case CONTEXT_STATE_KO_CSYNC_ADDR   :
    440                 {
    441                   // nothing, wait the pc write
    442                   break;
    443                 }
    444               case CONTEXT_STATE_KO_MSYNC        :
    445                 {
    446                   // Wait end of memory instruction
    447                   if (inst_mem == 0)
    448                     state = CONTEXT_STATE_KO_MSYNC_ISSUE;
    449                   break;
    450                 }
    451               case CONTEXT_STATE_KO_MSYNC_ISSUE  :
    452                 {
    453                   // Wait the msync issue
    454                   if (inst_mem != 0)
    455                     state = CONTEXT_STATE_KO_MSYNC_EXEC;
    456                   break;
    457                 }
    458               case CONTEXT_STATE_KO_MSYNC_EXEC   :
    459                 {
    460                   // Wait the end of msync
    461                   if (inst_mem == 0)
    462                     state = CONTEXT_STATE_OK;
    463                   break;
    464                 }
    465               case CONTEXT_STATE_KO_SPR          :
    466                 {
    467                   // Wait end of all instruction
    468                   if (inst_all == 0)
    469                     state = CONTEXT_STATE_KO_SPR_ISSUE;
    470                   break;
    471                 }
    472               case CONTEXT_STATE_KO_SPR_ISSUE    :
    473                 {
    474                   // Wait the spr_access issue
    475                   if (inst_all != 0)
    476                     state = CONTEXT_STATE_KO_SPR_EXEC;
    477                   break;
    478                 }
    479               case CONTEXT_STATE_KO_SPR_EXEC     :
    480                 {
    481                   // Wait the spr_access execution
    482                   if (inst_all == 0)
    483                     state = CONTEXT_STATE_OK;
    484                   break;
    485                 }
    486 
    487               default :
    488                 {
    489                   throw ERRORMORPHEO(FUNCTION,toString(_("Context[%d], Unknow state : %s.\n"),i,toString(state).c_str()));
    490                 }
    491               }
    492             reg_STATE [i] = state;
    493           }
    494521
    495522        for (uint32_t i=0; i<_param->_nb_context; ++i)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/src/Instruction.cpp

    r100 r101  
    2929  void instruction_decod               (decod_instruction_t * inst, decod_param_t * param)
    3030  {
     31    log_printf(TRACE,Decod,"instruction_decod","  * instruction   : decod");
     32
    3133//     instruction_decod_type_0 (inst,param);
    3234
    3335    uint32_t opcod = range<uint32_t>(inst->_instruction,31,26);
     36
     37    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     38
    3439    (* param->_function_decod[ 0][opcod]) (inst,param);
    3540  }
     
    4348  void instruction_decod_type_1        (decod_instruction_t * inst, decod_param_t * param)
    4449  {
     50    log_printf(TRACE,Decod,"instruction_decod_type_1","  * instruction   : decod type_1");
     51   
    4552    uint32_t opcod = range<uint32_t>(inst->_instruction, 7, 0);
     53
     54    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     55
    4656    (* param->_function_decod[ 1][opcod]) (inst,param);
    4757  }
     
    4959  void instruction_decod_type_2        (decod_instruction_t * inst, decod_param_t * param)
    5060  {
     61    log_printf(TRACE,Decod,"instruction_decod_type_2","  * instruction   : decod type_2");
     62
    5163    uint32_t opcod = range<uint32_t>(inst->_instruction, 7, 0);
     64
     65    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     66
    5267    (* param->_function_decod[ 2][opcod]) (inst,param);
    5368  }
     
    5570  void instruction_decod_type_3        (decod_instruction_t * inst, decod_param_t * param)
    5671  {
     72    log_printf(TRACE,Decod,"instruction_decod_type_3","  * instruction   : decod type_3");
     73
    5774    uint32_t opcod = ((range<uint32_t>(inst->_instruction, 9, 8)<<4) |
    5875                      (range<uint32_t>(inst->_instruction, 3, 0)));
     76
     77    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     78
    5979    (* param->_function_decod[ 3][opcod]) (inst,param);
    6080  }
     
    6282  void instruction_decod_type_4        (decod_instruction_t * inst, decod_param_t * param)
    6383  {
     84    log_printf(TRACE,Decod,"instruction_decod_type_4","  * instruction   : decod type_4");
     85
    6486    uint32_t opcod = range<uint32_t>(inst->_instruction,25,21);
     87
     88    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     89
    6590    (* param->_function_decod[ 4][opcod]) (inst,param);
    6691  }
     
    6893  void instruction_decod_type_5        (decod_instruction_t * inst, decod_param_t * param)
    6994  {
     95    log_printf(TRACE,Decod,"instruction_decod_type_5","  * instruction   : decod type_5");
     96
    7097    uint32_t opcod = range<uint32_t>(inst->_instruction,25,21);
     98
     99    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     100
    71101    (* param->_function_decod[ 5][opcod]) (inst,param);
    72102  }
     
    74104  void instruction_decod_type_6        (decod_instruction_t * inst, decod_param_t * param)
    75105  {
     106    log_printf(TRACE,Decod,"instruction_decod_type_6","  * instruction   : decod type_6");
     107
    76108    uint32_t opcod = range<uint32_t>(inst->_instruction, 7, 6);
     109
     110    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     111
    77112    (* param->_function_decod[ 6][opcod]) (inst,param);
    78113  }
     
    80115  void instruction_decod_type_7        (decod_instruction_t * inst, decod_param_t * param)
    81116  {
     117    log_printf(TRACE,Decod,"instruction_decod_type_7","  * instruction   : decod type_7");
     118
    82119    uint32_t opcod = range<uint32_t>(inst->_instruction, 3, 0);
     120
     121    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     122
    83123    (* param->_function_decod[ 7][opcod]) (inst,param);
    84124  }
     
    86126  void instruction_decod_type_8        (decod_instruction_t * inst, decod_param_t * param)
    87127  {
     128    log_printf(TRACE,Decod,"instruction_decod_type_8","  * instruction   : decod type_8");
     129
    88130    uint32_t opcod = range<uint32_t>(inst->_instruction,16,16);
     131
     132    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     133
    89134    (* param->_function_decod[ 8][opcod]) (inst,param);
    90135  }
     
    92137  void instruction_decod_type_9        (decod_instruction_t * inst, decod_param_t * param)
    93138  {
     139    log_printf(TRACE,Decod,"instruction_decod_type_9","  * instruction   : decod type_9");
     140
    94141    uint32_t opcod = range<uint32_t>(inst->_instruction,25,23);
     142
     143    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     144
    95145    (* param->_function_decod[ 9][opcod]) (inst,param);
    96146  }
     
    98148  void instruction_decod_type_10       (decod_instruction_t * inst, decod_param_t * param)
    99149  {
     150    log_printf(TRACE,Decod,"instruction_decod_type_10","  * instruction   : decod type_10");
     151
    100152    uint32_t opcod = range<uint32_t>(inst->_instruction,25,24);
     153
     154    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     155
    101156    (* param->_function_decod[10][opcod]) (inst,param);
    102157  }
     
    104159  void instruction_decod_type_11       (decod_instruction_t * inst, decod_param_t * param)
    105160  {
     161    log_printf(TRACE,Decod,"instruction_decod_type_11","  * instruction   : decod type_11");
     162
    106163    uint32_t opcod = range<uint32_t>(inst->_instruction, 7, 6);
     164
     165    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     166
    107167    (* param->_function_decod[11][opcod]) (inst,param);
    108168  }
     
    110170  void instruction_decod_type_12       (decod_instruction_t * inst, decod_param_t * param)
    111171  {
     172    log_printf(TRACE,Decod,"instruction_decod_type_12","  * instruction   : decod type_12");
     173
    112174    uint32_t opcod = range<uint32_t>(inst->_instruction, 7, 6);
     175
     176    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     177
    113178    (* param->_function_decod[12][opcod]) (inst,param);
    114179  }
     
    116181  void instruction_decod_type_13       (decod_instruction_t * inst, decod_param_t * param)
    117182  {
     183    log_printf(TRACE,Decod,"instruction_decod_type_13","  * instruction   : decod type_13");
     184
    118185    uint32_t opcod = range<uint32_t>(inst->_instruction, 7, 6);
     186
     187    log_printf(TRACE,Decod,"instruction_decod","    * opcod : %d (0x%x)",opcod,opcod);
     188
    119189    (* param->_function_decod[13][opcod]) (inst,param);
    120190  }
     
    122192  void instruction_illegal             (decod_instruction_t * inst, decod_param_t * param)
    123193  {
    124     log_printf(TRACE,Decod,"instruction_illegal","instruction_illegal");
     194    log_printf(TRACE,Decod,"instruction_illegal","  * instruction   : illegal");
     195
     196    msgWarning(_("Instruction \"%.8x\" at address \"%.8x\" is illegal.\n"),inst->_instruction,inst->_address);
    125197       
    126198    inst->_exception_use = EXCEPTION_USE_ILLEGAL_INSTRUCTION;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/include/Decod_request.h

    r95 r101  
    156156    0xe1e4f801,x,y,z,
    157157    BRANCH_STATE_NONE,0,BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK,0,0x0,
    158     0,TYPE_ALU,OPERATION_ALU_L_ADD,false,
     158    0,TYPE_ALU,OPERATION_ALU_L_ADDC,false,
    159159    0,0x00000000,1, 4,1,31,1,SPR_LOGIC_SR_CY_OV,1,15,1,SPR_LOGIC_SR_CY_OV,
    160160    EXCEPTION_USE_RANGE,EVENT_TYPE_NONE));
     
    192192    0xa0ecffff,x,y,z,
    193193    BRANCH_STATE_NONE,0,BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK,0, 0x0,
    194     0,TYPE_ALU,OPERATION_ALU_L_ADD,false,
     194    0,TYPE_ALU,OPERATION_ALU_L_ADDC,false,
    195195    1,0xffffffff,1,12,0, 0,1,SPR_LOGIC_SR_CY_OV,1,7 ,1,SPR_LOGIC_SR_CY_OV,
    196196    EXCEPTION_USE_RANGE,EVENT_TYPE_NONE));
     
    201201    0xa1110000,x,y,z,
    202202    BRANCH_STATE_NONE,0,BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK,0, 0x0,
    203     0,TYPE_ALU,OPERATION_ALU_L_ADD,false,
     203    0,TYPE_ALU,OPERATION_ALU_L_ADDC,false,
    204204    1,0x00000000,1,17,0, 0,1,SPR_LOGIC_SR_CY_OV,1,8 ,1,SPR_LOGIC_SR_CY_OV,
    205205    EXCEPTION_USE_RANGE,EVENT_TYPE_NONE));
     
    210210    0xa2a707bd,x,y,z,
    211211    BRANCH_STATE_NONE,0,BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK,0, 0x0,
    212     0,TYPE_ALU,OPERATION_ALU_L_ADD,false,
     212    0,TYPE_ALU,OPERATION_ALU_L_ADDC,false,
    213213    1,0x000007bd,1, 7,0, 0,1,SPR_LOGIC_SR_CY_OV,1,21,1,SPR_LOGIC_SR_CY_OV,
    214214    EXCEPTION_USE_RANGE,EVENT_TYPE_NONE));
     
    358358    0x23000000,x,y,z,
    359359    BRANCH_STATE_NONE,0,BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK,0, 0x0,
    360     0,TYPE_SPECIAL,OPERATION_SPECIAL_L_CSYNC,false,
     360    0,TYPE_MEMORY,OPERATION_MEMORY_SYNCHRONIZATION,false,
    361361    0,0  ,0,0 ,0,0 ,0,0                 ,0,0 ,0,0                 ,
    362362    EXCEPTION_USE_NONE,EVENT_TYPE_CSYNC));
     
    498498    BRANCH_STATE_NONE,0,BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK,1, z, // branch_address_dest can be determined if BRANCH_STATE != NONE (also : previous prediction)
    499499    0,TYPE_BRANCH,OPERATION_BRANCH_L_JALR,false,
    500     0,0   ,0,0 ,1,20,0,0,1,9 ,0,0,
     500    1,z+1,0,0 ,1,20,0,0,1,9 ,0,0,
    501501    EXCEPTION_USE_NONE,EVENT_TYPE_NONE));
    502502    SEQ;
     
    605605    0x22000000,x,y,z,
    606606    0,0,0,0,0,0,
    607     TYPE_SPECIAL,OPERATION_SPECIAL_L_MSYNC,false,
     607    TYPE_MEMORY,OPERATION_MEMORY_SYNCHRONIZATION,false,
    608608    0,0, 0,0, 0,0, 0,0, 0,0, 0,0,
    609609    EXCEPTION_USE_NONE,EVENT_TYPE_MSYNC));
     
    713713    0x22800000,x,y,z,
    714714    0,0,0,0,0,0,
    715     TYPE_SPECIAL,OPERATION_SPECIAL_L_PSYNC,false,
     715    TYPE_MEMORY,OPERATION_MEMORY_SYNCHRONIZATION,false,
    716716    0,0, 0,0, 0,0, 0,0, 0,0, 0,0,
    717717    EXCEPTION_USE_NONE,EVENT_TYPE_PSYNC));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/test.cpp

    r88 r101  
    9999//   ALLOC1_SC_SIGNAL( in_PREDICT_CAN_CONTINUE               ," in_PREDICT_CAN_CONTINUE               ",Tcontrol_t         ,_param->_nb_inst_decod);
    100100  ALLOC1_SC_SIGNAL( in_CONTEXT_DECOD_ENABLE               ," in_CONTEXT_DECOD_ENABLE               ",Tcontrol_t         ,_param->_nb_context);
     101  ALLOC1_SC_SIGNAL( in_CONTEXT_DEPTH_VAL                  ," in_CONTEXT_DEPTH_VAL                  ",Tcontrol_t         ,_param->_nb_context);
    101102  ALLOC1_SC_SIGNAL( in_CONTEXT_DEPTH                      ," in_CONTEXT_DEPTH                      ",Tdepth_t           ,_param->_nb_context);
    102103  ALLOC_SC_SIGNAL (out_CONTEXT_EVENT_VAL                  ,"out_CONTEXT_EVENT_VAL                  ",Tcontrol_t         );
     
    178179//   INSTANCE1_SC_SIGNAL(_Decod, in_PREDICT_CAN_CONTINUE               ,_param->_nb_inst_decod);
    179180  INSTANCE1_SC_SIGNAL(_Decod, in_CONTEXT_DECOD_ENABLE               ,_param->_nb_context);
     181  INSTANCE1_SC_SIGNAL(_Decod, in_CONTEXT_DEPTH_VAL                  ,_param->_nb_context);
    180182  for (uint32_t i=0; i<_param->_nb_context; i++)
    181183    if (_param->_have_port_depth)
     
    221223
    222224  LABEL("Loop of Test");
     225
     226  for (uint32_t i=0; i<_param->_nb_context; i++)
     227    in_CONTEXT_DEPTH_VAL [i]->write(1);
    223228
    224229  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
     
    475480 
    476481  delete []  in_CONTEXT_DECOD_ENABLE               ;
     482  delete []  in_CONTEXT_DEPTH_VAL                  ;
    477483  delete []  in_CONTEXT_DEPTH                      ;
    478484 
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h

    r88 r101  
    120120    // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    121121  public    : SC_IN (Tcontrol_t         )  **  in_CONTEXT_DECOD_ENABLE               ;//[nb_context]
     122  public    : SC_IN (Tcontrol_t         )  **  in_CONTEXT_DEPTH_VAL                  ;//[nb_context]
    122123  public    : SC_IN (Tdepth_t           )  **  in_CONTEXT_DEPTH                      ;//[nb_context]
    123124                                                                                     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod.cpp

    r88 r101  
    103103            if (_param->_have_port_depth)
    104104            sensitive << (*(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [i]));
     105            sensitive << (*(in_CONTEXT_DEPTH_VAL                  [i]));
    105106            if (_param->_have_port_depth)
    106107            sensitive << (*(in_CONTEXT_DEPTH                      [i]));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_allocation.cpp

    r95 r101  
    2323  void Decod::allocation (
    2424#ifdef STATISTICS
    25                                morpheo::behavioural::Parameters_Statistics * param_statistics
     25                               morpheo::behavioural::Parameters_Statistics * param_statistics
    2626#else
    27                                void
     27                               void
    2828#endif
    29                                )
     29                               )
    3030  {
    3131    log_printf(FUNC,Decod,FUNCTION,"Begin");
     
    3434
    3535    Entity * entity = _component->set_entity (_name       
    36                                               ,"Decod"
     36                                              ,"Decod"
    3737#ifdef POSITION
    38                                               ,COMBINATORY
     38                                              ,COMBINATORY
    3939#endif
    40                                               );
     40                                              );
    4141
    4242    _interfaces = entity->set_interfaces();
     
    4646      Interface * interface = _interfaces->set_interface(""
    4747#ifdef POSITION
    48                                                         ,IN
    49                                                         ,SOUTH,
    50                                                         "Generalist interface"
     48                                                        ,IN
     49                                                        ,SOUTH,
     50                                                        "Generalist interface"
    5151#endif
    52                                                         );
     52                                                        );
    5353     
    5454      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
     
    7777    }
    7878
    79     // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
     79    // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
    8080    {
    8181      ALLOC1_INTERFACE("decod", OUT, EAST, "Instructiont decoded", _param->_nb_inst_decod);
     
    129129
    130130      ALLOC1_SIGNAL_IN (in_CONTEXT_DECOD_ENABLE,"decod_enable",Tcontrol_t,1);
     131      ALLOC1_SIGNAL_IN (in_CONTEXT_DEPTH_VAL   ,"depth_val"   ,Tcontrol_t,1);
    131132      ALLOC1_SIGNAL_IN (in_CONTEXT_DEPTH       ,"depth"       ,Tdepth_t  ,_param->_size_depth);
    132133    }
    133134
    134     // ~~~~~[ Interface : "context_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
     135    // ~~~~~[ Interface : "context_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
    135136    {
    136137      ALLOC_INTERFACE("context_event", OUT, NORTH, "context's evenement");
     
    164165    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    165166    _priority = new generic::priority::Priority (_name+"_priority"      ,
    166                                                 _param->_priority      ,
    167                                                 _param->_load_balancing,
    168                                                 _param->_nb_context    ,
    169                                                 _param->_nb_inst_fetch ,
    170                                                 _param->_nb_context_select);
     167                                                _param->_priority      ,
     168                                                _param->_load_balancing,
     169                                                _param->_nb_context    ,
     170                                                _param->_nb_inst_fetch ,
     171                                                _param->_nb_context_select);
    171172
    172173    const uint32_t nb_opcod_type = 14;
    173174    const uint32_t tab_opcod_type [] = {MAX_OPCOD_0,
    174                                         MAX_OPCOD_1 ,
    175                                         MAX_OPCOD_2 ,
    176                                         MAX_OPCOD_3 ,
    177                                         MAX_OPCOD_4 ,
    178                                         MAX_OPCOD_5 ,
    179                                         MAX_OPCOD_6 ,
    180                                         MAX_OPCOD_7 ,
    181                                         MAX_OPCOD_8 ,
    182                                         MAX_OPCOD_9 ,
    183                                         MAX_OPCOD_10,
    184                                         MAX_OPCOD_11,
    185                                         MAX_OPCOD_12,
    186                                         MAX_OPCOD_13};
     175                                        MAX_OPCOD_1 ,
     176                                        MAX_OPCOD_2 ,
     177                                        MAX_OPCOD_3 ,
     178                                        MAX_OPCOD_4 ,
     179                                        MAX_OPCOD_5 ,
     180                                        MAX_OPCOD_6 ,
     181                                        MAX_OPCOD_7 ,
     182                                        MAX_OPCOD_8 ,
     183                                        MAX_OPCOD_9 ,
     184                                        MAX_OPCOD_10,
     185                                        MAX_OPCOD_11,
     186                                        MAX_OPCOD_12,
     187                                        MAX_OPCOD_13};
    187188   
    188189    _function_decod  = new function_decod_t *** [_param->_nb_context];
     
    190191    for (uint32_t i=0; i<_param->_nb_context; i++)
    191192      {
    192         _function_decod  [i] = new function_decod_t ** [nb_opcod_type];
    193         _function_custom [i] = new function_decod_t ** [nb_opcod_type];
    194         for (uint32_t j=0; j<nb_opcod_type; j++)
    195           {
    196             _function_decod  [i][j] = new function_decod_t * [tab_opcod_type[j]];
    197             _function_custom [i][j] = new function_decod_t * [tab_opcod_type[j]];
    198             for (uint32_t k=0; k<tab_opcod_type[j]; k++)
    199               {
    200                 _function_decod  [i][j][k] = &(instruction_illegal);
    201                 _function_custom [i][j][k] = &(instruction_illegal);
    202               }
    203           }
    204 
    205         // Create indirection
    206         _function_decod[i][0][OPCOD_1 ] = &(instruction_decod_type_1 ); // Instruction ORFPX32/64               
    207         _function_decod[i][0][OPCOD_2 ] = &(instruction_decod_type_2 ); // Instruction ORVDX64                   
    208         _function_decod[i][0][OPCOD_3 ] = &(instruction_decod_type_3 ); // Instructions Register-Register        
    209         _function_decod[i][0][OPCOD_4 ] = &(instruction_decod_type_4 ); // Instructions "set flag" with register
    210         _function_decod[i][0][OPCOD_5 ] = &(instruction_decod_type_5 ); // Instructions "set flag" with immediat
    211         _function_decod[i][0][OPCOD_6 ] = &(instruction_decod_type_6 ); // Instruction Shift/Rotate with immediat
    212         _function_decod[i][0][OPCOD_7 ] = &(instruction_decod_type_7 ); // Instructions multiply with HI-LO      
    213         _function_decod[i][0][OPCOD_8 ] = &(instruction_decod_type_8 ); // Instructions acces at HI-LO     
    214         _function_decod[i][0][OPCOD_9 ] = &(instruction_decod_type_9 ); // Instructions special            
    215         _function_decod[i][0][OPCOD_10] = &(instruction_decod_type_10); // Instructions no operation             
    216         _function_decod[i][3][OPCOD_11] = &(instruction_decod_type_11); // Instruction Shift/Rotate with register
    217         _function_decod[i][3][OPCOD_12] = &(instruction_decod_type_12); // Instructions extend                   
    218         _function_decod[i][3][OPCOD_13] = &(instruction_decod_type_13); // Instructions extend (64b)             
    219 
    220         if (_param->_instruction_implemeted[i][INSTRUCTION_L_ADD      ]) _function_decod[i][ 3][OPCOD_L_ADD      ] = &(instruction_l_add       );
    221         if (_param->_instruction_implemeted[i][INSTRUCTION_L_ADDC     ]) _function_decod[i][ 3][OPCOD_L_ADDC     ] = &(instruction_l_addc           );
    222         if (_param->_instruction_implemeted[i][INSTRUCTION_L_ADDI     ]) _function_decod[i][ 0][OPCOD_L_ADDI     ] = &(instruction_l_addi           );
    223         if (_param->_instruction_implemeted[i][INSTRUCTION_L_ADDIC    ]) _function_decod[i][ 0][OPCOD_L_ADDIC    ] = &(instruction_l_addic          );
    224         if (_param->_instruction_implemeted[i][INSTRUCTION_L_AND      ]) _function_decod[i][ 3][OPCOD_L_AND      ] = &(instruction_l_and            );
    225         if (_param->_instruction_implemeted[i][INSTRUCTION_L_ANDI     ]) _function_decod[i][ 0][OPCOD_L_ANDI     ] = &(instruction_l_andi           );
    226         if (_param->_instruction_implemeted[i][INSTRUCTION_L_BF       ]) _function_decod[i][ 0][OPCOD_L_BF       ] = &(instruction_l_bf     );
    227         if (_param->_instruction_implemeted[i][INSTRUCTION_L_BNF      ]) _function_decod[i][ 0][OPCOD_L_BNF      ] = &(instruction_l_bnf            );
    228         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CMOV     ]) _function_decod[i][ 3][OPCOD_L_CMOV     ] = &(instruction_l_cmov           );
    229         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CSYNC    ]) _function_decod[i][ 9][OPCOD_L_CSYNC    ] = &(instruction_l_csync          );
    230         if (_param->_instruction_implemeted[i][INSTRUCTION_L_DIV      ]) _function_decod[i][ 3][OPCOD_L_DIV      ] = &(instruction_l_div            );
    231         if (_param->_instruction_implemeted[i][INSTRUCTION_L_DIVU     ]) _function_decod[i][ 3][OPCOD_L_DIVU     ] = &(instruction_l_divu           );
    232         if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTBS    ]) _function_decod[i][12][OPCOD_L_EXTBS    ] = &(instruction_l_extbs          );
    233         if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTBZ    ]) _function_decod[i][12][OPCOD_L_EXTBZ    ] = &(instruction_l_extbz          );
    234         if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTHS    ]) _function_decod[i][12][OPCOD_L_EXTHS    ] = &(instruction_l_exths          );
    235         if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTHZ    ]) _function_decod[i][12][OPCOD_L_EXTHZ    ] = &(instruction_l_exthz          );
    236         if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTWS    ]) _function_decod[i][13][OPCOD_L_EXTWS    ] = &(instruction_l_extws          );
    237         if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTWZ    ]) _function_decod[i][13][OPCOD_L_EXTWZ    ] = &(instruction_l_extwz          );
    238         if (_param->_instruction_implemeted[i][INSTRUCTION_L_FF1      ]) _function_decod[i][ 3][OPCOD_L_FF1      ] = &(instruction_l_ff1            );
    239         if (_param->_instruction_implemeted[i][INSTRUCTION_L_FL1      ]) _function_decod[i][ 3][OPCOD_L_FL1      ] = &(instruction_l_fl1            );
    240         if (_param->_instruction_implemeted[i][INSTRUCTION_L_J        ]) _function_decod[i][ 0][OPCOD_L_J        ] = &(instruction_l_j      );
    241         if (_param->_instruction_implemeted[i][INSTRUCTION_L_JAL      ]) _function_decod[i][ 0][OPCOD_L_JAL      ] = &(instruction_l_jal            );
    242         if (_param->_instruction_implemeted[i][INSTRUCTION_L_JALR     ]) _function_decod[i][ 0][OPCOD_L_JALR     ] = &(instruction_l_jalr           );
    243         if (_param->_instruction_implemeted[i][INSTRUCTION_L_JR       ]) _function_decod[i][ 0][OPCOD_L_JR       ] = &(instruction_l_jr     );
    244         if (_param->_instruction_implemeted[i][INSTRUCTION_L_LBS      ]) _function_decod[i][ 0][OPCOD_L_LBS      ] = &(instruction_l_lbs            );
    245         if (_param->_instruction_implemeted[i][INSTRUCTION_L_LBZ      ]) _function_decod[i][ 0][OPCOD_L_LBZ      ] = &(instruction_l_lbz            );
    246         if (_param->_instruction_implemeted[i][INSTRUCTION_L_LD       ]) _function_decod[i][ 0][OPCOD_L_LD       ] = &(instruction_l_ld     );
    247         if (_param->_instruction_implemeted[i][INSTRUCTION_L_LHS      ]) _function_decod[i][ 0][OPCOD_L_LHS      ] = &(instruction_l_lhs            );
    248         if (_param->_instruction_implemeted[i][INSTRUCTION_L_LHZ      ]) _function_decod[i][ 0][OPCOD_L_LHZ      ] = &(instruction_l_lhz            );
    249         if (_param->_instruction_implemeted[i][INSTRUCTION_L_LWS      ]) _function_decod[i][ 0][OPCOD_L_LWS      ] = &(instruction_l_lws            );
    250         if (_param->_instruction_implemeted[i][INSTRUCTION_L_LWZ      ]) _function_decod[i][ 0][OPCOD_L_LWZ      ] = &(instruction_l_lwz            );
    251         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MAC      ]) _function_decod[i][ 7][OPCOD_L_MAC      ] = &(instruction_l_mac            );
    252         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MACI     ]) _function_decod[i][ 0][OPCOD_L_MACI     ] = &(instruction_l_maci           );
    253         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MACRC    ]) _function_decod[i][ 8][OPCOD_L_MACRC    ] = &(instruction_l_macrc          );
    254         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MFSPR    ]) _function_decod[i][ 0][OPCOD_L_MFSPR    ] = &(instruction_l_mfspr          );
    255         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MOVHI    ]) _function_decod[i][ 8][OPCOD_L_MOVHI    ] = &(instruction_l_movhi          );
    256         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MSB      ]) _function_decod[i][ 7][OPCOD_L_MSB      ] = &(instruction_l_msb            );
    257         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MSYNC    ]) _function_decod[i][ 9][OPCOD_L_MSYNC    ] = &(instruction_l_msync          );
    258         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MTSPR    ]) _function_decod[i][ 0][OPCOD_L_MTSPR    ] = &(instruction_l_mtspr          );
    259         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MUL      ]) _function_decod[i][ 3][OPCOD_L_MUL      ] = &(instruction_l_mul            );
    260         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MULI     ]) _function_decod[i][ 0][OPCOD_L_MULI     ] = &(instruction_l_muli           );
    261         if (_param->_instruction_implemeted[i][INSTRUCTION_L_MULU     ]) _function_decod[i][ 3][OPCOD_L_MULU     ] = &(instruction_l_mulu           );
    262         if (_param->_instruction_implemeted[i][INSTRUCTION_L_NOP      ]) _function_decod[i][10][OPCOD_L_NOP      ] = &(instruction_l_nop            );
    263         if (_param->_instruction_implemeted[i][INSTRUCTION_L_OR       ]) _function_decod[i][ 3][OPCOD_L_OR       ] = &(instruction_l_or     );
    264         if (_param->_instruction_implemeted[i][INSTRUCTION_L_ORI      ]) _function_decod[i][ 0][OPCOD_L_ORI      ] = &(instruction_l_ori            );
    265         if (_param->_instruction_implemeted[i][INSTRUCTION_L_PSYNC    ]) _function_decod[i][ 9][OPCOD_L_PSYNC    ] = &(instruction_l_psync          );
    266         if (_param->_instruction_implemeted[i][INSTRUCTION_L_RFE      ]) _function_decod[i][ 0][OPCOD_L_RFE      ] = &(instruction_l_rfe            );
    267         if (_param->_instruction_implemeted[i][INSTRUCTION_L_ROR      ]) _function_decod[i][11][OPCOD_L_ROR      ] = &(instruction_l_ror            );
    268         if (_param->_instruction_implemeted[i][INSTRUCTION_L_RORI     ]) _function_decod[i][ 6][OPCOD_L_RORI     ] = &(instruction_l_rori           );
    269         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SB       ]) _function_decod[i][ 0][OPCOD_L_SB       ] = &(instruction_l_sb     );
    270         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SD       ]) _function_decod[i][ 0][OPCOD_L_SD       ] = &(instruction_l_sd     );
    271         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFEQ     ]) _function_decod[i][ 4][OPCOD_L_SFEQ     ] = &(instruction_l_sfeq           );
    272         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFEQI    ]) _function_decod[i][ 5][OPCOD_L_SFEQI    ] = &(instruction_l_sfeqi          );
    273         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGES    ]) _function_decod[i][ 4][OPCOD_L_SFGES    ] = &(instruction_l_sfges          );
    274         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGESI   ]) _function_decod[i][ 5][OPCOD_L_SFGESI   ] = &(instruction_l_sfgesi    );
    275         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGEU    ]) _function_decod[i][ 4][OPCOD_L_SFGEU    ] = &(instruction_l_sfgeu          );
    276         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGEUI   ]) _function_decod[i][ 5][OPCOD_L_SFGEUI   ] = &(instruction_l_sfgeui    );
    277         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGTS    ]) _function_decod[i][ 4][OPCOD_L_SFGTS    ] = &(instruction_l_sfgts          );
    278         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGTSI   ]) _function_decod[i][ 5][OPCOD_L_SFGTSI   ] = &(instruction_l_sfgtsi    );
    279         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGTU    ]) _function_decod[i][ 4][OPCOD_L_SFGTU    ] = &(instruction_l_sfgtu          );
    280         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGTUI   ]) _function_decod[i][ 5][OPCOD_L_SFGTUI   ] = &(instruction_l_sfgtui    );
    281         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLES    ]) _function_decod[i][ 4][OPCOD_L_SFLES    ] = &(instruction_l_sfles          );
    282         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLESI   ]) _function_decod[i][ 5][OPCOD_L_SFLESI   ] = &(instruction_l_sflesi    );
    283         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLEU    ]) _function_decod[i][ 4][OPCOD_L_SFLEU    ] = &(instruction_l_sfleu          );
    284         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLEUI   ]) _function_decod[i][ 5][OPCOD_L_SFLEUI   ] = &(instruction_l_sfleui    );
    285         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLTS    ]) _function_decod[i][ 4][OPCOD_L_SFLTS    ] = &(instruction_l_sflts          );
    286         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLTSI   ]) _function_decod[i][ 5][OPCOD_L_SFLTSI   ] = &(instruction_l_sfltsi    );
    287         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLTU    ]) _function_decod[i][ 4][OPCOD_L_SFLTU    ] = &(instruction_l_sfltu          );
    288         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLTUI   ]) _function_decod[i][ 5][OPCOD_L_SFLTUI   ] = &(instruction_l_sfltui    );
    289         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFNE     ]) _function_decod[i][ 4][OPCOD_L_SFNE     ] = &(instruction_l_sfne           );
    290         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFNEI    ]) _function_decod[i][ 5][OPCOD_L_SFNEI    ] = &(instruction_l_sfnei          );
    291         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SH       ]) _function_decod[i][ 0][OPCOD_L_SH       ] = &(instruction_l_sh     );
    292         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SLL      ]) _function_decod[i][11][OPCOD_L_SLL      ] = &(instruction_l_sll            );
    293         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SLLI     ]) _function_decod[i][ 6][OPCOD_L_SLLI     ] = &(instruction_l_slli           );
    294         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SRA      ]) _function_decod[i][11][OPCOD_L_SRA      ] = &(instruction_l_sra            );
    295         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SRAI     ]) _function_decod[i][ 6][OPCOD_L_SRAI     ] = &(instruction_l_srai           );
    296         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SRL      ]) _function_decod[i][11][OPCOD_L_SRL      ] = &(instruction_l_srl            );
    297         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SRLI     ]) _function_decod[i][ 6][OPCOD_L_SRLI     ] = &(instruction_l_srli           );
    298         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SUB      ]) _function_decod[i][ 3][OPCOD_L_SUB      ] = &(instruction_l_sub            );
    299         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SW       ]) _function_decod[i][ 0][OPCOD_L_SW       ] = &(instruction_l_sw     );
    300         if (_param->_instruction_implemeted[i][INSTRUCTION_L_SYS      ]) _function_decod[i][ 9][OPCOD_L_SYS      ] = &(instruction_l_sys            );
    301         if (_param->_instruction_implemeted[i][INSTRUCTION_L_TRAP     ]) _function_decod[i][ 9][OPCOD_L_TRAP     ] = &(instruction_l_trap           );
    302         if (_param->_instruction_implemeted[i][INSTRUCTION_L_XOR      ]) _function_decod[i][ 3][OPCOD_L_XOR      ] = &(instruction_l_xor            );
    303         if (_param->_instruction_implemeted[i][INSTRUCTION_L_XORI     ]) _function_decod[i][ 0][OPCOD_L_XORI     ] = &(instruction_l_xori           );
    304 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_ADD_D   ]) _function_decod[i][ 1][OPCOD_LF_ADD_D   ] = &(instruction_lf_add_d    );
    305 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_ADD_S   ]) _function_decod[i][ 1][OPCOD_LF_ADD_S   ] = &(instruction_lf_add_s    );
    306 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_DIV_D   ]) _function_decod[i][ 1][OPCOD_LF_DIV_D   ] = &(instruction_lf_div_d    );
    307 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_DIV_S   ]) _function_decod[i][ 1][OPCOD_LF_DIV_S   ] = &(instruction_lf_div_s    );
    308 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_FTOI_D  ]) _function_decod[i][ 1][OPCOD_LF_FTOI_D  ] = &(instruction_lf_ftoi_d   );
    309 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_FTOI_S  ]) _function_decod[i][ 1][OPCOD_LF_FTOI_S  ] = &(instruction_lf_ftoi_s   );
    310 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_ITOF_D  ]) _function_decod[i][ 1][OPCOD_LF_ITOF_D  ] = &(instruction_lf_itof_d   );
    311 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_ITOF_S  ]) _function_decod[i][ 1][OPCOD_LF_ITOF_S  ] = &(instruction_lf_itof_s   );
    312 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_MADD_D  ]) _function_decod[i][ 1][OPCOD_LF_MADD_D  ] = &(instruction_lf_madd_d   );
    313 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_MADD_S  ]) _function_decod[i][ 1][OPCOD_LF_MADD_S  ] = &(instruction_lf_madd_s   );
    314 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_MUL_D   ]) _function_decod[i][ 1][OPCOD_LF_MUL_D   ] = &(instruction_lf_mul_d    );
    315 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_MUL_S   ]) _function_decod[i][ 1][OPCOD_LF_MUL_S   ] = &(instruction_lf_mul_s    );
    316 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_REM_D   ]) _function_decod[i][ 1][OPCOD_LF_REM_D   ] = &(instruction_lf_rem_d    );
    317 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_REM_S   ]) _function_decod[i][ 1][OPCOD_LF_REM_S   ] = &(instruction_lf_rem_s    );
    318 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFEQ_D  ]) _function_decod[i][ 1][OPCOD_LF_SFEQ_D  ] = &(instruction_lf_sfeq_d   );
    319 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFEQ_S  ]) _function_decod[i][ 1][OPCOD_LF_SFEQ_S  ] = &(instruction_lf_sfeq_s   );
    320 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFGE_D  ]) _function_decod[i][ 1][OPCOD_LF_SFGE_D  ] = &(instruction_lf_sfge_d   );
    321 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFGE_S  ]) _function_decod[i][ 1][OPCOD_LF_SFGE_S  ] = &(instruction_lf_sfge_s   );
    322 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFGT_D  ]) _function_decod[i][ 1][OPCOD_LF_SFGT_D  ] = &(instruction_lf_sfgt_d   );
    323 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFGT_S  ]) _function_decod[i][ 1][OPCOD_LF_SFGT_S  ] = &(instruction_lf_sfgt_s   );
    324 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFLE_D  ]) _function_decod[i][ 1][OPCOD_LF_SFLE_D  ] = &(instruction_lf_sfle_d   );
    325 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFLE_S  ]) _function_decod[i][ 1][OPCOD_LF_SFLE_S  ] = &(instruction_lf_sfle_s   );
    326 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFLT_D  ]) _function_decod[i][ 1][OPCOD_LF_SFLT_D  ] = &(instruction_lf_sflt_d   );
    327 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFLT_S  ]) _function_decod[i][ 1][OPCOD_LF_SFLT_S  ] = &(instruction_lf_sflt_s   );
    328 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFNE_D  ]) _function_decod[i][ 1][OPCOD_LF_SFNE_D  ] = &(instruction_lf_sfne_d   );
    329 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFNE_S  ]) _function_decod[i][ 1][OPCOD_LF_SFNE_S  ] = &(instruction_lf_sfne_s   );
    330 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SUB_D   ]) _function_decod[i][ 1][OPCOD_LF_SUB_D   ] = &(instruction_lf_sub_d    );
    331 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SUB_S   ]) _function_decod[i][ 1][OPCOD_LF_SUB_S   ] = &(instruction_lf_sub_s    );
    332 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADD_B   ]) _function_decod[i][ 2][OPCOD_LV_ADD_B   ] = &(instruction_lv_add_b    );
    333 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADD_H   ]) _function_decod[i][ 2][OPCOD_LV_ADD_H   ] = &(instruction_lv_add_h    );
    334 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDS_B  ]) _function_decod[i][ 2][OPCOD_LV_ADDS_B  ] = &(instruction_lv_adds_b   );
    335 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDS_H  ]) _function_decod[i][ 2][OPCOD_LV_ADDS_H  ] = &(instruction_lv_adds_h   );
    336 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDU_B  ]) _function_decod[i][ 2][OPCOD_LV_ADDU_B  ] = &(instruction_lv_addu_b   );
    337 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDU_H  ]) _function_decod[i][ 2][OPCOD_LV_ADDU_H  ] = &(instruction_lv_addu_h   );
    338 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDUS_B ]) _function_decod[i][ 2][OPCOD_LV_ADDUS_B ] = &(instruction_lv_addus_b  );
    339 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDUS_H ]) _function_decod[i][ 2][OPCOD_LV_ADDUS_H ] = &(instruction_lv_addus_h  );
    340 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_EQ_B]) _function_decod[i][ 2][OPCOD_LV_ALL_EQ_B] = &(instruction_lv_all_eq_b );
    341 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_EQ_H]) _function_decod[i][ 2][OPCOD_LV_ALL_EQ_H] = &(instruction_lv_all_eq_h );
    342 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_GE_B]) _function_decod[i][ 2][OPCOD_LV_ALL_GE_B] = &(instruction_lv_all_ge_b );
    343 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_GE_H]) _function_decod[i][ 2][OPCOD_LV_ALL_GE_H] = &(instruction_lv_all_ge_h );
    344 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_GT_B]) _function_decod[i][ 2][OPCOD_LV_ALL_GT_B] = &(instruction_lv_all_gt_b );
    345 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_GT_H]) _function_decod[i][ 2][OPCOD_LV_ALL_GT_H] = &(instruction_lv_all_gt_h );
    346 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_LE_B]) _function_decod[i][ 2][OPCOD_LV_ALL_LE_B] = &(instruction_lv_all_le_b );
    347 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_LE_H]) _function_decod[i][ 2][OPCOD_LV_ALL_LE_H] = &(instruction_lv_all_le_h );
    348 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_LT_B]) _function_decod[i][ 2][OPCOD_LV_ALL_LT_B] = &(instruction_lv_all_lt_b );
    349 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_LT_H]) _function_decod[i][ 2][OPCOD_LV_ALL_LT_H] = &(instruction_lv_all_lt_h );
    350 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_NE_B]) _function_decod[i][ 2][OPCOD_LV_ALL_NE_B] = &(instruction_lv_all_ne_b );
    351 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_NE_H]) _function_decod[i][ 2][OPCOD_LV_ALL_NE_H] = &(instruction_lv_all_ne_h );
    352 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_AND     ]) _function_decod[i][ 2][OPCOD_LV_AND     ] = &(instruction_lv_and           );
    353 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_EQ_B]) _function_decod[i][ 2][OPCOD_LV_ANY_EQ_B] = &(instruction_lv_any_eq_b );
    354 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_EQ_H]) _function_decod[i][ 2][OPCOD_LV_ANY_EQ_H] = &(instruction_lv_any_eq_h );
    355 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_GE_B]) _function_decod[i][ 2][OPCOD_LV_ANY_GE_B] = &(instruction_lv_any_ge_b );
    356 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_GE_H]) _function_decod[i][ 2][OPCOD_LV_ANY_GE_H] = &(instruction_lv_any_ge_h );
    357 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_GT_B]) _function_decod[i][ 2][OPCOD_LV_ANY_GT_B] = &(instruction_lv_any_gt_b );
    358 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_GT_H]) _function_decod[i][ 2][OPCOD_LV_ANY_GT_H] = &(instruction_lv_any_gt_h );
    359 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_LE_B]) _function_decod[i][ 2][OPCOD_LV_ANY_LE_B] = &(instruction_lv_any_le_b );
    360 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_LE_H]) _function_decod[i][ 2][OPCOD_LV_ANY_LE_H] = &(instruction_lv_any_le_h );
    361 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_LT_B]) _function_decod[i][ 2][OPCOD_LV_ANY_LT_B] = &(instruction_lv_any_lt_b );
    362 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_LT_H]) _function_decod[i][ 2][OPCOD_LV_ANY_LT_H] = &(instruction_lv_any_lt_h );
    363 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_NE_B]) _function_decod[i][ 2][OPCOD_LV_ANY_NE_B] = &(instruction_lv_any_ne_b );
    364 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_NE_H]) _function_decod[i][ 2][OPCOD_LV_ANY_NE_H] = &(instruction_lv_any_ne_h );
    365 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_AVG_B   ]) _function_decod[i][ 2][OPCOD_LV_AVG_B   ] = &(instruction_lv_avg_b    );
    366 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_AVG_H   ]) _function_decod[i][ 2][OPCOD_LV_AVG_H   ] = &(instruction_lv_avg_h    );
    367 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_EQ_B]) _function_decod[i][ 2][OPCOD_LV_CMP_EQ_B] = &(instruction_lv_cmp_eq_b );
    368 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_EQ_H]) _function_decod[i][ 2][OPCOD_LV_CMP_EQ_H] = &(instruction_lv_cmp_eq_h );
    369 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_GE_B]) _function_decod[i][ 2][OPCOD_LV_CMP_GE_B] = &(instruction_lv_cmp_ge_b );
    370 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_GE_H]) _function_decod[i][ 2][OPCOD_LV_CMP_GE_H] = &(instruction_lv_cmp_ge_h );
    371 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_GT_B]) _function_decod[i][ 2][OPCOD_LV_CMP_GT_B] = &(instruction_lv_cmp_gt_b );
    372 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_GT_H]) _function_decod[i][ 2][OPCOD_LV_CMP_GT_H] = &(instruction_lv_cmp_gt_h );
    373 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_LE_B]) _function_decod[i][ 2][OPCOD_LV_CMP_LE_B] = &(instruction_lv_cmp_le_b );
    374 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_LE_H]) _function_decod[i][ 2][OPCOD_LV_CMP_LE_H] = &(instruction_lv_cmp_le_h );
    375 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_LT_B]) _function_decod[i][ 2][OPCOD_LV_CMP_LT_B] = &(instruction_lv_cmp_lt_b );
    376 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_LT_H]) _function_decod[i][ 2][OPCOD_LV_CMP_LT_H] = &(instruction_lv_cmp_lt_h );
    377 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_NE_B]) _function_decod[i][ 2][OPCOD_LV_CMP_NE_B] = &(instruction_lv_cmp_ne_b );
    378 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_NE_H]) _function_decod[i][ 2][OPCOD_LV_CMP_NE_H] = &(instruction_lv_cmp_ne_h );
    379 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MADDS_H ]) _function_decod[i][ 2][OPCOD_LV_MADDS_H ] = &(instruction_lv_madds_h  );
    380 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MAX_B   ]) _function_decod[i][ 2][OPCOD_LV_MAX_B   ] = &(instruction_lv_max_b    );
    381 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MAX_H   ]) _function_decod[i][ 2][OPCOD_LV_MAX_H   ] = &(instruction_lv_max_h    );
    382 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MERGE_B ]) _function_decod[i][ 2][OPCOD_LV_MERGE_B ] = &(instruction_lv_merge_b  );
    383 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MERGE_H ]) _function_decod[i][ 2][OPCOD_LV_MERGE_H ] = &(instruction_lv_merge_h  );
    384 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MIN_B   ]) _function_decod[i][ 2][OPCOD_LV_MIN_B   ] = &(instruction_lv_min_b    );
    385 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MIN_H   ]) _function_decod[i][ 2][OPCOD_LV_MIN_H   ] = &(instruction_lv_min_h    );
    386 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MSUBS_H ]) _function_decod[i][ 2][OPCOD_LV_MSUBS_H ] = &(instruction_lv_msubs_h  );
    387 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MULS_H  ]) _function_decod[i][ 2][OPCOD_LV_MULS_H  ] = &(instruction_lv_muls_h   );
    388 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_NAND    ]) _function_decod[i][ 2][OPCOD_LV_NAND    ] = &(instruction_lv_nand          );
    389 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_NOR     ]) _function_decod[i][ 2][OPCOD_LV_NOR     ] = &(instruction_lv_nor           );
    390 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_OR      ]) _function_decod[i][ 2][OPCOD_LV_OR      ] = &(instruction_lv_or            );
    391 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACK_B  ]) _function_decod[i][ 2][OPCOD_LV_PACK_B  ] = &(instruction_lv_pack_b   );
    392 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACK_H  ]) _function_decod[i][ 2][OPCOD_LV_PACK_H  ] = &(instruction_lv_pack_h   );
    393 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACKS_B ]) _function_decod[i][ 2][OPCOD_LV_PACKS_B ] = &(instruction_lv_packs_b  );
    394 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACKS_H ]) _function_decod[i][ 2][OPCOD_LV_PACKS_H ] = &(instruction_lv_packs_h  );
    395 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACKUS_B]) _function_decod[i][ 2][OPCOD_LV_PACKUS_B] = &(instruction_lv_packus_b );
    396 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACKUS_H]) _function_decod[i][ 2][OPCOD_LV_PACKUS_H] = &(instruction_lv_packus_h );
    397 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PERM_N  ]) _function_decod[i][ 2][OPCOD_LV_PERM_N  ] = &(instruction_lv_perm_n   );
    398 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_RL_B    ]) _function_decod[i][ 2][OPCOD_LV_RL_B    ] = &(instruction_lv_rl_b          );
    399 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_RL_H    ]) _function_decod[i][ 2][OPCOD_LV_RL_H    ] = &(instruction_lv_rl_h          );
    400 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SLL     ]) _function_decod[i][ 2][OPCOD_LV_SLL     ] = &(instruction_lv_sll           );
    401 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SLL_B   ]) _function_decod[i][ 2][OPCOD_LV_SLL_B   ] = &(instruction_lv_sll_b    );
    402 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SLL_H   ]) _function_decod[i][ 2][OPCOD_LV_SLL_H   ] = &(instruction_lv_sll_h    );
    403 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SRA_B   ]) _function_decod[i][ 2][OPCOD_LV_SRA_B   ] = &(instruction_lv_sra_b    );
    404 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SRA_H   ]) _function_decod[i][ 2][OPCOD_LV_SRA_H   ] = &(instruction_lv_sra_h    );
    405 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SRL     ]) _function_decod[i][ 2][OPCOD_LV_SRL     ] = &(instruction_lv_srl           );
    406 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SRL_B   ]) _function_decod[i][ 2][OPCOD_LV_SRL_B   ] = &(instruction_lv_srl_b    );
    407 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SRL_H   ]) _function_decod[i][ 2][OPCOD_LV_SRL_H   ] = &(instruction_lv_srl_h    );
    408 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUB_B   ]) _function_decod[i][ 2][OPCOD_LV_SUB_B   ] = &(instruction_lv_sub_b    );
    409 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUB_H   ]) _function_decod[i][ 2][OPCOD_LV_SUB_H   ] = &(instruction_lv_sub_h    );
    410 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBS_B  ]) _function_decod[i][ 2][OPCOD_LV_SUBS_B  ] = &(instruction_lv_subs_b   );
    411 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBS_H  ]) _function_decod[i][ 2][OPCOD_LV_SUBS_H  ] = &(instruction_lv_subs_h   );
    412 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBU_B  ]) _function_decod[i][ 2][OPCOD_LV_SUBU_B  ] = &(instruction_lv_subu_b   );
    413 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBU_H  ]) _function_decod[i][ 2][OPCOD_LV_SUBU_H  ] = &(instruction_lv_subu_h   );
    414 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBUS_B ]) _function_decod[i][ 2][OPCOD_LV_SUBUS_B ] = &(instruction_lv_subus_b  );
    415 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBUS_H ]) _function_decod[i][ 2][OPCOD_LV_SUBUS_H ] = &(instruction_lv_subus_h  );
    416 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_UNPACK_B]) _function_decod[i][ 2][OPCOD_LV_UNPACK_B] = &(instruction_lv_unpack_b );
    417 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_UNPACK_H]) _function_decod[i][ 2][OPCOD_LV_UNPACK_H] = &(instruction_lv_unpack_h );
    418 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_XOR     ]) _function_decod[i][ 2][OPCOD_LV_XOR     ] = &(instruction_lv_xor      );
    419 
    420         // Custom Instruction
    421         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1    ]) _function_decod [i][ 0][OPCOD_L_CUST1    ] = &(instruction_l_custom );
    422         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2    ]) _function_decod [i][ 0][OPCOD_L_CUST2    ] = &(instruction_l_custom );
    423         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3    ]) _function_decod [i][ 0][OPCOD_L_CUST3    ] = &(instruction_l_custom );
    424         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4    ]) _function_decod [i][ 0][OPCOD_L_CUST4    ] = &(instruction_l_custom );
    425         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5    ]) _function_decod [i][ 0][OPCOD_L_CUST5    ] = &(instruction_l_custom );
    426         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6    ]) _function_decod [i][ 0][OPCOD_L_CUST6    ] = &(instruction_l_custom );
    427         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7    ]) _function_decod [i][ 0][OPCOD_L_CUST7    ] = &(instruction_l_custom );
    428         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8    ]) _function_decod [i][ 0][OPCOD_L_CUST8    ] = &(instruction_l_custom );
    429 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_decod [i][ 1][OPCOD_LF_CUST1_D ] = &(instruction_lf_custom);
    430 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_decod [i][ 1][OPCOD_LF_CUST1_S ] = &(instruction_lf_custom);
    431 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1   ]) _function_decod [i][ 2][OPCOD_LV_CUST1   ] = &(instruction_lv_custom);
    432 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2   ]) _function_decod [i][ 2][OPCOD_LV_CUST2   ] = &(instruction_lv_custom);
    433 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3   ]) _function_decod [i][ 2][OPCOD_LV_CUST3   ] = &(instruction_lv_custom);
    434 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4   ]) _function_decod [i][ 2][OPCOD_LV_CUST4   ] = &(instruction_lv_custom);
    435 
    436         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1    ]) _function_custom[i][ 0][OPCOD_L_CUST1    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_1   );
    437         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2    ]) _function_custom[i][ 0][OPCOD_L_CUST2    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_2   );
    438         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3    ]) _function_custom[i][ 0][OPCOD_L_CUST3    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_3   );
    439         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4    ]) _function_custom[i][ 0][OPCOD_L_CUST4    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_4   );
    440         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5    ]) _function_custom[i][ 0][OPCOD_L_CUST5    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_5   );
    441         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6    ]) _function_custom[i][ 0][OPCOD_L_CUST6    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_6   );
    442         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7    ]) _function_custom[i][ 0][OPCOD_L_CUST7    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_7   );
    443         if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8    ]) _function_custom[i][ 0][OPCOD_L_CUST8    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_8   );
    444 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_custom[i][ 1][OPCOD_LF_CUST1_D ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LF_1_D);
    445 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_custom[i][ 1][OPCOD_LF_CUST1_S ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LF_1_S);
    446 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1   ]) _function_custom[i][ 2][OPCOD_LV_CUST1   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_1  );
    447 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2   ]) _function_custom[i][ 2][OPCOD_LV_CUST2   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_2  );
    448 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3   ]) _function_custom[i][ 2][OPCOD_LV_CUST3   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_3  );
    449 //      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4   ]) _function_custom[i][ 2][OPCOD_LV_CUST4   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_4  );
     193        _function_decod  [i] = new function_decod_t ** [nb_opcod_type];
     194        _function_custom [i] = new function_decod_t ** [nb_opcod_type];
     195        for (uint32_t j=0; j<nb_opcod_type; j++)
     196          {
     197            _function_decod  [i][j] = new function_decod_t * [tab_opcod_type[j]];
     198            _function_custom [i][j] = new function_decod_t * [tab_opcod_type[j]];
     199            for (uint32_t k=0; k<tab_opcod_type[j]; k++)
     200              {
     201                _function_decod  [i][j][k] = &(instruction_illegal);
     202                _function_custom [i][j][k] = &(instruction_illegal);
     203              }
     204          }
     205
     206        // Create indirection
     207        _function_decod[i][0][OPCOD_1 ] = &(instruction_decod_type_1 ); // Instruction ORFPX32/64               
     208        _function_decod[i][0][OPCOD_2 ] = &(instruction_decod_type_2 ); // Instruction ORVDX64                   
     209        _function_decod[i][0][OPCOD_3 ] = &(instruction_decod_type_3 ); // Instructions Register-Register        
     210        _function_decod[i][0][OPCOD_4 ] = &(instruction_decod_type_4 ); // Instructions "set flag" with register
     211        _function_decod[i][0][OPCOD_5 ] = &(instruction_decod_type_5 ); // Instructions "set flag" with immediat
     212        _function_decod[i][0][OPCOD_6 ] = &(instruction_decod_type_6 ); // Instruction Shift/Rotate with immediat
     213        _function_decod[i][0][OPCOD_7 ] = &(instruction_decod_type_7 ); // Instructions multiply with HI-LO      
     214        _function_decod[i][0][OPCOD_8 ] = &(instruction_decod_type_8 ); // Instructions acces at HI-LO     
     215        _function_decod[i][0][OPCOD_9 ] = &(instruction_decod_type_9 ); // Instructions special            
     216        _function_decod[i][0][OPCOD_10] = &(instruction_decod_type_10); // Instructions no operation             
     217        _function_decod[i][3][OPCOD_11] = &(instruction_decod_type_11); // Instruction Shift/Rotate with register
     218        _function_decod[i][3][OPCOD_12] = &(instruction_decod_type_12); // Instructions extend                   
     219        _function_decod[i][3][OPCOD_13] = &(instruction_decod_type_13); // Instructions extend (64b)             
     220
     221        if (_param->_instruction_implemeted[i][INSTRUCTION_L_ADD      ]) _function_decod[i][ 3][OPCOD_L_ADD      ] = &(instruction_l_add            );
     222        if (_param->_instruction_implemeted[i][INSTRUCTION_L_ADDC     ]) _function_decod[i][ 3][OPCOD_L_ADDC     ] = &(instruction_l_addc           );
     223        if (_param->_instruction_implemeted[i][INSTRUCTION_L_ADDI     ]) _function_decod[i][ 0][OPCOD_L_ADDI     ] = &(instruction_l_addi           );
     224        if (_param->_instruction_implemeted[i][INSTRUCTION_L_ADDIC    ]) _function_decod[i][ 0][OPCOD_L_ADDIC    ] = &(instruction_l_addic          );
     225        if (_param->_instruction_implemeted[i][INSTRUCTION_L_AND      ]) _function_decod[i][ 3][OPCOD_L_AND      ] = &(instruction_l_and            );
     226        if (_param->_instruction_implemeted[i][INSTRUCTION_L_ANDI     ]) _function_decod[i][ 0][OPCOD_L_ANDI     ] = &(instruction_l_andi           );
     227        if (_param->_instruction_implemeted[i][INSTRUCTION_L_BF       ]) _function_decod[i][ 0][OPCOD_L_BF       ] = &(instruction_l_bf             );
     228        if (_param->_instruction_implemeted[i][INSTRUCTION_L_BNF      ]) _function_decod[i][ 0][OPCOD_L_BNF      ] = &(instruction_l_bnf            );
     229        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CMOV     ]) _function_decod[i][ 3][OPCOD_L_CMOV     ] = &(instruction_l_cmov           );
     230        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CSYNC    ]) _function_decod[i][ 9][OPCOD_L_CSYNC    ] = &(instruction_l_csync          );
     231        if (_param->_instruction_implemeted[i][INSTRUCTION_L_DIV      ]) _function_decod[i][ 3][OPCOD_L_DIV      ] = &(instruction_l_div            );
     232        if (_param->_instruction_implemeted[i][INSTRUCTION_L_DIVU     ]) _function_decod[i][ 3][OPCOD_L_DIVU     ] = &(instruction_l_divu           );
     233        if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTBS    ]) _function_decod[i][12][OPCOD_L_EXTBS    ] = &(instruction_l_extbs          );
     234        if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTBZ    ]) _function_decod[i][12][OPCOD_L_EXTBZ    ] = &(instruction_l_extbz          );
     235        if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTHS    ]) _function_decod[i][12][OPCOD_L_EXTHS    ] = &(instruction_l_exths          );
     236        if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTHZ    ]) _function_decod[i][12][OPCOD_L_EXTHZ    ] = &(instruction_l_exthz          );
     237        if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTWS    ]) _function_decod[i][13][OPCOD_L_EXTWS    ] = &(instruction_l_extws          );
     238        if (_param->_instruction_implemeted[i][INSTRUCTION_L_EXTWZ    ]) _function_decod[i][13][OPCOD_L_EXTWZ    ] = &(instruction_l_extwz          );
     239        if (_param->_instruction_implemeted[i][INSTRUCTION_L_FF1      ]) _function_decod[i][ 3][OPCOD_L_FF1      ] = &(instruction_l_ff1            );
     240        if (_param->_instruction_implemeted[i][INSTRUCTION_L_FL1      ]) _function_decod[i][ 3][OPCOD_L_FL1      ] = &(instruction_l_fl1            );
     241        if (_param->_instruction_implemeted[i][INSTRUCTION_L_J        ]) _function_decod[i][ 0][OPCOD_L_J        ] = &(instruction_l_j              );
     242        if (_param->_instruction_implemeted[i][INSTRUCTION_L_JAL      ]) _function_decod[i][ 0][OPCOD_L_JAL      ] = &(instruction_l_jal            );
     243        if (_param->_instruction_implemeted[i][INSTRUCTION_L_JALR     ]) _function_decod[i][ 0][OPCOD_L_JALR     ] = &(instruction_l_jalr           );
     244        if (_param->_instruction_implemeted[i][INSTRUCTION_L_JR       ]) _function_decod[i][ 0][OPCOD_L_JR       ] = &(instruction_l_jr             );
     245        if (_param->_instruction_implemeted[i][INSTRUCTION_L_LBS      ]) _function_decod[i][ 0][OPCOD_L_LBS      ] = &(instruction_l_lbs            );
     246        if (_param->_instruction_implemeted[i][INSTRUCTION_L_LBZ      ]) _function_decod[i][ 0][OPCOD_L_LBZ      ] = &(instruction_l_lbz            );
     247        if (_param->_instruction_implemeted[i][INSTRUCTION_L_LD       ]) _function_decod[i][ 0][OPCOD_L_LD       ] = &(instruction_l_ld             );
     248        if (_param->_instruction_implemeted[i][INSTRUCTION_L_LHS      ]) _function_decod[i][ 0][OPCOD_L_LHS      ] = &(instruction_l_lhs            );
     249        if (_param->_instruction_implemeted[i][INSTRUCTION_L_LHZ      ]) _function_decod[i][ 0][OPCOD_L_LHZ      ] = &(instruction_l_lhz            );
     250        if (_param->_instruction_implemeted[i][INSTRUCTION_L_LWS      ]) _function_decod[i][ 0][OPCOD_L_LWS      ] = &(instruction_l_lws            );
     251        if (_param->_instruction_implemeted[i][INSTRUCTION_L_LWZ      ]) _function_decod[i][ 0][OPCOD_L_LWZ      ] = &(instruction_l_lwz            );
     252        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MAC      ]) _function_decod[i][ 7][OPCOD_L_MAC      ] = &(instruction_l_mac            );
     253        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MACI     ]) _function_decod[i][ 0][OPCOD_L_MACI     ] = &(instruction_l_maci           );
     254        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MACRC    ]) _function_decod[i][ 8][OPCOD_L_MACRC    ] = &(instruction_l_macrc          );
     255        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MFSPR    ]) _function_decod[i][ 0][OPCOD_L_MFSPR    ] = &(instruction_l_mfspr          );
     256        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MOVHI    ]) _function_decod[i][ 8][OPCOD_L_MOVHI    ] = &(instruction_l_movhi          );
     257        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MSB      ]) _function_decod[i][ 7][OPCOD_L_MSB      ] = &(instruction_l_msb            );
     258        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MSYNC    ]) _function_decod[i][ 9][OPCOD_L_MSYNC    ] = &(instruction_l_msync          );
     259        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MTSPR    ]) _function_decod[i][ 0][OPCOD_L_MTSPR    ] = &(instruction_l_mtspr          );
     260        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MUL      ]) _function_decod[i][ 3][OPCOD_L_MUL      ] = &(instruction_l_mul            );
     261        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MULI     ]) _function_decod[i][ 0][OPCOD_L_MULI     ] = &(instruction_l_muli           );
     262        if (_param->_instruction_implemeted[i][INSTRUCTION_L_MULU     ]) _function_decod[i][ 3][OPCOD_L_MULU     ] = &(instruction_l_mulu           );
     263        if (_param->_instruction_implemeted[i][INSTRUCTION_L_NOP      ]) _function_decod[i][10][OPCOD_L_NOP      ] = &(instruction_l_nop            );
     264        if (_param->_instruction_implemeted[i][INSTRUCTION_L_OR       ]) _function_decod[i][ 3][OPCOD_L_OR       ] = &(instruction_l_or             );
     265        if (_param->_instruction_implemeted[i][INSTRUCTION_L_ORI      ]) _function_decod[i][ 0][OPCOD_L_ORI      ] = &(instruction_l_ori            );
     266        if (_param->_instruction_implemeted[i][INSTRUCTION_L_PSYNC    ]) _function_decod[i][ 9][OPCOD_L_PSYNC    ] = &(instruction_l_psync          );
     267        if (_param->_instruction_implemeted[i][INSTRUCTION_L_RFE      ]) _function_decod[i][ 0][OPCOD_L_RFE      ] = &(instruction_l_rfe            );
     268        if (_param->_instruction_implemeted[i][INSTRUCTION_L_ROR      ]) _function_decod[i][11][OPCOD_L_ROR      ] = &(instruction_l_ror            );
     269        if (_param->_instruction_implemeted[i][INSTRUCTION_L_RORI     ]) _function_decod[i][ 6][OPCOD_L_RORI     ] = &(instruction_l_rori           );
     270        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SB       ]) _function_decod[i][ 0][OPCOD_L_SB       ] = &(instruction_l_sb             );
     271        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SD       ]) _function_decod[i][ 0][OPCOD_L_SD       ] = &(instruction_l_sd             );
     272        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFEQ     ]) _function_decod[i][ 4][OPCOD_L_SFEQ     ] = &(instruction_l_sfeq           );
     273        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFEQI    ]) _function_decod[i][ 5][OPCOD_L_SFEQI    ] = &(instruction_l_sfeqi          );
     274        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGES    ]) _function_decod[i][ 4][OPCOD_L_SFGES    ] = &(instruction_l_sfges          );
     275        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGESI   ]) _function_decod[i][ 5][OPCOD_L_SFGESI   ] = &(instruction_l_sfgesi         );
     276        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGEU    ]) _function_decod[i][ 4][OPCOD_L_SFGEU    ] = &(instruction_l_sfgeu          );
     277        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGEUI   ]) _function_decod[i][ 5][OPCOD_L_SFGEUI   ] = &(instruction_l_sfgeui         );
     278        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGTS    ]) _function_decod[i][ 4][OPCOD_L_SFGTS    ] = &(instruction_l_sfgts          );
     279        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGTSI   ]) _function_decod[i][ 5][OPCOD_L_SFGTSI   ] = &(instruction_l_sfgtsi         );
     280        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGTU    ]) _function_decod[i][ 4][OPCOD_L_SFGTU    ] = &(instruction_l_sfgtu          );
     281        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFGTUI   ]) _function_decod[i][ 5][OPCOD_L_SFGTUI   ] = &(instruction_l_sfgtui         );
     282        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLES    ]) _function_decod[i][ 4][OPCOD_L_SFLES    ] = &(instruction_l_sfles          );
     283        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLESI   ]) _function_decod[i][ 5][OPCOD_L_SFLESI   ] = &(instruction_l_sflesi         );
     284        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLEU    ]) _function_decod[i][ 4][OPCOD_L_SFLEU    ] = &(instruction_l_sfleu          );
     285        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLEUI   ]) _function_decod[i][ 5][OPCOD_L_SFLEUI   ] = &(instruction_l_sfleui         );
     286        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLTS    ]) _function_decod[i][ 4][OPCOD_L_SFLTS    ] = &(instruction_l_sflts          );
     287        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLTSI   ]) _function_decod[i][ 5][OPCOD_L_SFLTSI   ] = &(instruction_l_sfltsi         );
     288        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLTU    ]) _function_decod[i][ 4][OPCOD_L_SFLTU    ] = &(instruction_l_sfltu          );
     289        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFLTUI   ]) _function_decod[i][ 5][OPCOD_L_SFLTUI   ] = &(instruction_l_sfltui         );
     290        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFNE     ]) _function_decod[i][ 4][OPCOD_L_SFNE     ] = &(instruction_l_sfne           );
     291        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SFNEI    ]) _function_decod[i][ 5][OPCOD_L_SFNEI    ] = &(instruction_l_sfnei          );
     292        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SH       ]) _function_decod[i][ 0][OPCOD_L_SH       ] = &(instruction_l_sh             );
     293        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SLL      ]) _function_decod[i][11][OPCOD_L_SLL      ] = &(instruction_l_sll            );
     294        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SLLI     ]) _function_decod[i][ 6][OPCOD_L_SLLI     ] = &(instruction_l_slli           );
     295        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SRA      ]) _function_decod[i][11][OPCOD_L_SRA      ] = &(instruction_l_sra            );
     296        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SRAI     ]) _function_decod[i][ 6][OPCOD_L_SRAI     ] = &(instruction_l_srai           );
     297        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SRL      ]) _function_decod[i][11][OPCOD_L_SRL      ] = &(instruction_l_srl            );
     298        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SRLI     ]) _function_decod[i][ 6][OPCOD_L_SRLI     ] = &(instruction_l_srli           );
     299        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SUB      ]) _function_decod[i][ 3][OPCOD_L_SUB      ] = &(instruction_l_sub            );
     300        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SW       ]) _function_decod[i][ 0][OPCOD_L_SW       ] = &(instruction_l_sw             );
     301        if (_param->_instruction_implemeted[i][INSTRUCTION_L_SYS      ]) _function_decod[i][ 9][OPCOD_L_SYS      ] = &(instruction_l_sys            );
     302        if (_param->_instruction_implemeted[i][INSTRUCTION_L_TRAP     ]) _function_decod[i][ 9][OPCOD_L_TRAP     ] = &(instruction_l_trap           );
     303        if (_param->_instruction_implemeted[i][INSTRUCTION_L_XOR      ]) _function_decod[i][ 3][OPCOD_L_XOR      ] = &(instruction_l_xor            );
     304        if (_param->_instruction_implemeted[i][INSTRUCTION_L_XORI     ]) _function_decod[i][ 0][OPCOD_L_XORI     ] = &(instruction_l_xori           );
     305//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_ADD_D   ]) _function_decod[i][ 1][OPCOD_LF_ADD_D   ] = &(instruction_lf_add_d    );
     306//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_ADD_S   ]) _function_decod[i][ 1][OPCOD_LF_ADD_S   ] = &(instruction_lf_add_s    );
     307//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_DIV_D   ]) _function_decod[i][ 1][OPCOD_LF_DIV_D   ] = &(instruction_lf_div_d    );
     308//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_DIV_S   ]) _function_decod[i][ 1][OPCOD_LF_DIV_S   ] = &(instruction_lf_div_s    );
     309//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_FTOI_D  ]) _function_decod[i][ 1][OPCOD_LF_FTOI_D  ] = &(instruction_lf_ftoi_d   );
     310//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_FTOI_S  ]) _function_decod[i][ 1][OPCOD_LF_FTOI_S  ] = &(instruction_lf_ftoi_s   );
     311//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_ITOF_D  ]) _function_decod[i][ 1][OPCOD_LF_ITOF_D  ] = &(instruction_lf_itof_d   );
     312//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_ITOF_S  ]) _function_decod[i][ 1][OPCOD_LF_ITOF_S  ] = &(instruction_lf_itof_s   );
     313//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_MADD_D  ]) _function_decod[i][ 1][OPCOD_LF_MADD_D  ] = &(instruction_lf_madd_d   );
     314//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_MADD_S  ]) _function_decod[i][ 1][OPCOD_LF_MADD_S  ] = &(instruction_lf_madd_s   );
     315//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_MUL_D   ]) _function_decod[i][ 1][OPCOD_LF_MUL_D   ] = &(instruction_lf_mul_d    );
     316//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_MUL_S   ]) _function_decod[i][ 1][OPCOD_LF_MUL_S   ] = &(instruction_lf_mul_s    );
     317//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_REM_D   ]) _function_decod[i][ 1][OPCOD_LF_REM_D   ] = &(instruction_lf_rem_d    );
     318//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_REM_S   ]) _function_decod[i][ 1][OPCOD_LF_REM_S   ] = &(instruction_lf_rem_s    );
     319//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFEQ_D  ]) _function_decod[i][ 1][OPCOD_LF_SFEQ_D  ] = &(instruction_lf_sfeq_d   );
     320//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFEQ_S  ]) _function_decod[i][ 1][OPCOD_LF_SFEQ_S  ] = &(instruction_lf_sfeq_s   );
     321//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFGE_D  ]) _function_decod[i][ 1][OPCOD_LF_SFGE_D  ] = &(instruction_lf_sfge_d   );
     322//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFGE_S  ]) _function_decod[i][ 1][OPCOD_LF_SFGE_S  ] = &(instruction_lf_sfge_s   );
     323//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFGT_D  ]) _function_decod[i][ 1][OPCOD_LF_SFGT_D  ] = &(instruction_lf_sfgt_d   );
     324//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFGT_S  ]) _function_decod[i][ 1][OPCOD_LF_SFGT_S  ] = &(instruction_lf_sfgt_s   );
     325//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFLE_D  ]) _function_decod[i][ 1][OPCOD_LF_SFLE_D  ] = &(instruction_lf_sfle_d   );
     326//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFLE_S  ]) _function_decod[i][ 1][OPCOD_LF_SFLE_S  ] = &(instruction_lf_sfle_s   );
     327//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFLT_D  ]) _function_decod[i][ 1][OPCOD_LF_SFLT_D  ] = &(instruction_lf_sflt_d   );
     328//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFLT_S  ]) _function_decod[i][ 1][OPCOD_LF_SFLT_S  ] = &(instruction_lf_sflt_s   );
     329//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFNE_D  ]) _function_decod[i][ 1][OPCOD_LF_SFNE_D  ] = &(instruction_lf_sfne_d   );
     330//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SFNE_S  ]) _function_decod[i][ 1][OPCOD_LF_SFNE_S  ] = &(instruction_lf_sfne_s   );
     331//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SUB_D   ]) _function_decod[i][ 1][OPCOD_LF_SUB_D   ] = &(instruction_lf_sub_d    );
     332//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_SUB_S   ]) _function_decod[i][ 1][OPCOD_LF_SUB_S   ] = &(instruction_lf_sub_s    );
     333//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADD_B   ]) _function_decod[i][ 2][OPCOD_LV_ADD_B   ] = &(instruction_lv_add_b    );
     334//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADD_H   ]) _function_decod[i][ 2][OPCOD_LV_ADD_H   ] = &(instruction_lv_add_h    );
     335//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDS_B  ]) _function_decod[i][ 2][OPCOD_LV_ADDS_B  ] = &(instruction_lv_adds_b   );
     336//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDS_H  ]) _function_decod[i][ 2][OPCOD_LV_ADDS_H  ] = &(instruction_lv_adds_h   );
     337//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDU_B  ]) _function_decod[i][ 2][OPCOD_LV_ADDU_B  ] = &(instruction_lv_addu_b   );
     338//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDU_H  ]) _function_decod[i][ 2][OPCOD_LV_ADDU_H  ] = &(instruction_lv_addu_h   );
     339//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDUS_B ]) _function_decod[i][ 2][OPCOD_LV_ADDUS_B ] = &(instruction_lv_addus_b  );
     340//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ADDUS_H ]) _function_decod[i][ 2][OPCOD_LV_ADDUS_H ] = &(instruction_lv_addus_h  );
     341//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_EQ_B]) _function_decod[i][ 2][OPCOD_LV_ALL_EQ_B] = &(instruction_lv_all_eq_b );
     342//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_EQ_H]) _function_decod[i][ 2][OPCOD_LV_ALL_EQ_H] = &(instruction_lv_all_eq_h );
     343//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_GE_B]) _function_decod[i][ 2][OPCOD_LV_ALL_GE_B] = &(instruction_lv_all_ge_b );
     344//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_GE_H]) _function_decod[i][ 2][OPCOD_LV_ALL_GE_H] = &(instruction_lv_all_ge_h );
     345//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_GT_B]) _function_decod[i][ 2][OPCOD_LV_ALL_GT_B] = &(instruction_lv_all_gt_b );
     346//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_GT_H]) _function_decod[i][ 2][OPCOD_LV_ALL_GT_H] = &(instruction_lv_all_gt_h );
     347//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_LE_B]) _function_decod[i][ 2][OPCOD_LV_ALL_LE_B] = &(instruction_lv_all_le_b );
     348//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_LE_H]) _function_decod[i][ 2][OPCOD_LV_ALL_LE_H] = &(instruction_lv_all_le_h );
     349//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_LT_B]) _function_decod[i][ 2][OPCOD_LV_ALL_LT_B] = &(instruction_lv_all_lt_b );
     350//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_LT_H]) _function_decod[i][ 2][OPCOD_LV_ALL_LT_H] = &(instruction_lv_all_lt_h );
     351//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_NE_B]) _function_decod[i][ 2][OPCOD_LV_ALL_NE_B] = &(instruction_lv_all_ne_b );
     352//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ALL_NE_H]) _function_decod[i][ 2][OPCOD_LV_ALL_NE_H] = &(instruction_lv_all_ne_h );
     353//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_AND     ]) _function_decod[i][ 2][OPCOD_LV_AND     ] = &(instruction_lv_and           );
     354//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_EQ_B]) _function_decod[i][ 2][OPCOD_LV_ANY_EQ_B] = &(instruction_lv_any_eq_b );
     355//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_EQ_H]) _function_decod[i][ 2][OPCOD_LV_ANY_EQ_H] = &(instruction_lv_any_eq_h );
     356//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_GE_B]) _function_decod[i][ 2][OPCOD_LV_ANY_GE_B] = &(instruction_lv_any_ge_b );
     357//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_GE_H]) _function_decod[i][ 2][OPCOD_LV_ANY_GE_H] = &(instruction_lv_any_ge_h );
     358//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_GT_B]) _function_decod[i][ 2][OPCOD_LV_ANY_GT_B] = &(instruction_lv_any_gt_b );
     359//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_GT_H]) _function_decod[i][ 2][OPCOD_LV_ANY_GT_H] = &(instruction_lv_any_gt_h );
     360//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_LE_B]) _function_decod[i][ 2][OPCOD_LV_ANY_LE_B] = &(instruction_lv_any_le_b );
     361//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_LE_H]) _function_decod[i][ 2][OPCOD_LV_ANY_LE_H] = &(instruction_lv_any_le_h );
     362//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_LT_B]) _function_decod[i][ 2][OPCOD_LV_ANY_LT_B] = &(instruction_lv_any_lt_b );
     363//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_LT_H]) _function_decod[i][ 2][OPCOD_LV_ANY_LT_H] = &(instruction_lv_any_lt_h );
     364//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_NE_B]) _function_decod[i][ 2][OPCOD_LV_ANY_NE_B] = &(instruction_lv_any_ne_b );
     365//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_ANY_NE_H]) _function_decod[i][ 2][OPCOD_LV_ANY_NE_H] = &(instruction_lv_any_ne_h );
     366//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_AVG_B   ]) _function_decod[i][ 2][OPCOD_LV_AVG_B   ] = &(instruction_lv_avg_b    );
     367//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_AVG_H   ]) _function_decod[i][ 2][OPCOD_LV_AVG_H   ] = &(instruction_lv_avg_h    );
     368//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_EQ_B]) _function_decod[i][ 2][OPCOD_LV_CMP_EQ_B] = &(instruction_lv_cmp_eq_b );
     369//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_EQ_H]) _function_decod[i][ 2][OPCOD_LV_CMP_EQ_H] = &(instruction_lv_cmp_eq_h );
     370//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_GE_B]) _function_decod[i][ 2][OPCOD_LV_CMP_GE_B] = &(instruction_lv_cmp_ge_b );
     371//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_GE_H]) _function_decod[i][ 2][OPCOD_LV_CMP_GE_H] = &(instruction_lv_cmp_ge_h );
     372//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_GT_B]) _function_decod[i][ 2][OPCOD_LV_CMP_GT_B] = &(instruction_lv_cmp_gt_b );
     373//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_GT_H]) _function_decod[i][ 2][OPCOD_LV_CMP_GT_H] = &(instruction_lv_cmp_gt_h );
     374//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_LE_B]) _function_decod[i][ 2][OPCOD_LV_CMP_LE_B] = &(instruction_lv_cmp_le_b );
     375//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_LE_H]) _function_decod[i][ 2][OPCOD_LV_CMP_LE_H] = &(instruction_lv_cmp_le_h );
     376//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_LT_B]) _function_decod[i][ 2][OPCOD_LV_CMP_LT_B] = &(instruction_lv_cmp_lt_b );
     377//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_LT_H]) _function_decod[i][ 2][OPCOD_LV_CMP_LT_H] = &(instruction_lv_cmp_lt_h );
     378//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_NE_B]) _function_decod[i][ 2][OPCOD_LV_CMP_NE_B] = &(instruction_lv_cmp_ne_b );
     379//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CMP_NE_H]) _function_decod[i][ 2][OPCOD_LV_CMP_NE_H] = &(instruction_lv_cmp_ne_h );
     380//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MADDS_H ]) _function_decod[i][ 2][OPCOD_LV_MADDS_H ] = &(instruction_lv_madds_h  );
     381//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MAX_B   ]) _function_decod[i][ 2][OPCOD_LV_MAX_B   ] = &(instruction_lv_max_b    );
     382//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MAX_H   ]) _function_decod[i][ 2][OPCOD_LV_MAX_H   ] = &(instruction_lv_max_h    );
     383//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MERGE_B ]) _function_decod[i][ 2][OPCOD_LV_MERGE_B ] = &(instruction_lv_merge_b  );
     384//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MERGE_H ]) _function_decod[i][ 2][OPCOD_LV_MERGE_H ] = &(instruction_lv_merge_h  );
     385//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MIN_B   ]) _function_decod[i][ 2][OPCOD_LV_MIN_B   ] = &(instruction_lv_min_b    );
     386//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MIN_H   ]) _function_decod[i][ 2][OPCOD_LV_MIN_H   ] = &(instruction_lv_min_h    );
     387//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MSUBS_H ]) _function_decod[i][ 2][OPCOD_LV_MSUBS_H ] = &(instruction_lv_msubs_h  );
     388//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_MULS_H  ]) _function_decod[i][ 2][OPCOD_LV_MULS_H  ] = &(instruction_lv_muls_h   );
     389//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_NAND    ]) _function_decod[i][ 2][OPCOD_LV_NAND    ] = &(instruction_lv_nand          );
     390//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_NOR     ]) _function_decod[i][ 2][OPCOD_LV_NOR     ] = &(instruction_lv_nor           );
     391//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_OR      ]) _function_decod[i][ 2][OPCOD_LV_OR      ] = &(instruction_lv_or            );
     392//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACK_B  ]) _function_decod[i][ 2][OPCOD_LV_PACK_B  ] = &(instruction_lv_pack_b   );
     393//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACK_H  ]) _function_decod[i][ 2][OPCOD_LV_PACK_H  ] = &(instruction_lv_pack_h   );
     394//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACKS_B ]) _function_decod[i][ 2][OPCOD_LV_PACKS_B ] = &(instruction_lv_packs_b  );
     395//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACKS_H ]) _function_decod[i][ 2][OPCOD_LV_PACKS_H ] = &(instruction_lv_packs_h  );
     396//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACKUS_B]) _function_decod[i][ 2][OPCOD_LV_PACKUS_B] = &(instruction_lv_packus_b );
     397//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PACKUS_H]) _function_decod[i][ 2][OPCOD_LV_PACKUS_H] = &(instruction_lv_packus_h );
     398//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_PERM_N  ]) _function_decod[i][ 2][OPCOD_LV_PERM_N  ] = &(instruction_lv_perm_n   );
     399//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_RL_B    ]) _function_decod[i][ 2][OPCOD_LV_RL_B    ] = &(instruction_lv_rl_b          );
     400//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_RL_H    ]) _function_decod[i][ 2][OPCOD_LV_RL_H    ] = &(instruction_lv_rl_h          );
     401//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SLL     ]) _function_decod[i][ 2][OPCOD_LV_SLL     ] = &(instruction_lv_sll           );
     402//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SLL_B   ]) _function_decod[i][ 2][OPCOD_LV_SLL_B   ] = &(instruction_lv_sll_b    );
     403//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SLL_H   ]) _function_decod[i][ 2][OPCOD_LV_SLL_H   ] = &(instruction_lv_sll_h    );
     404//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SRA_B   ]) _function_decod[i][ 2][OPCOD_LV_SRA_B   ] = &(instruction_lv_sra_b    );
     405//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SRA_H   ]) _function_decod[i][ 2][OPCOD_LV_SRA_H   ] = &(instruction_lv_sra_h    );
     406//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SRL     ]) _function_decod[i][ 2][OPCOD_LV_SRL     ] = &(instruction_lv_srl           );
     407//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SRL_B   ]) _function_decod[i][ 2][OPCOD_LV_SRL_B   ] = &(instruction_lv_srl_b    );
     408//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SRL_H   ]) _function_decod[i][ 2][OPCOD_LV_SRL_H   ] = &(instruction_lv_srl_h    );
     409//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUB_B   ]) _function_decod[i][ 2][OPCOD_LV_SUB_B   ] = &(instruction_lv_sub_b    );
     410//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUB_H   ]) _function_decod[i][ 2][OPCOD_LV_SUB_H   ] = &(instruction_lv_sub_h    );
     411//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBS_B  ]) _function_decod[i][ 2][OPCOD_LV_SUBS_B  ] = &(instruction_lv_subs_b   );
     412//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBS_H  ]) _function_decod[i][ 2][OPCOD_LV_SUBS_H  ] = &(instruction_lv_subs_h   );
     413//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBU_B  ]) _function_decod[i][ 2][OPCOD_LV_SUBU_B  ] = &(instruction_lv_subu_b   );
     414//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBU_H  ]) _function_decod[i][ 2][OPCOD_LV_SUBU_H  ] = &(instruction_lv_subu_h   );
     415//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBUS_B ]) _function_decod[i][ 2][OPCOD_LV_SUBUS_B ] = &(instruction_lv_subus_b  );
     416//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_SUBUS_H ]) _function_decod[i][ 2][OPCOD_LV_SUBUS_H ] = &(instruction_lv_subus_h  );
     417//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_UNPACK_B]) _function_decod[i][ 2][OPCOD_LV_UNPACK_B] = &(instruction_lv_unpack_b );
     418//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_UNPACK_H]) _function_decod[i][ 2][OPCOD_LV_UNPACK_H] = &(instruction_lv_unpack_h );
     419//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_XOR     ]) _function_decod[i][ 2][OPCOD_LV_XOR     ] = &(instruction_lv_xor      );
     420
     421        // Custom Instruction
     422        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1    ]) _function_decod [i][ 0][OPCOD_L_CUST1    ] = &(instruction_l_custom );
     423        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2    ]) _function_decod [i][ 0][OPCOD_L_CUST2    ] = &(instruction_l_custom );
     424        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3    ]) _function_decod [i][ 0][OPCOD_L_CUST3    ] = &(instruction_l_custom );
     425        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4    ]) _function_decod [i][ 0][OPCOD_L_CUST4    ] = &(instruction_l_custom );
     426        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5    ]) _function_decod [i][ 0][OPCOD_L_CUST5    ] = &(instruction_l_custom );
     427        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6    ]) _function_decod [i][ 0][OPCOD_L_CUST6    ] = &(instruction_l_custom );
     428        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7    ]) _function_decod [i][ 0][OPCOD_L_CUST7    ] = &(instruction_l_custom );
     429        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8    ]) _function_decod [i][ 0][OPCOD_L_CUST8    ] = &(instruction_l_custom );
     430//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_decod [i][ 1][OPCOD_LF_CUST1_D ] = &(instruction_lf_custom);
     431//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_decod [i][ 1][OPCOD_LF_CUST1_S ] = &(instruction_lf_custom);
     432//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1   ]) _function_decod [i][ 2][OPCOD_LV_CUST1   ] = &(instruction_lv_custom);
     433//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2   ]) _function_decod [i][ 2][OPCOD_LV_CUST2   ] = &(instruction_lv_custom);
     434//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3   ]) _function_decod [i][ 2][OPCOD_LV_CUST3   ] = &(instruction_lv_custom);
     435//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4   ]) _function_decod [i][ 2][OPCOD_LV_CUST4   ] = &(instruction_lv_custom);
     436
     437        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1    ]) _function_custom[i][ 0][OPCOD_L_CUST1    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_1   );
     438        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2    ]) _function_custom[i][ 0][OPCOD_L_CUST2    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_2   );
     439        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3    ]) _function_custom[i][ 0][OPCOD_L_CUST3    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_3   );
     440        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4    ]) _function_custom[i][ 0][OPCOD_L_CUST4    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_4   );
     441        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5    ]) _function_custom[i][ 0][OPCOD_L_CUST5    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_5   );
     442        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6    ]) _function_custom[i][ 0][OPCOD_L_CUST6    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_6   );
     443        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7    ]) _function_custom[i][ 0][OPCOD_L_CUST7    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_7   );
     444        if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8    ]) _function_custom[i][ 0][OPCOD_L_CUST8    ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_L_8   );
     445//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_custom[i][ 1][OPCOD_LF_CUST1_D ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LF_1_D);
     446//      if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_custom[i][ 1][OPCOD_LF_CUST1_S ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LF_1_S);
     447//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1   ]) _function_custom[i][ 2][OPCOD_LV_CUST1   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_1  );
     448//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2   ]) _function_custom[i][ 2][OPCOD_LV_CUST2   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_2  );
     449//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3   ]) _function_custom[i][ 2][OPCOD_LV_CUST3   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_3  );
     450//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4   ]) _function_custom[i][ 2][OPCOD_LV_CUST4   ] = _param->_get_custom_information()._get_custom_decod(OPERATION_CUSTOM_LV_4  );
    450451      }
    451452
     
    455456    for (uint32_t i=0; i<_param->_nb_context; i++)
    456457      _decod_param [i] = new decod_param_t (_param->_size_general_data,
    457                                             _function_decod [i],
    458                                             _function_custom[i]);
     458                                            _function_decod [i],
     459                                            _function_custom[i]);
    459460
    460461#ifdef POSITION
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_deallocation.cpp

    r88 r101  
    7979
    8080        DELETE1_SIGNAL(in_CONTEXT_DECOD_ENABLE, _param->_nb_context,1);
     81        DELETE1_SIGNAL(in_CONTEXT_DEPTH_VAL   , _param->_nb_context,1);
    8182        DELETE1_SIGNAL(in_CONTEXT_DEPTH       , _param->_nb_context,_param->_size_depth);
    8283
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp

    r88 r101  
    7777              {
    7878                log_printf(TRACE,Decod,FUNCTION,"  * IFETCH [%d][%d]",x,y);   
     79                log_printf(TRACE,Decod,FUNCTION,"    * decod_ack [%d] : %d",i,PORT_READ(in_DECOD_ACK [i]));
    7980
    8081                can_continue [x] = can_continue_next [x];
     
    145146                PORT_WRITE(out_DECOD_READ_RC       [i], _decod_instruction->_read_rc       );
    146147                PORT_WRITE(out_DECOD_NUM_REG_RC    [i], _decod_instruction->_num_reg_rc    );
    147                 PORT_WRITE(out_DECOD_WRITE_RD      [i], _decod_instruction->_write_rd      );
     148                PORT_WRITE(out_DECOD_WRITE_RD      [i],(_decod_instruction->_num_reg_rd!=0)?_decod_instruction->_write_rd:0);
    148149                PORT_WRITE(out_DECOD_NUM_REG_RD    [i], _decod_instruction->_num_reg_rd    );
    149150                PORT_WRITE(out_DECOD_WRITE_RE      [i], _decod_instruction->_write_re      );
     
    152153//              PORT_WRITE(out_DECOD_EXCEPTION     [i], _decod_instruction->_exception     );
    153154
     155                // Branch predictor can accept : the depth is valid
     156                log_printf(TRACE,Decod,FUNCTION,"    * context_depth_val : %d",PORT_READ(in_CONTEXT_DEPTH_VAL [x]));
     157                decod_val   [i]    &= PORT_READ(in_CONTEXT_DEPTH_VAL [x]);
     158                ifetch_ack  [x][y] &= PORT_READ(in_CONTEXT_DEPTH_VAL [x]);
     159
    154160                if (type == TYPE_BRANCH)
    155161                  {
    156162                    log_printf(TRACE,Decod,FUNCTION,"    * type is branch");
     163                    log_printf(TRACE,Decod,FUNCTION,"      * predict_ack  : %d",PORT_READ(in_PREDICT_ACK [i]));
     164
    157165                    log_printf(TRACE,Decod,FUNCTION,"      * address src  : %.8x (%.8x)",_decod_instruction->_address     ,_decod_instruction->_address     <<2);
    158166                    log_printf(TRACE,Decod,FUNCTION,"      * address dest : %.8x (%.8x)",_decod_instruction->_address_next,_decod_instruction->_address_next<<2);
     
    160168                    predict_val [i]     = ifetch_ack  [x][y] // and decod_val [i]
    161169                      ;
    162                     decod_val   [i]    &= PORT_READ(in_PREDICT_ACK [i]);// predict_ack and fetch_val and decod_enable               
    163                     ifetch_ack  [x][y] &= PORT_READ(in_PREDICT_ACK [i]);// predict_ack and fetch_val and decod_enable and decod_ack
    164 
     170                    decod_val   [i]    &= PORT_READ(in_PREDICT_ACK [i]);// predict_ack and fetch_val and decod_enable               
     171                    ifetch_ack  [x][y] &= PORT_READ(in_PREDICT_ACK [i]);// predict_ack and fetch_val and decod_enable and decod_ack
     172               
    165173                    if (_param->_have_port_context_id)
    166174                    PORT_WRITE(out_PREDICT_CONTEXT_ID                  [i],x);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/src/test.cpp

    r88 r101  
    102102  ALLOC1_SC_SIGNAL( in_DEPTH_MIN               ," in_DEPTH_MIN              ",Tdepth_t           ,_param->_nb_context);
    103103  ALLOC1_SC_SIGNAL( in_DEPTH_MAX               ," in_DEPTH_MAX              ",Tdepth_t           ,_param->_nb_context);
     104  ALLOC1_SC_SIGNAL( in_DEPTH_FULL              ," in_DEPTH_FULL             ",Tcontrol_t         ,_param->_nb_context);
    104105
    105106  ALLOC1_SC_SIGNAL(out_NB_INST_ALL             ,"out_NB_INST_ALL            ",Tcounter_t         ,_param->_nb_context);
     
    166167  INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_EXCEPTION     ,_param->_nb_inst_decod);
    167168
    168   for (uint32_t i=0; i<_param->_nb_context; ++i)
    169     if (_param->_have_port_depth)
    170       INSTANCE_SC_SIGNAL(_Decod_queue, in_DEPTH_MIN  [i]);
     169  if (_param->_have_port_depth)
     170    {
     171  INSTANCE1_SC_SIGNAL(_Decod_queue, in_DEPTH_MIN               ,_param->_nb_context);
    171172  INSTANCE1_SC_SIGNAL(_Decod_queue, in_DEPTH_MAX               ,_param->_nb_context);
    172  
     173    }
     174  INSTANCE1_SC_SIGNAL(_Decod_queue, in_DEPTH_FULL              ,_param->_nb_context);
    173175  INSTANCE1_SC_SIGNAL(_Decod_queue,out_NB_INST_ALL             ,_param->_nb_context);
    174176  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
     
    344346  DELETE1_SC_SIGNAL( in_DEPTH_MIN               ,_param->_nb_context);
    345347  DELETE1_SC_SIGNAL( in_DEPTH_MAX               ,_param->_nb_context);
     348  DELETE1_SC_SIGNAL( in_DEPTH_FULL              ,_param->_nb_context);
    346349
    347350  DELETE1_SC_SIGNAL(out_NB_INST_ALL             ,_param->_nb_context);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h

    r88 r101  
    119119  public    : SC_IN (Tdepth_t           )  **  in_DEPTH_MIN               ;//[nb_context]
    120120  public    : SC_IN (Tdepth_t           )  **  in_DEPTH_MAX               ;//[nb_context]
     121  public    : SC_IN (Tcontrol_t         )  **  in_DEPTH_FULL              ;//[nb_context]
    121122
    122123    // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue.cpp

    r88 r101  
    107107            {
    108108              if (_param->_have_port_depth)
     109                {
    109110              sensitive << (*(in_DEPTH_MIN [i]));
    110111              sensitive << (*(in_DEPTH_MAX [i]));
     112                }
     113              sensitive << (*(in_DEPTH_FULL[i]));
    111114            }
    112115
     
    119122              {
    120123                if (_param->_have_port_depth)
     124                  {
    121125                (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_MIN [j]));
    122126                (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_MAX [j]));
     127                  }
    123128              }
    124129          }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_allocation.cpp

    r95 r101  
    117117      ALLOC1_INTERFACE("depth",IN ,NORTH,"Depth", _param->_nb_context);
    118118
    119       ALLOC1_SIGNAL_IN ( in_DEPTH_MIN      ,"min"      ,Tdepth_t           ,_param->_size_depth  );
    120       ALLOC1_SIGNAL_IN ( in_DEPTH_MAX      ,"max"      ,Tdepth_t           ,_param->_size_depth+1);
     119      ALLOC1_SIGNAL_IN ( in_DEPTH_MIN      ,"min"      ,Tdepth_t           ,_param->_size_depth);
     120      ALLOC1_SIGNAL_IN ( in_DEPTH_MAX      ,"max"      ,Tdepth_t           ,_param->_size_depth);
     121      ALLOC1_SIGNAL_IN ( in_DEPTH_FULL     ,"full"     ,Tcontrol_t         ,1);
    121122    }
    122123
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_deallocation.cpp

    r88 r101  
    7777        DELETE1_SIGNAL(out_DECOD_OUT_EXCEPTION     ,_param->_nb_inst_decod,_param->_size_exception             );
    7878       
    79         DELETE1_SIGNAL( in_DEPTH_MIN               ,_param->_nb_context,_param->_size_depth  );
    80         DELETE1_SIGNAL( in_DEPTH_MAX               ,_param->_nb_context,_param->_size_depth+1);
     79        DELETE1_SIGNAL( in_DEPTH_MIN               ,_param->_nb_context,_param->_size_depth);
     80        DELETE1_SIGNAL( in_DEPTH_MAX               ,_param->_nb_context,_param->_size_depth);
     81        DELETE1_SIGNAL( in_DEPTH_FULL              ,_param->_nb_context,1);
    8182
    8283        DELETE1_SIGNAL(out_NB_INST_ALL             ,_param->_nb_context,_param->_size_nb_inst_decod);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_genMealy_decod_out.cpp

    r88 r101  
    4242            Tdepth_t   depth           = reg_QUEUE->front()->_depth         [i];
    4343            Tdepth_t   depth_min       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [context]):0;
    44             Tdepth_t   depth_max       = PORT_READ(in_DEPTH_MAX[context]);
     44            Tdepth_t   depth_max       = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX [context]):0;
     45            Tcontrol_t depth_full      = PORT_READ(in_DEPTH_FULL[context]);
    4546
    4647            // is a valid instruction ?
    4748            // If DEPTH_CURRENT :
    4849            // equal at     DEPTH_MIN            -> not speculative
    49             // not include ]DEPTH_MIN:DEPTH_MAX[ -> previous branch miss
    50             //     include ]DEPTH_MIN:DEPTH_MAX[ -> speculative
     50            // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss
     51            //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
    5152
    5253            // All case
     
    5859            // ....... max ...X... min ....... KO
    5960
    60             Tcontrol_t is_valid        = ((depth == depth_min) or
    61                                           ((depth_min < depth_max)?
    62                                            (depth<depth_max):
    63                                            ((depth > depth_min) or (depth < depth_max))));
     61            Tcontrol_t   is_valid      = ((depth == depth_min) or
     62                                          depth_full or
     63                                          ((depth_min <= depth_max)?
     64                                           ((depth >= depth_min) and (depth <=depth_max)):
     65                                           ((depth >= depth_min) or  (depth <=depth_max))));
     66//          Tcontrol_t is_valid        = ((depth == depth_min) or
     67//                                           ((depth_min < depth_max)?
     68//                                            (depth<=depth_max):
     69//                                            ((depth > depth_min) or (depth <= depth_max))));
    6470//          Tcontrol_t is_valid        = depth <= depth_max;
    6571
    66             log_printf(TRACE,Decod_queue,FUNCTION,_("    * is_valid : %d"),is_valid);
    67 
     72            log_printf(TRACE,Decod_queue,FUNCTION,"    * is_valid : %d",is_valid);
     73            log_printf(TRACE,Decod_queue,FUNCTION,"      * context   : %d",context);
     74            log_printf(TRACE,Decod_queue,FUNCTION,"      * depth     : %d",depth);
     75            log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_min : %d",depth_min);
     76            log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_max : %d",depth_max);
     77            log_printf(TRACE,Decod_queue,FUNCTION,"      * depth_full: %d",depth_full);
     78            log_printf(TRACE,Decod_queue,FUNCTION,"      * address   : 0x%x (0x%x)",reg_QUEUE->front()->_address[i],reg_QUEUE->front()->_address[i]<<2);
    6879            internal_DECOD_OUT_VAL [i] = 1; // in all case, val is set (entry is not empty, and instruction is valid)
    6980            if (is_valid)
     
    8192    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    8293      {
    83         log_printf(TRACE,Decod_queue,FUNCTION,_("  * DECOD_OUT_VAL : %d"),val [i]);
     94        log_printf(TRACE,Decod_queue,FUNCTION,"  * DECOD_OUT_VAL : %d",val [i]);
    8495
    8596        PORT_WRITE(out_DECOD_OUT_VAL [i],val [i]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_transition.cpp

    r88 r101  
    135135          {
    136136            if ((*it)->_val [i])
    137               log_printf(TRACE,Decod_queue,FUNCTION,"      * [%d] %d, %d %d, %d %d %d %d, 0x%x, %d 0x%x, %d %d, %d %d, %d %d, %d %d, %d %d, %d %d"
     137              log_printf(TRACE,Decod_queue,FUNCTION,"      * [%.4d] %.1d, %.3d %.2d, %.2d %.3d %.1d %.1d, 0x%.8x (0x%.8x), %.1d 0x%.8x, %.1d %.2d, %.1d %.2d, %.1d %.2d, %.1d %.2d, %.1d %.2d, %.1d %.2d"
    138138                         ,i
    139139                         ,(*it)->_val           [i]
     
    145145                         ,(*it)->_is_delay_slot [i]
    146146                         ,(*it)->_address       [i]
     147                         ,(*it)->_address       [i]<<2
    147148                         ,(*it)->_has_immediat  [i]
    148149                         ,(*it)->_immediat      [i]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/SelfTest/src/test.cpp

    r88 r101  
    104104  ALLOC1_SC_SIGNAL( in_DEPTH_MIN                          ," in_DEPTH_MIN                          ",Tdepth_t           ,_param->_nb_context);
    105105  ALLOC1_SC_SIGNAL( in_DEPTH_MAX                          ," in_DEPTH_MAX                          ",Tdepth_t           ,_param->_nb_context);
     106  ALLOC1_SC_SIGNAL( in_DEPTH_FULL                         ," in_DEPTH_FULL                         ",Tcontrol_t         ,_param->_nb_context);
    106107
    107108  ALLOC1_SC_SIGNAL(out_NB_INST_DECOD_ALL                  ,"out_NB_INST_DECOD_ALL                  ",Tcounter_t         ,_param->_nb_context);
    108109
    109110  ALLOC1_SC_SIGNAL( in_CONTEXT_DECOD_ENABLE               ," in_CONTEXT_DECOD_ENABLE               ",Tcontrol_t         ,_param->_nb_context);
     111  ALLOC1_SC_SIGNAL( in_CONTEXT_DEPTH_VAL                  ," in_CONTEXT_DEPTH_VAL                  ",Tcontrol_t         ,_param->_nb_context);
    110112  ALLOC1_SC_SIGNAL( in_CONTEXT_DEPTH                      ," in_CONTEXT_DEPTH                      ",Tdepth_t           ,_param->_nb_context);
    111113
     
    188190//INSTANCE1_SC_SIGNAL(_Decod_unit, in_PREDICT_CAN_CONTINUE               ,_param->_nb_inst_decod);
    189191
     192  if (_param->_have_port_depth)
     193    {
     194  INSTANCE1_SC_SIGNAL(_Decod_unit, in_DEPTH_MIN                          ,_param->_nb_context);
    190195  INSTANCE1_SC_SIGNAL(_Decod_unit, in_DEPTH_MAX                          ,_param->_nb_context);
    191 
     196    }
     197  INSTANCE1_SC_SIGNAL(_Decod_unit, in_DEPTH_FULL                         ,_param->_nb_context);
    192198  INSTANCE1_SC_SIGNAL(_Decod_unit,out_NB_INST_DECOD_ALL                  ,_param->_nb_context);
    193199
    194200  INSTANCE1_SC_SIGNAL(_Decod_unit, in_CONTEXT_DECOD_ENABLE               ,_param->_nb_context);
    195201
    196   for (uint32_t i=0; i<_param->_nb_context; ++i)
    197     if (_param->_have_port_depth)
    198       {
    199         INSTANCE_SC_SIGNAL(_Decod_unit, in_DEPTH_MIN     [i]);
    200         INSTANCE_SC_SIGNAL(_Decod_unit, in_CONTEXT_DEPTH [i]);
    201       }
     202  INSTANCE1_SC_SIGNAL(_Decod_unit, in_CONTEXT_DEPTH_VAL                  ,_param->_nb_context);
     203  if (_param->_have_port_depth)
     204  INSTANCE1_SC_SIGNAL(_Decod_unit, in_CONTEXT_DEPTH                      ,_param->_nb_context);
    202205
    203206  INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_VAL                  );
     
    239242  SC_START(5);
    240243  in_NRESET->write(1); 
     244
     245  for (uint32_t i=0; i<_param->_nb_context; i++)
     246    in_CONTEXT_DEPTH_VAL [i]->write(1);
    241247
    242248  LABEL("Loop of Test");
     
    515521  DELETE1_SC_SIGNAL( in_DEPTH_MIN                          ,_param->_nb_context);
    516522  DELETE1_SC_SIGNAL( in_DEPTH_MAX                          ,_param->_nb_context);
     523  DELETE1_SC_SIGNAL( in_DEPTH_FULL                         ,_param->_nb_context);
    517524
    518525  DELETE1_SC_SIGNAL(out_NB_INST_DECOD_ALL                  ,_param->_nb_context);
    519526
    520527  DELETE1_SC_SIGNAL( in_CONTEXT_DECOD_ENABLE               ,_param->_nb_context);
     528  DELETE1_SC_SIGNAL( in_CONTEXT_DEPTH_VAL                  ,_param->_nb_context);
    521529  DELETE1_SC_SIGNAL( in_CONTEXT_DEPTH                      ,_param->_nb_context);
    522530
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/include/Decod_unit.h

    r88 r101  
    120120  public    : SC_IN (Tdepth_t           )  **  in_DEPTH_MIN                          ;//[nb_context]
    121121  public    : SC_IN (Tdepth_t           )  **  in_DEPTH_MAX                          ;//[nb_context]
     122  public    : SC_IN (Tcontrol_t         )  **  in_DEPTH_FULL                         ;//[nb_context]
    122123
    123124    // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    126127    // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    127128  public    : SC_IN (Tcontrol_t         )  **  in_CONTEXT_DECOD_ENABLE               ;//[nb_context]
     129  public    : SC_IN (Tcontrol_t         )  **  in_CONTEXT_DEPTH_VAL                  ;//[nb_context]
    128130  public    : SC_IN (Tdepth_t           )  **  in_CONTEXT_DEPTH                      ;//[nb_context]
    129131                                                                                     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Decod_unit_allocation.cpp

    r88 r101  
    128128      ALLOC1_INTERFACE("depth",IN ,NORTH,"Depth", _param->_nb_context);
    129129
    130       ALLOC1_SIGNAL_IN ( in_DEPTH_MIN      ,"min"      ,Tdepth_t           ,_param->_size_depth  );
    131       ALLOC1_SIGNAL_IN ( in_DEPTH_MAX      ,"max"      ,Tdepth_t           ,_param->_size_depth+1);
     130      ALLOC1_SIGNAL_IN ( in_DEPTH_MIN      ,"min"      ,Tdepth_t           ,_param->_size_depth);
     131      ALLOC1_SIGNAL_IN ( in_DEPTH_MAX      ,"max"      ,Tdepth_t           ,_param->_size_depth);
     132      ALLOC1_SIGNAL_IN ( in_DEPTH_FULL     ,"full"     ,Tcontrol_t         ,1);
    132133    }
    133134
     
    144145
    145146      ALLOC1_SIGNAL_IN (in_CONTEXT_DECOD_ENABLE,"decod_enable",Tcontrol_t,1);
     147      ALLOC1_SIGNAL_IN (in_CONTEXT_DEPTH_VAL   ,"depth_val"   ,Tcontrol_t,1);
    146148      ALLOC1_SIGNAL_IN (in_CONTEXT_DEPTH       ,"depth"       ,Tdepth_t  ,_param->_size_depth);
    147149    }
     
    365367
    366368#ifdef POSITION
    367           _component->interface_map (src ,"context"+toString(i),
    368                                      dest,"context"+toString(i));
     369          _component->interface_map (src ,"context_"+toString(i),
     370                                     dest,"context_"+toString(i));
    369371#endif
    370372         
    371373          PORT_MAP(_component,src , "in_CONTEXT_"+toString(i)+"_DECOD_ENABLE",
    372374                              dest, "in_CONTEXT_"+toString(i)+"_DECOD_ENABLE");
     375          PORT_MAP(_component,src , "in_CONTEXT_"+toString(i)+"_DEPTH_VAL"   ,
     376                              dest, "in_CONTEXT_"+toString(i)+"_DEPTH_VAL"   );
    373377          if (_param->_have_port_depth)
    374378          PORT_MAP(_component,src , "in_CONTEXT_"+toString(i)+"_DEPTH"       ,
     
    516520
    517521          if (_param->_have_port_depth)
     522            {
    518523          PORT_MAP(_component,src , "in_DEPTH_"+toString(i)+"_MIN",
    519524                              dest, "in_DEPTH_"+toString(i)+"_MIN");
    520525          PORT_MAP(_component,src , "in_DEPTH_"+toString(i)+"_MAX",
    521526                              dest, "in_DEPTH_"+toString(i)+"_MAX");
     527            }
     528          PORT_MAP(_component,src , "in_DEPTH_"+toString(i)+"_FULL",
     529                              dest, "in_DEPTH_"+toString(i)+"_FULL");
    522530        }
    523531
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Decod_unit_deallocation.cpp

    r88 r101  
    7777//      DELETE1_SIGNAL( in_PREDICT_CAN_CONTINUE               ,_param->_nb_inst_decod,1                             );
    7878       
    79         DELETE1_SIGNAL( in_DEPTH_MIN                          ,_param->_nb_context,_param->_size_depth  );
    80         DELETE1_SIGNAL( in_DEPTH_MAX                          ,_param->_nb_context,_param->_size_depth+1);
     79        DELETE1_SIGNAL( in_DEPTH_MIN                          ,_param->_nb_context,_param->_size_depth);
     80        DELETE1_SIGNAL( in_DEPTH_MAX                          ,_param->_nb_context,_param->_size_depth);
     81        DELETE1_SIGNAL( in_DEPTH_FULL                         ,_param->_nb_context,1);
    8182       
    8283        DELETE1_SIGNAL(out_NB_INST_DECOD_ALL                  ,_param->_nb_context,_param->_size_nb_inst_decod);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/SelfTest/src/test.cpp

    r97 r101  
    9191  ALLOC1_SC_SIGNAL(out_DEPTH_MIN                                      ,"out_DEPTH_MIN                                      ",Tdepth_t  ,_param->_nb_context);
    9292  ALLOC1_SC_SIGNAL(out_DEPTH_MAX                                      ,"out_DEPTH_MAX                                      ",Tdepth_t  ,_param->_nb_context);
     93  ALLOC1_SC_SIGNAL(out_DEPTH_FULL                                     ,"out_DEPTH_FULL                                     ",Tcontrol_t,_param->_nb_context);
     94  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_VAL                      ," in_DEPTH_PREDICTION_UNIT_VAL                      ",Tcontrol_t,_param->_nb_context);
    9395  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_CURRENT                  ," in_DEPTH_PREDICTION_UNIT_CURRENT                  ",Tdepth_t  ,_param->_nb_context);
    9496  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MIN                      ," in_DEPTH_PREDICTION_UNIT_MIN                      ",Tdepth_t  ,_param->_nb_context);
    9597  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MAX                      ," in_DEPTH_PREDICTION_UNIT_MAX                      ",Tdepth_t  ,_param->_nb_context);
     98  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_FULL                     ," in_DEPTH_PREDICTION_UNIT_FULL                     ",Tcontrol_t,_param->_nb_context);
    9699  ALLOC1_SC_SIGNAL(out_DEPTH_CONTEXT_STATE_MIN                        ,"out_DEPTH_CONTEXT_STATE_MIN                        ",Tdepth_t  ,_param->_nb_context);
    97100  ALLOC2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MIN                           ,"out_DEPTH_DECOD_UNIT_MIN                           ",Tdepth_t  ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    98101  ALLOC2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MAX                           ,"out_DEPTH_DECOD_UNIT_MAX                           ",Tdepth_t  ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    99 
     102  ALLOC2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_FULL                          ,"out_DEPTH_DECOD_UNIT_FULL                          ",Tcontrol_t,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
     103
     104  ALLOC2_SC_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH_VAL                   ,"out_CONTEXT_DECOD_UNIT_DEPTH_VAL                   ",Tcontrol_t,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    100105  ALLOC2_SC_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH                       ,"out_CONTEXT_DECOD_UNIT_DEPTH                       ",Tdepth_t  ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    101106 
     
    153158  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_DEPTH                        ,_param->_nb_context);
    154159
    155   for (uint32_t i=0; i<_param->_nb_context; ++i)
    156     if (_param->_have_port_depth)
    157       {
    158         INSTANCE_SC_SIGNAL(_Front_end_Glue,out_DEPTH_MIN                     [i]);
    159         INSTANCE_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_CURRENT [i]);
    160         INSTANCE_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_MIN     [i]);
    161         INSTANCE_SC_SIGNAL(_Front_end_Glue,out_DEPTH_CONTEXT_STATE_MIN       [i]);
    162       }
     160  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_VAL                        ,_param->_nb_context);
     161  if (_param->_have_port_depth)
     162    {
     163  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_MIN                                        ,_param->_nb_context);
     164  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_CURRENT                    ,_param->_nb_context);
     165  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_MIN                        ,_param->_nb_context);
     166  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_CONTEXT_STATE_MIN                          ,_param->_nb_context);
    163167  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_MAX                                        ,_param->_nb_context);
    164168  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_MAX                        ,_param->_nb_context);
    165169  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_DEPTH_DECOD_UNIT_MAX                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    166 
     170    }
     171  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_FULL                                       ,_param->_nb_context);
     172  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_FULL                       ,_param->_nb_context);
     173  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_DEPTH_DECOD_UNIT_FULL                            ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
     174
     175  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_CONTEXT_DECOD_UNIT_DEPTH_VAL                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    167176  for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
    168177    for (uint32_t j=0; j<_param->_decod_unit_nb_context [i]; ++j)
     
    259268  DELETE1_SC_SIGNAL(out_DEPTH_MIN                                        ,_param->_nb_context);
    260269  DELETE1_SC_SIGNAL(out_DEPTH_MAX                                        ,_param->_nb_context);
     270  DELETE1_SC_SIGNAL(out_DEPTH_FULL                                       ,_param->_nb_context);
     271  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_VAL                        ,_param->_nb_context);
    261272  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_CURRENT                    ,_param->_nb_context);
    262273  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MIN                        ,_param->_nb_context);
    263274  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MAX                        ,_param->_nb_context);
     275  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_FULL                       ,_param->_nb_context);
    264276  DELETE1_SC_SIGNAL(out_DEPTH_CONTEXT_STATE_MIN                          ,_param->_nb_context);
    265277
     278  DELETE2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MIN                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    266279  DELETE2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MAX                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    267   DELETE2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MIN                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    268 
     280  DELETE2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_FULL                            ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
     281
     282  DELETE2_SC_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH_VAL                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    269283  DELETE2_SC_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH                         ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    270284    }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/include/Front_end_Glue.h

    r97 r101  
    115115  public    : SC_OUT(Tdepth_t             )  ** out_DEPTH_MIN                                         ;//[nb_context]
    116116  public    : SC_OUT(Tdepth_t             )  ** out_DEPTH_MAX                                         ;//[nb_context]
    117                                            
     117  public    : SC_OUT(Tcontrol_t           )  ** out_DEPTH_FULL                                        ;//[nb_context]
     118                                           
     119  public    : SC_IN (Tcontrol_t           )  **  in_DEPTH_PREDICTION_UNIT_VAL                         ;//[nb_context]
    118120  public    : SC_IN (Tdepth_t             )  **  in_DEPTH_PREDICTION_UNIT_CURRENT                     ;//[nb_context]
    119121  public    : SC_IN (Tdepth_t             )  **  in_DEPTH_PREDICTION_UNIT_MIN                         ;//[nb_context]
    120122  public    : SC_IN (Tdepth_t             )  **  in_DEPTH_PREDICTION_UNIT_MAX                         ;//[nb_context]
     123  public    : SC_IN (Tcontrol_t           )  **  in_DEPTH_PREDICTION_UNIT_FULL                        ;//[nb_context]
    121124                                           
    122125//public    : SC_OUT(Tdepth_t             ) *** out_DEPTH_DECOD_UNIT_CURRENT                          ;//[nb_decod_unit][nb_decod_unit_context]
    123126  public    : SC_OUT(Tdepth_t             ) *** out_DEPTH_DECOD_UNIT_MIN                              ;//[nb_decod_unit][nb_decod_unit_context]
    124127  public    : SC_OUT(Tdepth_t             ) *** out_DEPTH_DECOD_UNIT_MAX                              ;//[nb_decod_unit][nb_decod_unit_context]
     128  public    : SC_OUT(Tcontrol_t           ) *** out_DEPTH_DECOD_UNIT_FULL                             ;//[nb_decod_unit][nb_decod_unit_context]
    125129                                           
    126130  public    : SC_OUT(Tdepth_t             )  ** out_DEPTH_CONTEXT_STATE_MIN                           ;//[nb_context]
    127131
    128132    // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     133  public    : SC_OUT(Tcontrol_t           ) *** out_CONTEXT_DECOD_UNIT_DEPTH_VAL                      ;//[nb_decod_unit][nb_decod_unit_context]
    129134  public    : SC_OUT(Tdepth_t             ) *** out_CONTEXT_DECOD_UNIT_DEPTH                          ;//[nb_decod_unit][nb_decod_unit_context]
    130135
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/src/Front_end_Glue.cpp

    r97 r101  
    165165            if (_param->_have_port_depth)
    166166            sensitive << (*( in_DEPTH_PREDICTION_UNIT_CURRENT [i]))
    167                       << (*( in_DEPTH_PREDICTION_UNIT_MIN     [i]));
    168 
    169             sensitive << (*( in_DEPTH_PREDICTION_UNIT_MAX     [i]));
     167                      << (*( in_DEPTH_PREDICTION_UNIT_MIN     [i]))
     168                      << (*( in_DEPTH_PREDICTION_UNIT_MAX     [i]));
     169
     170            sensitive << (*( in_DEPTH_PREDICTION_UNIT_VAL     [i]))
     171                      << (*( in_DEPTH_PREDICTION_UNIT_FULL    [i]));
    170172          }
    171173
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/src/Front_end_Glue_allocation.cpp

    r97 r101  
    128128//    ALLOC1_SIGNAL_OUT (out_DEPTH_CURRENT                                     ,"CURRENT"                       ,Tdepth_t             ,_param->_size_depth  );
    129129      ALLOC1_SIGNAL_OUT (out_DEPTH_MIN                                         ,"MIN"                           ,Tdepth_t             ,_param->_size_depth  );
    130       ALLOC1_SIGNAL_OUT (out_DEPTH_MAX                                         ,"MAX"                           ,Tdepth_t             ,_param->_size_depth+1);
     130      ALLOC1_SIGNAL_OUT (out_DEPTH_MAX                                         ,"MAX"                           ,Tdepth_t             ,_param->_size_depth  );
     131      ALLOC1_SIGNAL_OUT (out_DEPTH_FULL                                        ,"FULL"                          ,Tcontrol_t           ,1);
    131132                                                                                                               
     133      ALLOC1_SIGNAL_IN  ( in_DEPTH_PREDICTION_UNIT_VAL                         ,"PREDICTION_UNIT_VAL"           ,Tcontrol_t           ,1);
    132134      ALLOC1_SIGNAL_IN  ( in_DEPTH_PREDICTION_UNIT_CURRENT                     ,"PREDICTION_UNIT_CURRENT"       ,Tdepth_t             ,_param->_size_depth  );
    133135      ALLOC1_SIGNAL_IN  ( in_DEPTH_PREDICTION_UNIT_MIN                         ,"PREDICTION_UNIT_MIN"           ,Tdepth_t             ,_param->_size_depth  );
    134       ALLOC1_SIGNAL_IN  ( in_DEPTH_PREDICTION_UNIT_MAX                         ,"PREDICTION_UNIT_MAX"           ,Tdepth_t             ,_param->_size_depth+1);
     136      ALLOC1_SIGNAL_IN  ( in_DEPTH_PREDICTION_UNIT_MAX                         ,"PREDICTION_UNIT_MAX"           ,Tdepth_t             ,_param->_size_depth  );
     137      ALLOC1_SIGNAL_IN  ( in_DEPTH_PREDICTION_UNIT_FULL                        ,"PREDICTION_UNIT_FULL"          ,Tcontrol_t           ,1);
    135138                                                                                                               
    136139      ALLOC1_SIGNAL_OUT (out_DEPTH_CONTEXT_STATE_MIN                           ,"CONTEXT_STATE_MIN"             ,Tdepth_t             ,_param->_size_depth  );
     
    141144//    _ALLOC2_SIGNAL_OUT(out_DEPTH_DECOD_UNIT_CURRENT                          ,"DECOD_UNIT_CURRENT"            ,Tdepth_t             ,_param->_size_depth  ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    142145      _ALLOC2_SIGNAL_OUT(out_DEPTH_DECOD_UNIT_MIN                              ,"DECOD_UNIT_MIN"                ,Tdepth_t             ,_param->_size_depth  ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    143       _ALLOC2_SIGNAL_OUT(out_DEPTH_DECOD_UNIT_MAX                              ,"DECOD_UNIT_MAX"                ,Tdepth_t             ,_param->_size_depth+1,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
     146      _ALLOC2_SIGNAL_OUT(out_DEPTH_DECOD_UNIT_MAX                              ,"DECOD_UNIT_MAX"                ,Tdepth_t             ,_param->_size_depth  ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
     147      _ALLOC2_SIGNAL_OUT(out_DEPTH_DECOD_UNIT_FULL                             ,"DECOD_UNIT_FULL"               ,Tcontrol_t           ,1                    ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    144148    }
    145149
     
    148152      ALLOC2_INTERFACE("context",OUT,EAST,_("context"),_param->_nb_decod_unit,_param->_translate_context_id_from_decod_unit[it1].size());
    149153     
     154      _ALLOC2_SIGNAL_OUT(out_CONTEXT_DECOD_UNIT_DEPTH_VAL                      ,"DECOD_UNIT_DEPTH_VAL"          ,Tcontrol_t           ,1                    ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    150155      _ALLOC2_SIGNAL_OUT(out_CONTEXT_DECOD_UNIT_DEPTH                          ,"DECOD_UNIT_DEPTH"              ,Tdepth_t             ,_param->_size_depth  ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
    151156    }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/src/Front_end_Glue_deallocation.cpp

    r97 r101  
    7070        DELETE1_SIGNAL( in_EVENT_CONTEXT_STATE_DEPTH                        ,_param->_nb_context,_param->_size_depth);
    7171       
    72         DELETE1_SIGNAL(out_DEPTH_MIN                                        ,_param->_nb_context,_param->_size_depth  );
    73         DELETE1_SIGNAL(out_DEPTH_MAX                                        ,_param->_nb_context,_param->_size_depth+1);
    74         DELETE1_SIGNAL( in_DEPTH_PREDICTION_UNIT_CURRENT                    ,_param->_nb_context,_param->_size_depth  );
    75         DELETE1_SIGNAL( in_DEPTH_PREDICTION_UNIT_MIN                        ,_param->_nb_context,_param->_size_depth  );
    76         DELETE1_SIGNAL( in_DEPTH_PREDICTION_UNIT_MAX                        ,_param->_nb_context,_param->_size_depth+1);
    77         DELETE1_SIGNAL(out_DEPTH_CONTEXT_STATE_MIN                          ,_param->_nb_context,_param->_size_depth  );
     72        DELETE1_SIGNAL(out_DEPTH_MIN                                        ,_param->_nb_context,_param->_size_depth);
     73        DELETE1_SIGNAL(out_DEPTH_MAX                                        ,_param->_nb_context,_param->_size_depth);
     74        DELETE1_SIGNAL(out_DEPTH_FULL                                       ,_param->_nb_context,1);
     75        DELETE1_SIGNAL( in_DEPTH_PREDICTION_UNIT_VAL                        ,_param->_nb_context,1);
     76        DELETE1_SIGNAL( in_DEPTH_PREDICTION_UNIT_CURRENT                    ,_param->_nb_context,_param->_size_depth);
     77        DELETE1_SIGNAL( in_DEPTH_PREDICTION_UNIT_MIN                        ,_param->_nb_context,_param->_size_depth);
     78        DELETE1_SIGNAL( in_DEPTH_PREDICTION_UNIT_MAX                        ,_param->_nb_context,_param->_size_depth);
     79        DELETE1_SIGNAL( in_DEPTH_PREDICTION_UNIT_FULL                       ,_param->_nb_context,1);
     80        DELETE1_SIGNAL(out_DEPTH_CONTEXT_STATE_MIN                          ,_param->_nb_context,_param->_size_depth);
    7881       
    79 //      DELETE2_SIGNAL(out_DEPTH_DECOD_UNIT_CURRENT                         ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1],_param->_size_depth  );
    80         DELETE2_SIGNAL(out_DEPTH_DECOD_UNIT_MIN                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1],_param->_size_depth  );
    81         DELETE2_SIGNAL(out_DEPTH_DECOD_UNIT_MAX                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1],_param->_size_depth+1);
     82//      DELETE2_SIGNAL(out_DEPTH_DECOD_UNIT_CURRENT                         ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1],_param->_size_depth);
     83        DELETE2_SIGNAL(out_DEPTH_DECOD_UNIT_MIN                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1],_param->_size_depth);
     84        DELETE2_SIGNAL(out_DEPTH_DECOD_UNIT_MAX                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1],_param->_size_depth);
     85        DELETE2_SIGNAL(out_DEPTH_DECOD_UNIT_FULL                            ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1],1);
    8286       
     87        DELETE2_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH_VAL                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1],1);
    8388        DELETE2_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH                         ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1],_param->_size_depth);
    8489      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/src/Front_end_Glue_genMealy_depth.cpp

    r88 r101  
    2626        if (_param->_have_port_depth)
    2727          {
    28             Tdepth_t min = PORT_READ(in_DEPTH_PREDICTION_UNIT_MIN [i]);
    29             PORT_WRITE(out_DEPTH_CONTEXT_STATE_MIN [i],min);
    30             PORT_WRITE(out_DEPTH_MIN               [i],min);
     28        Tdepth_t min = PORT_READ(in_DEPTH_PREDICTION_UNIT_MIN [i]);
     29        PORT_WRITE(out_DEPTH_CONTEXT_STATE_MIN [i],min);
     30        PORT_WRITE(out_DEPTH_MIN               [i],min);
     31        PORT_WRITE(out_DEPTH_MAX               [i], PORT_READ(in_DEPTH_PREDICTION_UNIT_MAX [i]));
    3132          }
    32 
    33         PORT_WRITE(out_DEPTH_MAX [i], PORT_READ(in_DEPTH_PREDICTION_UNIT_MAX [i]));
     33        PORT_WRITE(out_DEPTH_FULL              [i], PORT_READ(in_DEPTH_PREDICTION_UNIT_FULL [i]));
    3434      }
    3535
     
    3939          uint32_t num_context = _param->_translate_context_id_from_decod_unit[i][j];
    4040         
     41          PORT_WRITE(out_CONTEXT_DECOD_UNIT_DEPTH_VAL [i][j], PORT_READ(in_DEPTH_PREDICTION_UNIT_VAL     [num_context]));
    4142          if (_param->_have_port_depth)
    4243            {
    43           PORT_WRITE(out_CONTEXT_DECOD_UNIT_DEPTH  [i][j], PORT_READ(in_DEPTH_PREDICTION_UNIT_CURRENT [num_context]));
    44           PORT_WRITE(out_DEPTH_DECOD_UNIT_MIN      [i][j], PORT_READ(in_DEPTH_PREDICTION_UNIT_MIN     [num_context]));
     44          PORT_WRITE(out_CONTEXT_DECOD_UNIT_DEPTH     [i][j], PORT_READ(in_DEPTH_PREDICTION_UNIT_CURRENT [num_context]));
     45          PORT_WRITE(out_DEPTH_DECOD_UNIT_MIN         [i][j], PORT_READ(in_DEPTH_PREDICTION_UNIT_MIN     [num_context]));
     46          PORT_WRITE(out_DEPTH_DECOD_UNIT_MAX         [i][j], PORT_READ(in_DEPTH_PREDICTION_UNIT_MAX     [num_context]));
    4547            }
    46           PORT_WRITE(out_DEPTH_DECOD_UNIT_MAX      [i][j], PORT_READ(in_DEPTH_PREDICTION_UNIT_MAX     [num_context]));
     48          PORT_WRITE(out_DEPTH_DECOD_UNIT_FULL        [i][j], PORT_READ(in_DEPTH_PREDICTION_UNIT_FULL    [num_context]));
    4749        }
    4850
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/SelfTest/src/test.cpp

    r88 r101  
    6767  ALLOC1_SC_SIGNAL( in_PREDICT_INSTRUCTION_ENABLE         ," in_PREDICT_INSTRUCTION_ENABLE         ",Tcontrol_t        ,_param->_nb_instruction);
    6868  ALLOC_SC_SIGNAL ( in_PREDICT_INST_IFETCH_PTR            ," in_PREDICT_INST_IFETCH_PTR            ",Tinst_ifetch_ptr_t);
     69//ALLOC_SC_SIGNAL ( in_PREDICT_BRANCH_IS_CURRENT          ," in_PREDICT_BRANCH_IS_CURRENT          ",Tcontrol_t        );
    6970  ALLOC_SC_SIGNAL ( in_PREDICT_BRANCH_STATE               ," in_PREDICT_BRANCH_STATE               ",Tbranch_state_t   );
    7071  ALLOC_SC_SIGNAL ( in_PREDICT_BRANCH_UPDATE_PREDICTION_ID," in_PREDICT_BRANCH_UPDATE_PREDICTION_ID",Tprediction_ptr_t );
     
    104105  if (_param->_have_port_inst_ifetch_ptr)
    105106  INSTANCE_SC_SIGNAL (_Address_management, in_PREDICT_INST_IFETCH_PTR            );
     107//INSTANCE_SC_SIGNAL (_Address_management, in_PREDICT_BRANCH_IS_CURRENT          );
    106108  INSTANCE_SC_SIGNAL (_Address_management, in_PREDICT_BRANCH_STATE               );
    107109  if (_param->_have_port_depth)
     
    129131  srand(seed);
    130132
    131   const  int32_t percent_transaction_address = 75;
    132   const  int32_t percent_transaction_predict = 75;
    133   const  int32_t percent_transaction_event   =  5;
     133  const  int32_t percent_transaction_address = 100;
     134  const  int32_t percent_transaction_predict = 100;
     135  const  int32_t percent_transaction_event   =  0;
    134136
    135137  SC_START(0);
     
    155157  uint32_t        nb_packet = 1;
    156158
     159  Tcontrol_t      a_val   = false;
    157160  Tcontrol_t      c_val   = false;
    158   Tcontrol_t      n_val   = false;
     161  Tcontrol_t      n_val   = true ;
    159162  Tcontrol_t      nn_val  = false;
    160163
     164  Tgeneral_data_t a_addr  = 0x100>>2;
    161165  Tgeneral_data_t c_addr  = 0x100>>2;
    162166  Tgeneral_data_t n_addr  = 0x100>>2;
    163167  Tgeneral_data_t nn_addr = 0x100>>2;
    164168
     169  Tcontrol_t      a_enable [_param->_nb_instruction];
    165170  Tcontrol_t      c_enable [_param->_nb_instruction];
    166171  Tcontrol_t      n_enable [_param->_nb_instruction];
    167172
     173  Tcontrol_t      a_is_ds_take   = 0;
    168174  Tcontrol_t      c_is_ds_take   = 0;
    169175  Tcontrol_t      n_is_ds_take   = 0;           
    170176  Tcontrol_t      nn_is_ds_take  = 0;
    171177
    172   c_enable [0] = 1;
     178  n_enable [0] = 1;
    173179  for (uint32_t i=1; i<_param->_nb_instruction; i++)
    174     c_enable [i] = 0;
     180    n_enable [i] = 0;
    175181
    176182  LABEL("Send Reset");
     
    216222        in_PREDICT_PC_NEXT_IS_DS_TAKE         ->write(take);
    217223        in_PREDICT_INST_IFETCH_PTR            ->write(0);
     224//      in_PREDICT_BRANCH_IS_CURRENT          ->write(0);
    218225        in_PREDICT_BRANCH_STATE               ->write(0);
    219226        in_PREDICT_BRANCH_UPDATE_PREDICTION_ID->write(0);
     
    251258          for (uint32_t i=0; i<_param->_nb_instruction; i++)
    252259          n_enable [i]  = in_PREDICT_INSTRUCTION_ENABLE [i]->read();
     260
     261          LABEL("  * nn_addr          : %.8x",nn_addr);
    253262        }
    254263 
     
    256265        {
    257266          LABEL("ADDRESS    : Transaction accepted");
    258           LABEL("  * address wait     : %.8x",c_addr);
    259 
    260           TEST(Tgeneral_address_t,out_ADDRESS_INSTRUCTION_ADDRESS        ->read(),c_addr);
     267          LABEL("  * address wait     : %.8x",a_addr);
     268
     269          TEST(Tgeneral_address_t,out_ADDRESS_INSTRUCTION_ADDRESS        ->read(),a_addr);
    261270          for (uint32_t i=0; i<_param->_nb_instruction; i++)
    262           TEST(Tcontrol_t        ,out_ADDRESS_INSTRUCTION_ENABLE     [i] ->read(),c_enable[i]);
     271          TEST(Tcontrol_t        ,out_ADDRESS_INSTRUCTION_ENABLE     [i] ->read(),a_enable[i]);
    263272          if (_param->_have_port_inst_ifetch_ptr)
    264273          TEST(Tinst_ifetch_ptr_t,out_ADDRESS_INST_IFETCH_PTR            ->read(),0);
     
    267276          TEST(Tprediction_ptr_t ,out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID->read(),0);
    268277
    269           c_val = 0;
     278          a_val = 0;
    270279          nb_packet ++;
    271280        }
    272281
     282      {
     283        string str_a_enable = "";
     284        string str_c_enable = "";
     285        string str_n_enable = "";
     286
     287        for (uint32_t i=0; i<_param->_nb_instruction; i++)
     288          {
     289            str_a_enable += " " + toString(a_enable [i]);
     290            str_c_enable += " " + toString(c_enable [i]);
     291            str_n_enable += " " + toString(n_enable [i]);
     292          }
     293
     294        LABEL("----[ Before ]---------------------");
     295        LABEL("  * nb_packet : %d",nb_packet);
     296        LABEL("  * pc a : %d %d %.8x %s",a_val ,a_is_ds_take ,a_addr ,str_a_enable.c_str());
     297        LABEL("  * pc   : %d %d %.8x %s",c_val ,c_is_ds_take ,c_addr ,str_c_enable.c_str());
     298        LABEL("  * pc+4 : %d %d %.8x %s",n_val ,n_is_ds_take ,n_addr ,str_n_enable.c_str());
     299        LABEL("  * pc+8 : %d %d %.8x"   ,nn_val,nn_is_ds_take,nn_addr);
     300        LABEL("-----------------------------------");
     301      }
     302
     303      if (not a_val)
     304        {
     305          if (c_val and n_val and nn_val)
     306            {
     307              a_val        = 1;
     308              c_val        = 0;
     309              a_addr       = c_addr;
     310              a_is_ds_take = c_is_ds_take;
     311
     312              for (uint32_t i=0; i<_param->_nb_instruction; i++)
     313                a_enable [i] = c_enable [i];
     314            }
     315        }
    273316
    274317      if (not c_val)
    275         {
    276           if (n_val and nn_val)
    277             {
    278               c_val        = 1;
    279               c_addr       = n_addr;
    280               c_is_ds_take = n_is_ds_take;
    281 
    282               for (uint32_t i=0; i<_param->_nb_instruction; i++)
    283                 c_enable [i] = n_enable [i];
    284              
    285               n_val        = 1;
    286               n_addr       = nn_addr;
    287               n_is_ds_take = nn_is_ds_take;
    288              
    289               nn_val       = 0;
    290             }
    291         }
     318        {
     319          c_val        = n_val;
     320          if (n_val)
     321            {
     322              c_addr       = n_addr;
     323              c_is_ds_take = n_is_ds_take;
     324             
     325              for (uint32_t i=0; i<_param->_nb_instruction; i++)
     326                c_enable [i] = n_enable [i];
     327            }
     328          n_val        = 0;
     329        }
     330
     331      if (not n_val)
     332        {
     333          n_val        = nn_val;
     334          if (nn_val)
     335            {
     336              n_addr       = nn_addr;
     337              n_is_ds_take = nn_is_ds_take;
     338             
     339//            for (uint32_t i=0; i<_param->_nb_instruction; i++)
     340//              n_enable [i] = nn_enable [i];
     341            }
     342          nn_val       = 0;
     343        }
    292344
    293345      if (in_EVENT_VAL->read() and out_EVENT_ACK->read())
     
    295347          LABEL("EVENT      : Transaction accepted");
    296348
     349          a_val        = false;
    297350          c_val        = false;
    298351          n_val        = true;
     
    312365     
    313366      {
     367        string str_a_enable = "";
    314368        string str_c_enable = "";
    315369        string str_n_enable = "";
     
    317371        for (uint32_t i=0; i<_param->_nb_instruction; i++)
    318372          {
     373            str_a_enable += " " + toString(a_enable [i]);
    319374            str_c_enable += " " + toString(c_enable [i]);
    320375            str_n_enable += " " + toString(n_enable [i]);
    321376          }
    322377
    323         LABEL("-----------------------------------");
     378        LABEL("----[ After ]----------------------");
    324379        LABEL("  * nb_packet : %d",nb_packet);
    325         LABEL("  * pc   : %d %d %.8x %s",c_val  ,c_is_ds_take , c_addr ,str_c_enable.c_str());
    326         if (nn_val)
    327           {
    328         LABEL("  * pc+4 : %d %d %.8x %s",n_val  ,n_is_ds_take , n_addr ,str_n_enable.c_str());
    329           }
    330         else
    331           {
    332         LABEL("  * pc+4 : %d %d %.8x"   ,n_val  ,n_is_ds_take , n_addr );
    333           }
    334         LABEL("  * pc+8 : %d %d %.8x"   ,nn_val ,nn_is_ds_take, nn_addr);
     380        LABEL("  * pc a : %d %d %.8x %s",a_val ,a_is_ds_take ,a_addr ,str_a_enable.c_str());
     381        LABEL("  * pc   : %d %d %.8x %s",c_val ,c_is_ds_take ,c_addr ,str_c_enable.c_str());
     382        LABEL("  * pc+4 : %d %d %.8x %s",n_val ,n_is_ds_take ,n_addr ,str_n_enable.c_str());
     383        LABEL("  * pc+8 : %d %d %.8x"   ,nn_val,nn_is_ds_take,nn_addr);
    335384        LABEL("-----------------------------------");
    336385      }
     
    368417  delete []  in_PREDICT_INSTRUCTION_ENABLE         ;
    369418  delete     in_PREDICT_INST_IFETCH_PTR            ;
     419//delete     in_PREDICT_BRANCH_IS_CURRENT          ;
    370420  delete     in_PREDICT_BRANCH_STATE               ;
    371421  delete     in_PREDICT_BRANCH_UPDATE_PREDICTION_ID;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/include/Address_management.h

    r88 r101  
    8383  public    : SC_IN (Tcontrol_t         )   *  in_PREDICT_PC_NEXT_IS_DS_TAKE          ;
    8484  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_INSTRUCTION_ENABLE          ; //[nb_instruction]
    85   public    : SC_IN (Tinst_ifetch_ptr_t )   *  in_PREDICT_INST_IFETCH_PTR             ;
     85//public    : SC_IN (Tcontrol_t         )   *  in_PREDICT_BRANCH_IS_CURRENT           ;
    8686  public    : SC_IN (Tbranch_state_t    )   *  in_PREDICT_BRANCH_STATE                ;
    8787  public    : SC_IN (Tprediction_ptr_t  )   *  in_PREDICT_BRANCH_UPDATE_PREDICTION_ID ;
     88  public    : SC_IN (Tinst_ifetch_ptr_t )   *  in_PREDICT_INST_IFETCH_PTR             ;
    8889
    8990    // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    9899
    99100    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     101  private   : Tcontrol_t                      reg_PC_ACCESS_VAL                           ;
     102  private   : Tgeneral_address_t              reg_PC_ACCESS                               ;
     103  private   : Tcontrol_t                      reg_PC_ACCESS_IS_DS_TAKE                    ;
     104  private   : Tcontrol_t                    * reg_PC_ACCESS_INSTRUCTION_ENABLE            ; //[nb_instruction]
     105  private   : Tinst_ifetch_ptr_t              reg_PC_ACCESS_INST_IFETCH_PTR               ;
     106  private   : Tbranch_state_t                 reg_PC_ACCESS_BRANCH_STATE                  ;
     107  private   : Tprediction_ptr_t               reg_PC_ACCESS_BRANCH_UPDATE_PREDICTION_ID   ;
     108
    100109  private   : Tcontrol_t                      reg_PC_CURRENT_VAL                          ;
    101110  private   : Tgeneral_address_t              reg_PC_CURRENT                              ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_allocation.cpp

    r88 r101  
    8585      ALLOC_SIGNAL_IN  ( in_PREDICT_PC_NEXT                    ,"pc_next"                    ,Tgeneral_address_t,_param->_size_instruction_address);
    8686      ALLOC_SIGNAL_IN  ( in_PREDICT_PC_NEXT_IS_DS_TAKE         ,"pc_next_is_ds_take"         ,Tcontrol_t        ,1);
    87       ALLOC_SIGNAL_IN  ( in_PREDICT_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr);
     87//    ALLOC_SIGNAL_IN  ( in_PREDICT_BRANCH_IS_CURRENT          ,"branch_is_current"          ,Tcontrol_t        ,1);
    8888      ALLOC_SIGNAL_IN  ( in_PREDICT_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t   ,_param->_size_branch_state);
    8989      ALLOC_SIGNAL_IN  ( in_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t ,_param->_size_depth);
     90      ALLOC_SIGNAL_IN  ( in_PREDICT_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t,_param->_size_inst_ifetch_ptr);
    9091    }
    9192    {
     
    110111    if (usage_is_set(_usage,USE_SYSTEMC))
    111112      {
    112         reg_PC_CURRENT_INSTRUCTION_ENABLE = new Tcontrol_t [_param->_nb_instruction];
    113         reg_PC_NEXT_INSTRUCTION_ENABLE    = new Tcontrol_t [_param->_nb_instruction];
     113        ALLOC1(reg_PC_ACCESS_INSTRUCTION_ENABLE ,Tcontrol_t,_param->_nb_instruction);
     114        ALLOC1(reg_PC_CURRENT_INSTRUCTION_ENABLE,Tcontrol_t,_param->_nb_instruction);
     115        ALLOC1(reg_PC_NEXT_INSTRUCTION_ENABLE   ,Tcontrol_t,_param->_nb_instruction);
    114116      }
    115117
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_deallocation.cpp

    r88 r101  
    4747        if (_param->_have_port_inst_ifetch_ptr)
    4848        delete     in_PREDICT_INST_IFETCH_PTR            ;
     49//      delete     in_PREDICT_BRANCH_IS_CURRENT          ;
    4950        delete     in_PREDICT_BRANCH_STATE               ;
    5051        if (_param->_have_port_depth)
     
    6061        if (usage_is_set(_usage,USE_SYSTEMC))
    6162          {
     63            delete reg_PC_ACCESS_INSTRUCTION_ENABLE ;
    6264            delete reg_PC_CURRENT_INSTRUCTION_ENABLE;
    6365            delete reg_PC_NEXT_INSTRUCTION_ENABLE   ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_genMoore.cpp

    r88 r101  
    2828    // =========================================
    2929
    30     internal_ADDRESS_VAL = reg_PC_CURRENT_VAL;
     30    internal_ADDRESS_VAL = reg_PC_ACCESS_VAL;
    3131
    3232    PORT_WRITE(out_ADDRESS_VAL                        ,internal_ADDRESS_VAL                      );
    33     PORT_WRITE(out_ADDRESS_INSTRUCTION_ADDRESS        ,reg_PC_CURRENT                            );
     33    PORT_WRITE(out_ADDRESS_INSTRUCTION_ADDRESS        ,reg_PC_ACCESS                            );
    3434    if (_param->_have_port_inst_ifetch_ptr)
    35     PORT_WRITE(out_ADDRESS_INST_IFETCH_PTR            ,reg_PC_CURRENT_INST_IFETCH_PTR            );
    36     PORT_WRITE(out_ADDRESS_BRANCH_STATE               ,reg_PC_CURRENT_BRANCH_STATE               );
     35    PORT_WRITE(out_ADDRESS_INST_IFETCH_PTR            ,reg_PC_ACCESS_INST_IFETCH_PTR            );
     36    PORT_WRITE(out_ADDRESS_BRANCH_STATE               ,reg_PC_ACCESS_BRANCH_STATE               );
    3737    if (_param->_have_port_depth)
    38     PORT_WRITE(out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID);
     38    PORT_WRITE(out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,reg_PC_ACCESS_BRANCH_UPDATE_PREDICTION_ID);
    3939
    4040    for (uint32_t i=0; i<_param->_nb_instruction; i++)
    41       PORT_WRITE(out_ADDRESS_INSTRUCTION_ENABLE [i], reg_PC_CURRENT_INSTRUCTION_ENABLE[i]);
     41      PORT_WRITE(out_ADDRESS_INSTRUCTION_ENABLE [i], reg_PC_ACCESS_INSTRUCTION_ENABLE[i]);
    4242
    4343    // =========================================
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/src/Address_management_transition.cpp

    r98 r101  
    2828      {
    2929        // nothing is valid
     30        reg_PC_ACCESS_VAL    = 0;
     31
    3032        reg_PC_CURRENT_VAL   = 0;
    3133
    3234        reg_PC_NEXT_VAL      = 1;
    3335        reg_PC_NEXT          = 0x100>>2;
     36        reg_PC_NEXT_IS_DS_TAKE                  = 0;
     37        reg_PC_NEXT_INSTRUCTION_ENABLE [0]      = 1;
     38        for (uint32_t i=1; i<_param->_nb_instruction; i++)
     39        reg_PC_NEXT_INSTRUCTION_ENABLE [i]      = 0;
     40        reg_PC_NEXT_INST_IFETCH_PTR             = 0;
     41        reg_PC_NEXT_BRANCH_STATE                = 0;
     42        reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID = 0;
     43
    3444
    3545        reg_PC_NEXT_NEXT_VAL = 0;
     
    4252        if (PORT_READ(in_PREDICT_ACK) and internal_PREDICT_VAL)
    4353          {
     54            bool branch_is_current = reg_PC_NEXT_IS_DS_TAKE;
     55            if (branch_is_current)
     56              {
     57                if (_param->_have_port_inst_ifetch_ptr)
     58                reg_PC_CURRENT_INST_IFETCH_PTR             = PORT_READ(in_PREDICT_INST_IFETCH_PTR            );
     59                reg_PC_CURRENT_BRANCH_STATE                = PORT_READ(in_PREDICT_BRANCH_STATE               );
     60                if (_param->_have_port_depth)
     61                reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID = PORT_READ(in_PREDICT_BRANCH_UPDATE_PREDICTION_ID);
     62              }
     63            else
     64              {
     65                if (_param->_have_port_inst_ifetch_ptr)
     66                reg_PC_NEXT_INST_IFETCH_PTR                = PORT_READ(in_PREDICT_INST_IFETCH_PTR            );
     67                reg_PC_NEXT_BRANCH_STATE                   = PORT_READ(in_PREDICT_BRANCH_STATE               );
     68                if (_param->_have_port_depth)
     69                reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID    = PORT_READ(in_PREDICT_BRANCH_UPDATE_PREDICTION_ID);
     70              }
     71
    4472            for (uint32_t i=0; i<_param->_nb_instruction; i++)
    4573            reg_PC_NEXT_INSTRUCTION_ENABLE [i] = PORT_READ(in_PREDICT_INSTRUCTION_ENABLE [i]);
    46             if (_param->_have_port_inst_ifetch_ptr)
    47             reg_PC_NEXT_INST_IFETCH_PTR             = PORT_READ(in_PREDICT_INST_IFETCH_PTR            );
    48             reg_PC_NEXT_BRANCH_STATE                = PORT_READ(in_PREDICT_BRANCH_STATE               );
    49             if (_param->_have_port_depth)
    50             reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID = PORT_READ(in_PREDICT_BRANCH_UPDATE_PREDICTION_ID);
    5174           
    5275            reg_PC_NEXT_NEXT_VAL                    = 1; // address is valid
     
    6487        // =========================================
    6588        // transaction with icache
    66         if ( (internal_ADDRESS_VAL and PORT_READ(in_ADDRESS_ACK)) or not reg_PC_CURRENT_VAL)
    67           {
     89        if (internal_ADDRESS_VAL and PORT_READ(in_ADDRESS_ACK))
     90          {
     91            reg_PC_ACCESS_VAL = 0;
    6892#ifdef STATISTICS
    6993            if (usage_is_set(_usage,USE_STATISTICS))
    70               if (reg_PC_CURRENT_VAL)
    71                 {
     94              {
    7295                  (*_stat_nb_transaction_address) ++;
    7396                 
    7497                  for (uint32_t i=0; i<_param->_nb_instruction; i++)
    75                     if (reg_PC_CURRENT_INSTRUCTION_ENABLE [i] == true)
     98                    if (reg_PC_ACCESS_INSTRUCTION_ENABLE [i] == true)
    7699                      (*_stat_sum_packet_size) ++;
    77100                }
    78101#endif
    79 
    80 
    81             Tcontrol_t pc_next_val = reg_PC_NEXT_VAL and reg_PC_NEXT_NEXT_VAL;
    82 
    83             // next pc became current pc
    84             reg_PC_CURRENT_VAL                             = pc_next_val;
    85 
    86             // if pc_next is not valid : don't erase PC and PC_IS_DS_TAKE : this register is send a the predict (to compute pc_next)
    87             if (pc_next_val)
    88               {
    89                 reg_PC_CURRENT                             = reg_PC_NEXT                            ;
    90                 reg_PC_CURRENT_IS_DS_TAKE                  = reg_PC_NEXT_IS_DS_TAKE                 ;
    91                 reg_PC_CURRENT_INST_IFETCH_PTR             = reg_PC_NEXT_INST_IFETCH_PTR            ;
    92                 reg_PC_CURRENT_BRANCH_STATE                = reg_PC_NEXT_BRANCH_STATE               ;
    93                 reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID = reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID;
    94 
    95                 for (uint32_t i=0; i<_param->_nb_instruction; i++)
    96                 reg_PC_CURRENT_INSTRUCTION_ENABLE [i] = reg_PC_NEXT_INSTRUCTION_ENABLE [i];
    97            
    98                 reg_PC_NEXT_VAL                            = reg_PC_NEXT_NEXT_VAL       ;
    99                 // if pc_next_next is not valid : don't erase PC_NEXT and PC_NEXT_IS_DS_TAKE : this register is send a the predict (to compute pc_next)
    100                 if (reg_PC_NEXT_NEXT_VAL)
    101                   {
    102                     reg_PC_NEXT                            = reg_PC_NEXT_NEXT           ;
    103                     reg_PC_NEXT_IS_DS_TAKE                 = reg_PC_NEXT_NEXT_IS_DS_TAKE;
    104                   }
    105                
    106                 // invalid next next pc
    107                 reg_PC_NEXT_NEXT_VAL                       = 0;
    108               }
    109 
    110           }
    111        
     102          }
     103       
     104        // Shift register
     105
     106        if (not reg_PC_ACCESS_VAL and reg_PC_CURRENT_VAL and reg_PC_NEXT_VAL and reg_PC_NEXT_NEXT_VAL)
     107          {
     108            reg_PC_ACCESS_VAL  = 1; // new request
     109            reg_PC_CURRENT_VAL = 0; // invalid current
     110           
     111            reg_PC_ACCESS                             = reg_PC_CURRENT                            ;
     112            reg_PC_ACCESS_IS_DS_TAKE                  = reg_PC_CURRENT_IS_DS_TAKE                 ;
     113            reg_PC_ACCESS_INST_IFETCH_PTR             = reg_PC_CURRENT_INST_IFETCH_PTR            ;
     114            reg_PC_ACCESS_BRANCH_STATE                = reg_PC_CURRENT_BRANCH_STATE               ;
     115            reg_PC_ACCESS_BRANCH_UPDATE_PREDICTION_ID = reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID;
     116           
     117            for (uint32_t i=0; i<_param->_nb_instruction; i++)
     118              reg_PC_ACCESS_INSTRUCTION_ENABLE [i] = reg_PC_CURRENT_INSTRUCTION_ENABLE [i];
     119          }
     120       
     121        if (not reg_PC_CURRENT_VAL)
     122          {
     123            bool val = reg_PC_NEXT_VAL;
     124            reg_PC_CURRENT_VAL = val; // new PC_CURRENT if PC_NEXT is valid
     125            reg_PC_NEXT_VAL    = 0;   // invalid next
     126
     127            if (val)
     128              {
     129                reg_PC_CURRENT                             = reg_PC_NEXT                            ;
     130                reg_PC_CURRENT_IS_DS_TAKE                  = reg_PC_NEXT_IS_DS_TAKE                 ;
     131                reg_PC_CURRENT_INST_IFETCH_PTR             = reg_PC_NEXT_INST_IFETCH_PTR            ;
     132                reg_PC_CURRENT_BRANCH_STATE                = reg_PC_NEXT_BRANCH_STATE               ;
     133                reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID = reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID;
     134               
     135                for (uint32_t i=0; i<_param->_nb_instruction; i++)
     136                  reg_PC_CURRENT_INSTRUCTION_ENABLE [i] = reg_PC_NEXT_INSTRUCTION_ENABLE [i];
     137              }
     138          }
     139
     140        if (not reg_PC_NEXT_VAL)
     141          {
     142            bool val = reg_PC_NEXT_NEXT_VAL;
     143            reg_PC_NEXT_VAL      = val; // new PC_NEXT if PC_NEXT_NEXT is valid
     144            reg_PC_NEXT_NEXT_VAL = 0;   // invalid next_next
     145           
     146            if (val)
     147              {
     148                reg_PC_NEXT                             = reg_PC_NEXT_NEXT                            ;
     149                reg_PC_NEXT_IS_DS_TAKE                  = reg_PC_NEXT_NEXT_IS_DS_TAKE                 ;
     150//              reg_PC_NEXT_INST_IFETCH_PTR             = reg_PC_NEXT_NEXT_INST_IFETCH_PTR            ;
     151//              reg_PC_NEXT_BRANCH_STATE                = reg_PC_NEXT_NEXT_BRANCH_STATE               ;
     152//              reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID = reg_PC_NEXT_NEXT_BRANCH_UPDATE_PREDICTION_ID;
     153             
     154//              for (uint32_t i=0; i<_param->_nb_instruction; i++)
     155//                reg_PC_NEXT_INSTRUCTION_ENABLE [i] = reg_PC_NEXT_NEXT_INSTRUCTION_ENABLE [i];
     156              }
     157          }
    112158
    113159        // =========================================
     
    121167            log_printf(TRACE,Address_management,FUNCTION,"    * ADDRESS_NEXT     : %.8x (%.8x)",PORT_READ(in_EVENT_ADDRESS_NEXT    ),PORT_READ(in_EVENT_ADDRESS_NEXT    )<<2);
    122168            log_printf(TRACE,Address_management,FUNCTION,"    * ADDRESS_NEXT_VAL : %d"  ,PORT_READ(in_EVENT_ADDRESS_NEXT_VAL));
     169
     170            reg_PC_ACCESS_VAL                       = 0;
    123171            reg_PC_CURRENT_VAL                      = 0;
    124172            reg_PC_NEXT_VAL                         = 1;
     
    157205      }
    158206
    159 #if defined(DEBUG) and (DEBUG >= DEBUG_TRACE)
     207#if defined(DEBUG) and DEBUG_Address_management and (DEBUG >= DEBUG_TRACE)
    160208    log_printf(TRACE,Address_management,FUNCTION,"  * Dump PC");
    161     log_printf(TRACE,Address_management,FUNCTION,"    * Current   : %d %d 0x%.8x (%.8x)",reg_PC_CURRENT_VAL  , reg_PC_CURRENT_IS_DS_TAKE  , reg_PC_CURRENT  , reg_PC_CURRENT  <<2);
    162     log_printf(TRACE,Address_management,FUNCTION,"    * Next      : %d %d 0x%.8x (%.8x)",reg_PC_NEXT_VAL     , reg_PC_NEXT_IS_DS_TAKE     , reg_PC_NEXT     , reg_PC_NEXT     <<2);   
    163     log_printf(TRACE,Address_management,FUNCTION,"    * Next_Next : %d %d 0x%.8x (%.8x)",reg_PC_NEXT_NEXT_VAL, reg_PC_NEXT_NEXT_IS_DS_TAKE, reg_PC_NEXT_NEXT, reg_PC_NEXT_NEXT<<2);   
     209    {
     210      std::string instruction_enable;
     211      for (uint32_t i=0; i<_param->_nb_instruction; ++i)
     212        instruction_enable += toString(reg_PC_ACCESS_INSTRUCTION_ENABLE [i])+ " ";
     213
     214      log_printf(TRACE,Address_management,FUNCTION,"    * Access    : %d %d 0x%.8x (%.8x) - %.2d %.2d %.2d - %s",
     215                 reg_PC_ACCESS_VAL,
     216                 reg_PC_ACCESS_IS_DS_TAKE,
     217                 reg_PC_ACCESS,
     218                 reg_PC_ACCESS<<2,
     219                 reg_PC_ACCESS_BRANCH_STATE,
     220                 reg_PC_ACCESS_INST_IFETCH_PTR,
     221                 reg_PC_ACCESS_BRANCH_UPDATE_PREDICTION_ID,
     222                 instruction_enable.c_str()
     223                 );
     224    }
     225    {
     226      std::string instruction_enable;
     227      for (uint32_t i=0; i<_param->_nb_instruction; ++i)
     228        instruction_enable += toString(reg_PC_CURRENT_INSTRUCTION_ENABLE [i])+ " ";
     229
     230      log_printf(TRACE,Address_management,FUNCTION,"    * Current   : %d %d 0x%.8x (%.8x) - %.2d %.2d %.2d - %s",
     231                 reg_PC_CURRENT_VAL,
     232                 reg_PC_CURRENT_IS_DS_TAKE,
     233                 reg_PC_CURRENT,
     234                 reg_PC_CURRENT<<2,
     235                 reg_PC_CURRENT_BRANCH_STATE,
     236                 reg_PC_CURRENT_INST_IFETCH_PTR,
     237                 reg_PC_CURRENT_BRANCH_UPDATE_PREDICTION_ID,
     238                 instruction_enable.c_str()
     239                 );
     240    }
     241    {
     242      std::string instruction_enable;
     243      for (uint32_t i=0; i<_param->_nb_instruction; ++i)
     244        instruction_enable += toString(reg_PC_NEXT_INSTRUCTION_ENABLE [i])+ " ";
     245
     246      log_printf(TRACE,Address_management,FUNCTION,"    * Next      : %d %d 0x%.8x (%.8x) - %.2d %.2d %.2d - %s",
     247                 reg_PC_NEXT_VAL,
     248                 reg_PC_NEXT_IS_DS_TAKE,
     249                 reg_PC_NEXT,
     250                 reg_PC_NEXT<<2,
     251                 reg_PC_NEXT_BRANCH_STATE,
     252                 reg_PC_NEXT_INST_IFETCH_PTR,
     253                 reg_PC_NEXT_BRANCH_UPDATE_PREDICTION_ID,
     254                 instruction_enable.c_str());
     255    }
     256    log_printf(TRACE,Address_management,FUNCTION,"    * Next_Next : %d %d 0x%.8x (%.8x)",
     257               reg_PC_NEXT_NEXT_VAL,
     258               reg_PC_NEXT_NEXT_IS_DS_TAKE,
     259               reg_PC_NEXT_NEXT,
     260               reg_PC_NEXT_NEXT<<2);   
    164261#endif
    165262
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Types.h

    r85 r101  
    2222    {
    2323      IFETCH_QUEUE_STATE_EMPTY         ,  // slot is empty
    24     //IFETCH_QUEUE_STATE_WAIT_REQ      ,  // slot is allocated               - wait request to   cache
     24//    IFETCH_QUEUE_STATE_WAIT_REQ      ,  // slot is allocated               - wait request to   cache
    2525      IFETCH_QUEUE_STATE_WAIT_RSP      ,  // slot have send a request        - wait respons from cache
    2626      IFETCH_QUEUE_STATE_HAVE_RSP      ,  // slot have a bloc of instruction - wait accept by decod
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_transition.cpp

    r88 r101  
    4141            // New slot in ifetch_queue is allocated
    4242           
    43             _queue[reg_PTR_WRITE]->_state                       = IFETCH_QUEUE_STATE_WAIT_RSP;
     43            _queue[reg_PTR_WRITE]->_state = IFETCH_QUEUE_STATE_WAIT_RSP;
    4444             
    4545#ifdef STATISTICS
     
    5858              }
    5959
    60             _queue[reg_PTR_WRITE]->_address                     = PORT_READ(in_ADDRESS_INSTRUCTION_ADDRESS        );
     60            _queue[reg_PTR_WRITE]->_address                     = PORT_READ(in_ADDRESS_INSTRUCTION_ADDRESS);
    6161            _queue[reg_PTR_WRITE]->_inst_ifetch_ptr             = (_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_ADDRESS_INST_IFETCH_PTR            ):0;
    62             _queue[reg_PTR_WRITE]->_branch_state                = PORT_READ(in_ADDRESS_BRANCH_STATE               );
     62            _queue[reg_PTR_WRITE]->_branch_state                = PORT_READ(in_ADDRESS_BRANCH_STATE);
    6363            _queue[reg_PTR_WRITE]->_branch_update_prediction_id = (_param->_have_port_depth)?PORT_READ(in_ADDRESS_BRANCH_UPDATE_PREDICTION_ID):0;
    6464           
     
    142142        for (uint32_t i=0; i<_param->_size_queue; i++)
    143143          {
    144             log_printf(TRACE,Ifetch_queue,FUNCTION,"    * [%d] %s %.8x %d - %d %d %d", i, toString(_queue [i]->_state).c_str(), _queue [i]->_address,_queue [i]->_inst_ifetch_ptr,_queue [i]->_branch_state,_queue [i]->_branch_update_prediction_id,_queue [i]->_exception);
     144            log_printf(TRACE,Ifetch_queue,FUNCTION,"    * [%d] 0x%.8x (0x%.8x) %d - %d %d %d - %s",
     145                       i,
     146                       _queue [i]->_address,
     147                       _queue [i]->_address<<2,
     148                       _queue [i]->_inst_ifetch_ptr,
     149                       _queue [i]->_branch_state,
     150                       _queue [i]->_branch_update_prediction_id,
     151                       _queue [i]->_exception,
     152                       toString(_queue [i]->_state).c_str()
     153                       );
    145154           
    146155            for (uint32_t j=0; j<_param->_nb_instruction; j++)
    147               log_printf(TRACE,Ifetch_queue,FUNCTION,"      * %d %.8x", _queue [i]->_instruction_enable[j], _queue [i]->_instruction[j]);
     156              log_printf(TRACE,Ifetch_queue,FUNCTION,"      * %d 0x%.8x", _queue [i]->_instruction_enable[j], _queue [i]->_instruction[j]);
    148157          }
    149158#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/SelfTest/src/test.cpp

    r88 r101  
    250250      LABEL("Iteration %d",iteration);
    251251
    252       // PREDICT
    253       {
    254         in_PREDICT_ACK  ->write((rand()%100)<percent_transaction_predict);
     252//       // PREDICT
     253//       {
     254//      in_PREDICT_ACK  ->write((rand()%100)<percent_transaction_predict);
    255255       
    256         SC_START(0);
    257 
    258         Taddress_t addr  = (out_PREDICT_PC_CURRENT_IS_DS_TAKE->read())?out_PREDICT_PC_PREVIOUS->read():out_PREDICT_PC_CURRENT->read();
    259 
    260         uint32_t   begin = addr%_param->_nb_instruction;
    261         uint32_t   end   = ((begin<<1)>_param->_nb_instruction)?(_param->_nb_instruction-1):(begin<<1);
    262         Tcontrol_t take  = (nb_packet_in%jump)==0;
     256//      SC_START(0);
     257
     258//      Taddress_t addr  = (out_PREDICT_PC_CURRENT_IS_DS_TAKE->read())?out_PREDICT_PC_PREVIOUS->read():out_PREDICT_PC_CURRENT->read();
     259
     260//      uint32_t   begin = addr%_param->_nb_instruction;
     261//      uint32_t   end   = ((begin<<1)>_param->_nb_instruction)?(_param->_nb_instruction-1):(begin<<1);
     262//      Tcontrol_t take  = (nb_packet_in%jump)==0;
    263263       
    264         if (take)
    265           addr += 0x100;
    266         else
    267           addr += end-begin+1;
    268 
    269         for (uint32_t i=0; i<_param->_nb_instruction; i++)
    270         in_PREDICT_INSTRUCTION_ENABLE     [i] ->write((i>=begin) and (i<=end));
    271         in_PREDICT_PC_NEXT                    ->write(addr);
    272         in_PREDICT_PC_NEXT_IS_DS_TAKE         ->write(take);
    273         in_PREDICT_INST_IFETCH_PTR            ->write(0);
    274         in_PREDICT_BRANCH_STATE               ->write(0);
    275         in_PREDICT_BRANCH_UPDATE_PREDICTION_ID->write(0);
    276       }
    277 
    278       // DECOD
    279       {
    280         uint32_t nb_decod = (rand()%_param->_nb_instruction);
    281 
    282         for (uint32_t i=0; i<_param->_nb_instruction; i++)
    283           in_DECOD_ACK [i]->write(i<=nb_decod);
    284       }
    285 
    286       // EVENT
    287       in_EVENT_VAL             ->write((rand()%100)<percent_transaction_event  );
    288       in_EVENT_ADDRESS         ->write(0x77);
    289       in_EVENT_ADDRESS_NEXT    ->write(0x171);
    290       Tcontrol_t is_ds_take = rand();
    291       in_EVENT_ADDRESS_NEXT_VAL->write(is_ds_take);
    292       in_EVENT_IS_DS_TAKE      ->write(is_ds_take);
    293 
    294       // ICACHE_REQ
    295       in_ICACHE_REQ_ACK->write((rand()%100)<percent_transaction_icache_req);
    296 
    297       // ICACHE_RSP
    298       {
    299         Tcontrol_t val = false;
    300         if (not cache->empty())
    301           {
    302             slot_t<cache_req_t *> cache_rsp = cache->read();
    303 
    304             val = (cache_rsp._delay == 0);
     264//      if (take)
     265//        addr += 0x100;
     266//      else
     267//        addr += end-begin+1;
     268
     269//      for (uint32_t i=0; i<_param->_nb_instruction; i++)
     270//      in_PREDICT_INSTRUCTION_ENABLE     [i] ->write((i>=begin) and (i<=end));
     271//      in_PREDICT_PC_NEXT                    ->write(addr);
     272//      in_PREDICT_PC_NEXT_IS_DS_TAKE         ->write(take);
     273//      in_PREDICT_INST_IFETCH_PTR            ->write(0);
     274//      in_PREDICT_BRANCH_STATE               ->write(0);
     275//      in_PREDICT_BRANCH_UPDATE_PREDICTION_ID->write(0);
     276//       }
     277
     278//       // DECOD
     279//       {
     280//      uint32_t nb_decod = (rand()%_param->_nb_instruction);
     281
     282//      for (uint32_t i=0; i<_param->_nb_instruction; i++)
     283//        in_DECOD_ACK [i]->write(i<=nb_decod);
     284//       }
     285
     286//       // EVENT
     287//       in_EVENT_VAL             ->write((rand()%100)<percent_transaction_event  );
     288//       in_EVENT_ADDRESS         ->write(0x77);
     289//       in_EVENT_ADDRESS_NEXT    ->write(0x171);
     290//       Tcontrol_t is_ds_take = rand();
     291//       in_EVENT_ADDRESS_NEXT_VAL->write(is_ds_take);
     292//       in_EVENT_IS_DS_TAKE      ->write(is_ds_take);
     293
     294//       // ICACHE_REQ
     295//       in_ICACHE_REQ_ACK->write((rand()%100)<percent_transaction_icache_req);
     296
     297//       // ICACHE_RSP
     298//       {
     299//      Tcontrol_t val = false;
     300//      if (not cache->empty())
     301//        {
     302//          slot_t<cache_req_t *> cache_rsp = cache->read();
     303
     304//          val = (cache_rsp._delay == 0);
    305305           
    306             Tpacket_t  packet  = cache_rsp._data->packet ;
    307             Taddress_t address = cache_rsp._data->address;
     306//          Tpacket_t  packet  = cache_rsp._data->packet ;
     307//          Taddress_t address = cache_rsp._data->address;
    308308           
    309             in_ICACHE_RSP_PACKET_ID      ->write(packet);
    310             for (uint32_t i=0; i<_param->_nb_instruction; i++)
    311             in_ICACHE_RSP_INSTRUCTION [i]->write(address+i);
    312             in_ICACHE_RSP_ERROR          ->write(0);
    313           }
    314 
    315         in_ICACHE_RSP_VAL->write(val);
    316       }
    317 
    318       //-------------------------------------------------
    319       SC_START(0);
    320       //-------------------------------------------------
    321 
    322       if (out_ICACHE_REQ_VAL->read() and in_ICACHE_REQ_ACK->read())
    323         {
    324           LABEL("ICACHE_REQ : Transaction accepted");
    325 
    326           Tpacket_t  packet  = (_param->_have_port_ifetch_queue_ptr)?out_ICACHE_REQ_PACKET_ID->read():0;
    327           Taddress_t address = out_ICACHE_REQ_ADDRESS->read();
    328 
    329           TEST(bool      ,slot_use[packet], false);
    330           TEST(Taddress_t,address         ,c_addr);
    331 
    332           slot_use[packet] = true;
    333 
    334           uint32_t delay;
    335           if ((rand()%100)<percent_hit)
    336             delay = 1;
    337           else
    338             delay = delay_miss_min + (rand()%(delay_miss_max-delay_miss_min+1));
    339 
    340           cache_req_t * cache_req = new cache_req_t(packet,address);
    341           cache->push(delay,cache_req);
    342 
    343           c_val = 0;
    344           nb_packet_in ++;
    345         }
    346 
    347       {
    348         bool find=false;
    349 
    350         Taddress_t addr=out_DECOD_ADDRESS->read();
    351         for (uint32_t i=0; i<_param->_nb_instruction; i++)
    352           if (out_DECOD_VAL[i]->read() and in_DECOD_ACK [i]->read())
    353             {
    354               Tinstruction_t inst = out_DECOD_INSTRUCTION[i]->read();
    355               LABEL("DECOD [%d]  : Transaction accepted",i);
    356               LABEL("  address     : 0x%x",addr);
    357               LABEL("  instruction : 0x%x",inst);
    358 
    359               find = true;
    360               TEST(Tinstruction_t,inst,addr+i);
    361             }
    362 
    363         if (find)
    364           {
    365             if (_param->_have_port_inst_ifetch_ptr)
    366             TEST(Tinst_ifetch_ptr_t, out_DECOD_INST_IFETCH_PTR            ->read(), 0);
    367             TEST(Tbranch_state_t   , out_DECOD_BRANCH_STATE               ->read(), 0);
    368             if (_param->_have_port_depth)
    369             TEST(Tprediction_ptr_t , out_DECOD_BRANCH_UPDATE_PREDICTION_ID->read(), 0);
    370             TEST(Texception_t      , out_DECOD_EXCEPTION                  ->read(), 0);
    371           }
    372       }
     309//          in_ICACHE_RSP_PACKET_ID      ->write(packet);
     310//          for (uint32_t i=0; i<_param->_nb_instruction; i++)
     311//          in_ICACHE_RSP_INSTRUCTION [i]->write(address+i);
     312//          in_ICACHE_RSP_ERROR          ->write(0);
     313//        }
     314
     315//      in_ICACHE_RSP_VAL->write(val);
     316//       }
     317
     318//       //-------------------------------------------------
     319//       SC_START(0);
     320//       //-------------------------------------------------
     321
     322//       if (out_ICACHE_REQ_VAL->read() and in_ICACHE_REQ_ACK->read())
     323//      {
     324//        LABEL("ICACHE_REQ : Transaction accepted");
     325
     326//        Tpacket_t  packet  = (_param->_have_port_ifetch_queue_ptr)?out_ICACHE_REQ_PACKET_ID->read():0;
     327//        Taddress_t address = out_ICACHE_REQ_ADDRESS->read();
     328
     329//        TEST(bool      ,slot_use[packet], false);
     330//        TEST(Taddress_t,address         ,c_addr);
     331
     332//        slot_use[packet] = true;
     333
     334//        uint32_t delay;
     335//        if ((rand()%100)<percent_hit)
     336//          delay = 1;
     337//        else
     338//          delay = delay_miss_min + (rand()%(delay_miss_max-delay_miss_min+1));
     339
     340//        cache_req_t * cache_req = new cache_req_t(packet,address);
     341//        cache->push(delay,cache_req);
     342
     343//        c_val = 0;
     344//        nb_packet_in ++;
     345//      }
     346
     347//       {
     348//      bool find=false;
     349
     350//      Taddress_t addr=out_DECOD_ADDRESS->read();
     351//      for (uint32_t i=0; i<_param->_nb_instruction; i++)
     352//        if (out_DECOD_VAL[i]->read() and in_DECOD_ACK [i]->read())
     353//          {
     354//            Tinstruction_t inst = out_DECOD_INSTRUCTION[i]->read();
     355//            LABEL("DECOD [%d]  : Transaction accepted",i);
     356//            LABEL("  address     : 0x%x",addr);
     357//            LABEL("  instruction : 0x%x",inst);
     358
     359//            find = true;
     360//            TEST(Tinstruction_t,inst,addr+i);
     361//          }
     362
     363//      if (find)
     364//        {
     365//          if (_param->_have_port_inst_ifetch_ptr)
     366//          TEST(Tinst_ifetch_ptr_t, out_DECOD_INST_IFETCH_PTR            ->read(), 0);
     367//          TEST(Tbranch_state_t   , out_DECOD_BRANCH_STATE               ->read(), 0);
     368//          if (_param->_have_port_depth)
     369//          TEST(Tprediction_ptr_t , out_DECOD_BRANCH_UPDATE_PREDICTION_ID->read(), 0);
     370//          TEST(Texception_t      , out_DECOD_EXCEPTION                  ->read(), 0);
     371//        }
     372//       }
    373373     
    374       if (in_ICACHE_RSP_VAL->read() and out_ICACHE_RSP_ACK->read())
    375         {
    376           LABEL("ICACHE_RSP : Transaction accepted");
    377 
    378           slot_use[cache->read()._data->packet] = false;
    379 
    380           cache->pop();
    381         }
    382 
    383       if (out_PREDICT_VAL->read() and in_PREDICT_ACK->read())
    384         {
    385           LABEL("PREDICT    : Transaction accepted");
    386 
    387           if (c_val)
    388           TEST(Tgeneral_address_t,out_PREDICT_PC_PREVIOUS          ->read(),c_addr      );
    389           TEST(Tgeneral_address_t,out_PREDICT_PC_CURRENT           ->read(),n_addr      );
    390           TEST(Tcontrol_t        ,out_PREDICT_PC_CURRENT_IS_DS_TAKE->read(),n_is_ds_take);
    391 
    392           nn_val        = true;
    393           nn_addr       = in_PREDICT_PC_NEXT           ->read();
    394           nn_is_ds_take = in_PREDICT_PC_NEXT_IS_DS_TAKE->read();
     374//       if (in_ICACHE_RSP_VAL->read() and out_ICACHE_RSP_ACK->read())
     375//      {
     376//        LABEL("ICACHE_RSP : Transaction accepted");
     377
     378//        slot_use[cache->read()._data->packet] = false;
     379
     380//        cache->pop();
     381//      }
     382
     383//       if (out_PREDICT_VAL->read() and in_PREDICT_ACK->read())
     384//      {
     385//        LABEL("PREDICT    : Transaction accepted");
     386
     387//        if (c_val)
     388//        TEST(Tgeneral_address_t,out_PREDICT_PC_PREVIOUS          ->read(),c_addr      );
     389//        TEST(Tgeneral_address_t,out_PREDICT_PC_CURRENT           ->read(),n_addr      );
     390//        TEST(Tcontrol_t        ,out_PREDICT_PC_CURRENT_IS_DS_TAKE->read(),n_is_ds_take);
     391
     392//        nn_val        = true;
     393//        nn_addr       = in_PREDICT_PC_NEXT           ->read();
     394//        nn_is_ds_take = in_PREDICT_PC_NEXT_IS_DS_TAKE->read();
    395395       
    396           for (uint32_t i=0; i<_param->_nb_instruction; i++)
    397           n_enable [i]  = in_PREDICT_INSTRUCTION_ENABLE [i]->read();
    398         }
    399 
    400       if (not c_val)
    401         {
    402           if (n_val and nn_val)
    403             {
    404               c_val        = 1;
    405               c_addr       = n_addr;
    406               c_is_ds_take = n_is_ds_take;
    407 
    408               for (uint32_t i=0; i<_param->_nb_instruction; i++)
    409                 c_enable [i] = n_enable [i];
     396//        for (uint32_t i=0; i<_param->_nb_instruction; i++)
     397//        n_enable [i]  = in_PREDICT_INSTRUCTION_ENABLE [i]->read();
     398//      }
     399
     400//       if (not c_val)
     401//      {
     402//        if (n_val and nn_val)
     403//          {
     404//            c_val        = 1;
     405//            c_addr       = n_addr;
     406//            c_is_ds_take = n_is_ds_take;
     407
     408//            for (uint32_t i=0; i<_param->_nb_instruction; i++)
     409//              c_enable [i] = n_enable [i];
    410410             
    411               n_val        = 1;
    412               n_addr       = nn_addr;
    413               n_is_ds_take = nn_is_ds_take;
     411//            n_val        = 1;
     412//            n_addr       = nn_addr;
     413//            n_is_ds_take = nn_is_ds_take;
    414414             
    415               nn_val       = 0;
    416             }
    417         }
    418 
    419       if (in_EVENT_VAL->read() and out_EVENT_ACK->read())
    420         {
    421           LABEL("EVENT      : Transaction accepted");
    422 
    423           c_val           = false;
    424           n_val           = true;
    425 
    426           n_addr          = in_EVENT_ADDRESS->read();
    427           n_is_ds_take    = in_EVENT_IS_DS_TAKE->read();
    428           nn_val          = in_EVENT_ADDRESS_NEXT_VAL->read();
    429           nn_addr         = in_EVENT_ADDRESS_NEXT    ->read();
    430           nn_is_ds_take   = 0;
    431 
    432           n_enable [0] = 1;
    433           for (uint32_t i=1; i<_param->_nb_instruction; i++)
    434             n_enable [i] = 0;
    435         }
     415//            nn_val       = 0;
     416//          }
     417//      }
     418
     419//       if (in_EVENT_VAL->read() and out_EVENT_ACK->read())
     420//      {
     421//        LABEL("EVENT      : Transaction accepted");
     422
     423//        c_val           = false;
     424//        n_val           = true;
     425
     426//        n_addr          = in_EVENT_ADDRESS->read();
     427//        n_is_ds_take    = in_EVENT_IS_DS_TAKE->read();
     428//        nn_val          = in_EVENT_ADDRESS_NEXT_VAL->read();
     429//        nn_addr         = in_EVENT_ADDRESS_NEXT    ->read();
     430//           nn_is_ds_take   = 0;
     431
     432//        n_enable [0] = 1;
     433//        for (uint32_t i=1; i<_param->_nb_instruction; i++)
     434//          n_enable [i] = 0;
     435//      }
    436436
    437437     
    438       {
    439         string str_c_enable = "";
    440         string str_n_enable = "";
    441 
    442         for (uint32_t i=0; i<_param->_nb_instruction; i++)
    443           {
    444             str_c_enable += " " + toString(c_enable [i]);
    445             str_n_enable += " " + toString(n_enable [i]);
    446           }
    447 
    448         LABEL("-----------------------------------");
    449         LABEL("  * nb_packet_in  : %d",nb_packet_in);
    450         LABEL("  * nb_packet_out : %d",nb_packet_out);
    451         LABEL("  * pc   : %d %d %.8x %s",c_val  ,c_is_ds_take , c_addr ,str_c_enable.c_str());
    452         if (nn_val)
    453           {
    454         LABEL("  * pc+4 : %d %d %.8x %s",n_val  ,n_is_ds_take , n_addr ,str_n_enable.c_str());
    455           }
    456         else
    457           {
    458         LABEL("  * pc+4 : %d %d %.8x"   ,n_val  ,n_is_ds_take , n_addr );
    459           }
    460         LABEL("  * pc+8 : %d %d %.8x"   ,nn_val ,nn_is_ds_take, nn_addr);
    461         LABEL("-----------------------------------");
    462       }
    463 
    464       SC_START(1);
    465       cache->transition();
     438//       {
     439//      string str_c_enable = "";
     440//      string str_n_enable = "";
     441
     442//      for (uint32_t i=0; i<_param->_nb_instruction; i++)
     443//        {
     444//          str_c_enable += " " + toString(c_enable [i]);
     445//          str_n_enable += " " + toString(n_enable [i]);
     446//        }
     447
     448//      LABEL("-----------------------------------");
     449//      LABEL("  * nb_packet_in  : %d",nb_packet_in);
     450//      LABEL("  * nb_packet_out : %d",nb_packet_out);
     451//      LABEL("  * pc   : %d %d %.8x %s",c_val  ,c_is_ds_take , c_addr ,str_c_enable.c_str());
     452//      if (nn_val)
     453//        {
     454//      LABEL("  * pc+4 : %d %d %.8x %s",n_val  ,n_is_ds_take , n_addr ,str_n_enable.c_str());
     455//        }
     456//      else
     457//        {
     458//      LABEL("  * pc+4 : %d %d %.8x"   ,n_val  ,n_is_ds_take , n_addr );
     459//        }
     460//      LABEL("  * pc+8 : %d %d %.8x"   ,nn_val ,nn_is_ds_take, nn_addr);
     461//      LABEL("-----------------------------------");
     462//       }
     463
     464//       SC_START(1);
     465//       cache->transition();
    466466    }
    467467
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/include/Ifetch_unit.h

    r88 r101  
    9090  public    : SC_IN (Tcontrol_t         )   *  in_PREDICT_PC_NEXT_IS_DS_TAKE          ;
    9191  public    : SC_IN (Tcontrol_t         )  **  in_PREDICT_INSTRUCTION_ENABLE          ; //[nb_instruction]
    92   public    : SC_IN (Tinst_ifetch_ptr_t )   *  in_PREDICT_INST_IFETCH_PTR             ;
    9392  public    : SC_IN (Tbranch_state_t    )   *  in_PREDICT_BRANCH_STATE                ;
    9493  public    : SC_IN (Tprediction_ptr_t  )   *  in_PREDICT_BRANCH_UPDATE_PREDICTION_ID ;
     94  public    : SC_IN (Tinst_ifetch_ptr_t )   *  in_PREDICT_INST_IFETCH_PTR             ;
    9595
    9696    // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_predict.cpp

    r100 r101  
    151151               
    152152                    // Branch is the last slot : next paquet is the delay slot
    153                     pc_next            = address_src+1; // sequencial
     153                    pc_next            = address_src+1; // sequential
    154154                    pc_next_is_ds_take = 1;
    155155                    address_msb        = _param->_nb_instruction [context]; // == (address_src_lsb+1)
     
    341341
    342342                // Take the address packet base and add new packet
    343                 pc_next                     = pc_current-address_lsb+_param->_nb_instruction [context]; // sequencial
     343                pc_next                     = pc_current-address_lsb+_param->_nb_instruction [context]; // sequential
    344344                pc_next_is_ds_take          = 0; // no branch, also no delay slot
    345345                inst_ifetch_ptr             = 0;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/SelfTest/src/test.cpp

    r98 r101  
    9999  ALLOC1_SC_SIGNAL( in_EVENT_DEPTH                        ," in_EVENT_DEPTH                        ",Tdepth_t           ,_param->_nb_context);
    100100
     101  ALLOC1_SC_SIGNAL(out_DEPTH_VAL                          ,"out_DEPTH_VAL                          ",Tcontrol_t         ,_param->_nb_context);
    101102  ALLOC1_SC_SIGNAL(out_DEPTH_CURRENT                      ,"out_DEPTH_CURRENT                      ",Tdepth_t           ,_param->_nb_context);
    102103  ALLOC1_SC_SIGNAL(out_DEPTH_MIN                          ,"out_DEPTH_MIN                          ",Tdepth_t           ,_param->_nb_context);
    103104  ALLOC1_SC_SIGNAL(out_DEPTH_MAX                          ,"out_DEPTH_MAX                          ",Tdepth_t           ,_param->_nb_context);
     105  ALLOC1_SC_SIGNAL(out_DEPTH_FULL                         ,"out_DEPTH_FULL                         ",Tcontrol_t         ,_param->_nb_context);
    104106 
    105107  /********************************************************
     
    170172  INSTANCE1_SC_SIGNAL(_Prediction_unit,out_DEPTH_CURRENT                      ,_param->_nb_context);
    171173  INSTANCE1_SC_SIGNAL(_Prediction_unit,out_DEPTH_MIN                          ,_param->_nb_context);
    172     }
    173174  INSTANCE1_SC_SIGNAL(_Prediction_unit,out_DEPTH_MAX                          ,_param->_nb_context);
     175    }
     176  INSTANCE1_SC_SIGNAL(_Prediction_unit,out_DEPTH_VAL                          ,_param->_nb_context);
     177  INSTANCE1_SC_SIGNAL(_Prediction_unit,out_DEPTH_FULL                         ,_param->_nb_context);
    174178
    175179  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
     
    372376  DELETE1_SC_SIGNAL( in_EVENT_DEPTH                    ,_param->_nb_context);
    373377
     378  DELETE1_SC_SIGNAL(out_DEPTH_VAL          ,_param->_nb_context);
    374379  DELETE1_SC_SIGNAL(out_DEPTH_CURRENT      ,_param->_nb_context);
    375380  DELETE1_SC_SIGNAL(out_DEPTH_MIN          ,_param->_nb_context);
    376381  DELETE1_SC_SIGNAL(out_DEPTH_MAX          ,_param->_nb_context);
     382  DELETE1_SC_SIGNAL(out_DEPTH_FULL         ,_param->_nb_context);
    377383#endif
    378384
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp

    r98 r101  
    143143  ALLOC1_SC_SIGNAL( in_EVENT_DEPTH                    ," in_EVENT_DEPTH                    ",Tdepth_t           ,_param->_nb_context);
    144144
     145  ALLOC1_SC_SIGNAL(out_DEPTH_VAL                      ,"out_DEPTH_VAL                      ",Tcontrol_t         ,_param->_nb_context);
    145146  ALLOC1_SC_SIGNAL(out_DEPTH_CURRENT                  ,"out_DEPTH_CURRENT                  ",Tdepth_t           ,_param->_nb_context);
    146147  ALLOC1_SC_SIGNAL(out_DEPTH_MIN                      ,"out_DEPTH_MIN                      ",Tdepth_t           ,_param->_nb_context);
    147148  ALLOC1_SC_SIGNAL(out_DEPTH_MAX                      ,"out_DEPTH_MAX                      ",Tdepth_t           ,_param->_nb_context);
     149  ALLOC1_SC_SIGNAL(out_DEPTH_FULL                     ,"out_DEPTH_FULL                     ",Tcontrol_t         ,_param->_nb_context);
    148150 
    149151  /********************************************************
     
    239241  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_CURRENT                  ,_param->_nb_context);
    240242  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_MIN                      ,_param->_nb_context);
     243  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_MAX                      ,_param->_nb_context);
    241244    }
    242   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_MAX                      ,_param->_nb_context);
     245  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_VAL                      ,_param->_nb_context);
     246  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_FULL                     ,_param->_nb_context);
    243247
    244248  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
     
    373377                 
    374378                  if (_param->_have_port_depth)
     379                    {
    375380                  TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    376381                  TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
    377                      
     382                    }
    378383                  SC_START(0); // fct melay
    379384                 
     
    404409           
    405410              if (_param->_have_port_depth)
     411                {
    406412              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    407413              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     414                }
    408415            }
    409416        }
     
    462469             
    463470              if (_param->_have_port_depth)
     471                {
    464472              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    465473              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     474                }
    466475            }
    467476        }
     
    490499
    491500                  if (_param->_have_port_depth)
     501                    {
    492502                  TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    493503                  TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     504                    }
    494505                 
    495506                  SC_START(0);
     
    516527             
    517528              if (_param->_have_port_depth)
     529                {
    518530              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    519531              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     532                }
    520533            }
    521534        }
     
    539552
    540553//                   if (_param->_have_port_depth)
     554//                     {
    541555//                   TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    542556//                   TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     557//                     }
    543558                 
    544559                  SC_START(0);
     
    654669                 
    655670                  if (_param->_have_port_depth)
     671                    {
    656672                  TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    657673                  TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
    658                      
     674                    }
    659675                  SC_START(0); // fct melay
    660676                 
     
    685701           
    686702              if (_param->_have_port_depth)
     703                {
    687704              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    688705              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     706                }
    689707            }
    690708        }
     
    764782             
    765783              if (_param->_have_port_depth)
     784                {
    766785              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    767786              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     787                }
    768788            }
    769789        }
     
    793813
    794814                  if (_param->_have_port_depth)
     815                    {
    795816                  TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    796817                  TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
    797                  
     818                    }
    798819                  SC_START(0);
    799820                 
     
    819840             
    820841              if (_param->_have_port_depth)
     842                {
    821843              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    822844              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     845                }
    823846            }
    824847        }
     
    10131036                 
    10141037                  if (_param->_have_port_depth)
     1038                    {
    10151039                  TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    10161040                  TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
    1017                      
     1041                    }
    10181042                  SC_START(0); // fct melay
    10191043                 
     
    10441068           
    10451069              if (_param->_have_port_depth)
     1070                {
    10461071              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    10471072              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     1073                }
    10481074            }
    10491075        }
     
    11231149             
    11241150              if (_param->_have_port_depth)
     1151                {
    11251152              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    11261153              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     1154                }
    11271155            }
    11281156        }
     
    11521180
    11531181                  if (_param->_have_port_depth)
     1182                    {
    11541183                  TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    11551184                  TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
    1156                  
     1185                    }             
    11571186                  SC_START(0);
    11581187                 
     
    11781207             
    11791208              if (_param->_have_port_depth)
     1209                {
    11801210              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    11811211              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     1212                }
    11821213            }
    11831214        }
     
    14501481                   
    14511482                    if (_param->_have_port_depth)
     1483                      {
    14521484                    TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    14531485                    TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
    1454                    
     1486                      }
    14551487                    SC_START(0); // fct melay
    14561488                   
     
    14811513               
    14821514                if (_param->_have_port_depth)
    1483                   TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
     1515                  {
     1516                TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    14841517                TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     1518                  }
    14851519              }
    14861520          }
     
    15411575               
    15421576                if (_param->_have_port_depth)
    1543                   TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
     1577                  {
     1578                TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    15441579                TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     1580                  }
    15451581              }
    15461582          }
     
    15931629                   
    15941630                    if (_param->_have_port_depth)
     1631                      {
    15951632                    TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    15961633                    TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
    1597                    
     1634                      }
    15981635                    SC_START(0); // fct melay
    15991636                   
     
    16241661               
    16251662                if (_param->_have_port_depth)
    1626                   TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
     1663                  {
     1664                TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    16271665                TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     1666                  }
    16281667              }
    16291668          }
     
    16771716
    16781717                  if (_param->_have_port_depth)
     1718                    {
    16791719                  TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    16801720                  TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
    1681                  
     1721                    }
     1722
    16821723                  SC_START(0);
    16831724                 
     
    17111752             
    17121753              if (_param->_have_port_depth)
     1754                {
    17131755              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    17141756              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     1757                }
    17151758            }
    17161759          }
     
    17381781
    17391782                  if (_param->_have_port_depth)
     1783                    {
    17401784                  TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    17411785                  TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
    1742                  
     1786                    }
    17431787                  SC_START(0);
    17441788                 
     
    17721816             
    17731817              if (_param->_have_port_depth)
     1818                {
    17741819              TEST(Tdepth_t,out_DEPTH_MIN [context]->read(), upt_bottom [context]);
    17751820              TEST(Tdepth_t,out_DEPTH_MAX [context]->read(), upt_top [context]);
     1821                }
    17761822            }
    17771823          }
     
    21762222
    21772223  // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     2224  delete [] out_DEPTH_VAL;
    21782225  delete [] out_DEPTH_CURRENT;
    21792226  delete [] out_DEPTH_MIN;
    21802227  delete [] out_DEPTH_MAX;
     2228  delete [] out_DEPTH_FULL;
    21812229
    21822230#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h

    r95 r101  
    2626      EVENT_STATE_FLUSH_UPT             , // in commit stage, detect a miss, context is stop and ufpt is flush, update RAS
    2727      EVENT_STATE_UPDATE_CONTEXT        , // prediction unit is update, send signal to context manager
    28       EVENT_STATE_WAIT_END_EVENT          // prediction unit is ok, wait the end of envent (send by Context State)
     28      EVENT_STATE_WAIT_END_EVENT          // prediction unit is ok, wait the end of event (send by Context State)
    2929    } event_state_t;
    3030
     
    4545      UPDATE_PREDICTION_STATE_EVENT             , // previous branch is a miss prediction
    4646      UPDATE_PREDICTION_STATE_END_OK            , // branch is updated,       update pointer
     47      UPDATE_PREDICTION_STATE_END_KO_WAIT_END   , // branch is updated, don't update pointer
    4748      UPDATE_PREDICTION_STATE_END_KO              // branch is updated, don't update pointer
    4849    } upt_state_t;
     
    147148      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_EVENT      : return "event"     ; break;
    148149      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_OK     : return "end_ok"    ; break;
     150      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;
    149151      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_KO     : return "end_ko"    ; break;
    150152      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

    r98 r101  
    148148
    149149    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     150  public    : SC_OUT(Tcontrol_t         )  ** out_DEPTH_VAL                      ; //[nb_context]
    150151  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_CURRENT                  ; //[nb_context]
    151152  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_MIN                      ; //[nb_context]
    152153  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_MAX                      ; //[nb_context]
     154  public    : SC_OUT(Tcontrol_t         )  ** out_DEPTH_FULL                     ; //[nb_context]
    153155    // If DEPTH_CURRENT :
    154156    // equal at     DEPTH_MIN            -> not speculative
     
    172174  private   : uint32_t                      * reg_UPT_TOP_EVENT                  ; //[nb_context]
    173175  private   : uint32_t                      * reg_UPT_UPDATE                     ; //[nb_context]
     176  private   : bool                          * reg_UPT_EMPTY                      ; //[nb_context]
    174177                                                                                             
    175178  private   : bool                          * reg_IS_ACCURATE                    ; //[nb_context]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp

    r98 r101  
    160160    {
    161161      ALLOC1_INTERFACE("depth",OUT,SOUTH, "depth", _param->_nb_context);
    162       ALLOC1_SIGNAL_OUT(out_DEPTH_CURRENT,"CURRENT",Tdepth_t,_param->_size_depth);
    163       ALLOC1_SIGNAL_OUT(out_DEPTH_MIN    ,"MIN"    ,Tdepth_t,_param->_size_depth);
    164       ALLOC1_SIGNAL_OUT(out_DEPTH_MAX    ,"MAX"    ,Tdepth_t,_param->_size_depth+1);
     162      ALLOC1_SIGNAL_OUT(out_DEPTH_VAL    ,"VAL"    ,Tcontrol_t,1);
     163      ALLOC1_SIGNAL_OUT(out_DEPTH_CURRENT,"CURRENT",Tdepth_t  ,_param->_size_depth);
     164      ALLOC1_SIGNAL_OUT(out_DEPTH_MIN    ,"MIN"    ,Tdepth_t  ,_param->_size_depth);
     165      ALLOC1_SIGNAL_OUT(out_DEPTH_MAX    ,"MAX"    ,Tdepth_t  ,_param->_size_depth);
     166      ALLOC1_SIGNAL_OUT(out_DEPTH_FULL   ,"FULL"   ,Tcontrol_t,1);
    165167    }
    166168
     
    201203    ALLOC1(reg_UPT_TOP_EVENT                ,uint32_t     ,_param->_nb_context);
    202204    ALLOC1(reg_UPT_UPDATE                   ,uint32_t     ,_param->_nb_context);
     205    ALLOC1(reg_UPT_EMPTY                    ,bool         ,_param->_nb_context);
    203206
    204207    ALLOC1(reg_EVENT_STATE                  ,event_state_t,_param->_nb_context);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp

    r98 r101  
    117117
    118118        // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     119        DELETE1_SIGNAL(out_DEPTH_VAL          ,_param->_nb_context,1);
    119120        DELETE1_SIGNAL(out_DEPTH_CURRENT      ,_param->_nb_context,_param->_size_depth);
    120121        DELETE1_SIGNAL(out_DEPTH_MIN          ,_param->_nb_context,_param->_size_depth);
    121         DELETE1_SIGNAL(out_DEPTH_MAX          ,_param->_nb_context,_param->_size_depth+1);
     122        DELETE1_SIGNAL(out_DEPTH_MAX          ,_param->_nb_context,_param->_size_depth);
     123        DELETE1_SIGNAL(out_DEPTH_FULL         ,_param->_nb_context,1);
    122124
    123125        // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    154156        DELETE1(reg_UPT_TOP_EVENT                ,_param->_nb_context);
    155157        DELETE1(reg_UPT_UPDATE                   ,_param->_nb_context);
     158        DELETE1(reg_UPT_EMPTY                    ,_param->_nb_context);
    156159       
    157160        DELETE1(reg_EVENT_STATE                  ,_param->_nb_context);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp

    r98 r101  
    3434    for (uint32_t i=0; i<_param->_nb_context; i++)
    3535      {
     36        // is a valid instruction ?
     37        // If DEPTH_CURRENT :
     38        // equal at     DEPTH_MIN            -> not speculative
     39        // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss
     40        //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
     41
     42        PORT_WRITE(out_DEPTH_VAL     [i],(reg_UPDATE_PREDICTION_TABLE [i][reg_UPT_TOP [i]]._state == UPDATE_PREDICTION_STATE_EMPTY));
    3643        if (_param->_have_port_depth)
    3744          {
    3845        PORT_WRITE(out_DEPTH_CURRENT [i], reg_UPT_TOP    [i]);
    3946        PORT_WRITE(out_DEPTH_MIN     [i], reg_UPT_BOTTOM [i]);
    40           }
    4147        PORT_WRITE(out_DEPTH_MAX     [i], reg_UPT_TOP    [i]);
     48          }
     49        PORT_WRITE(out_DEPTH_FULL    [i], not reg_UPT_EMPTY [i] and (reg_UPT_TOP [i] == reg_UPT_BOTTOM [i]));
     50
     51//         bool empty = reg_UPT_EMPTY [i];
     52//      PORT_WRITE(out_DEPTH_MAX     [i], ((empty)?reg_UPT_BOTTOM [i]:((reg_UPT_TOP [i]==0)?(_param->_size_upt_queue[i]-1):(reg_UPT_TOP [i]-1))));
    4253      }
    4354
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp

    r98 r101  
    4646            reg_UPT_TOP_EVENT        [i] = 0;
    4747            reg_UPT_UPDATE           [i] = 0;
     48            reg_UPT_EMPTY            [i] = true;
    4849                                                                                   
    4950            reg_IS_ACCURATE          [i] = true;
     
    8788            // UPDATE_PREDICTION_TABLE
    8889            {
    89               uint32_t bottom = reg_UPT_BOTTOM [i];
    90               bool     end_ok = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_OK);
    91               bool     end_ko = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_KO);
     90              uint32_t      bottom      = reg_UPT_BOTTOM [i];
     91              bool          end_ok      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_OK);
     92              bool          end_ko      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_KO);
     93//               event_state_t event_state = reg_EVENT_STATE [i];
    9294
    9395              // Test if state is end
     96//               if ((end_ok or end_ko) and
     97//                   ((event_state != EVENT_STATE_UPDATE_CONTEXT) and
     98//                    (event_state != EVENT_STATE_WAIT_END_EVENT)))
    9499              if (end_ok or end_ko)
    95100                {
     
    102107                  // Update pointer
    103108                  reg_UPT_BOTTOM [i] = (bottom+1)%_param->_size_upt_queue[i];
     109
     110                  if (reg_UPT_BOTTOM [i] == reg_UPT_TOP [i])
     111                    reg_UPT_EMPTY [i] = true; // free a slot
     112
    104113//                   if (bottom = reg_UPT_UPDATE [i])
    105114//                     reg_UPT_UPDATE [i] = reg_UPT_BOTTOM [i];
     
    108117                      reg_UPT_TOP    [i] = reg_UPT_TOP_EVENT [i];
    109118                      reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i];
     119
     120                      if (reg_UPT_BOTTOM [i] != reg_UPT_TOP [i])
     121                        reg_UPT_EMPTY [i] = false;
    110122                    }
    111123                }
     
    290302              // Update pointer
    291303              reg_UPT_TOP     [context] = (upt_ptr_write+1)%_param->_size_upt_queue [context];
     304              reg_UPT_EMPTY   [context] = false;
    292305//            reg_UPT_UPDATE  [context] = reg_UPT_TOP [context];
    293306            }
     
    338351                  reg_UPT_TOP_EVENT [context] = top;
    339352
     353                  if (reg_UPT_BOTTOM [context] == reg_UPT_TOP [context])
     354                    reg_UPT_EMPTY [i] = true;
     355
    340356#ifdef DEBUG_TEST
    341357                  if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state != UPDATE_PREDICTION_STATE_WAIT_END)
     
    483499                      if (ko)
    484500                        {
     501                          // Ko : wait end of all instruction
     502//                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO_WAIT_END (update)",context,depth);
     503                         
     504//                           reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_KO_WAIT_END;
     505
    485506                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",context,depth);
    486507                         
     
    535556                     
    536557                      // Free the branch with no accurate ?
    537                       if (reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false)
     558                      if ( (reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko)
    538559                        reg_IS_ACCURATE [context] = true;
    539560                    }
     
    587608//            Tdepth_t       depth       = PORT_READ(in_EVENT_DEPTH [i]);
    588609           
    589               // Test if end of miss
     610              // Test if end of miss -> all previous branch is complete
     611              //                     -> all next     branch is finish
    590612              if (event_type  == EVENT_TYPE_MISS_SPECULATION)
    591613                {
     
    602624                 
    603625                  reg_EVENT_STATE [i] = EVENT_STATE_OK;
     626                  reg_IS_ACCURATE [i] = true;
     627
     628//                   Tdepth_t depth = reg_UPT_TOP [i];
     629
     630#ifdef DEBUG_TEST
     631//                   if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO_WAIT_END)
     632//                     throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
     633//                   if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO)
     634//                     throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
     635#endif
     636                 
     637//                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",i,depth);
     638                         
     639//                   reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
     640
    604641                }
    605642            }
     
    699736        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_TOP_EVENT       : %d",reg_UPT_TOP_EVENT      [i]);
    700737        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE          : %d",reg_UPT_UPDATE         [i]);
     738        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_EMPTY           : %d",reg_UPT_EMPTY          [i]);
    701739        for (uint32_t j=0; j<_param->_size_upt_queue[i]; j++)
    702740          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"        [%d] %.4d, %.8x %.8x, %.1d %.1d %.1d, %.8d %.8x %.4d - %s",
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/include/Prediction_unit.h

    r98 r101  
    121121
    122122    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
     123  public    : SC_OUT(Tcontrol_t         )  ** out_DEPTH_VAL                           ; //[nb_context]
    123124  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_CURRENT                       ; //[nb_context]
    124125  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_MIN                           ; //[nb_context]
    125126  public    : SC_OUT(Tdepth_t           )  ** out_DEPTH_MAX                           ; //[nb_context]
     127  public    : SC_OUT(Tcontrol_t         )  ** out_DEPTH_FULL                          ; //[nb_context]
    126128
    127129    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_allocation.cpp

    r98 r101  
    127127      ALLOC1_INTERFACE("depth",OUT,SOUTH,"Interface with depth",_param->_nb_context);
    128128
    129       ALLOC1_SIGNAL_OUT(out_DEPTH_CURRENT      ,"current"      ,Tdepth_t,_param->_size_depth);
    130       ALLOC1_SIGNAL_OUT(out_DEPTH_MIN          ,"min"          ,Tdepth_t,_param->_size_depth);
    131       ALLOC1_SIGNAL_OUT(out_DEPTH_MAX          ,"max"          ,Tdepth_t,_param->_size_depth+1);
     129      ALLOC1_SIGNAL_OUT(out_DEPTH_VAL          ,"val"          ,Tcontrol_t,1);
     130      ALLOC1_SIGNAL_OUT(out_DEPTH_CURRENT      ,"current"      ,Tdepth_t  ,_param->_size_depth);
     131      ALLOC1_SIGNAL_OUT(out_DEPTH_MIN          ,"min"          ,Tdepth_t  ,_param->_size_depth);
     132      ALLOC1_SIGNAL_OUT(out_DEPTH_MAX          ,"max"          ,Tdepth_t  ,_param->_size_depth);
     133      ALLOC1_SIGNAL_OUT(out_DEPTH_FULL         ,"full"         ,Tcontrol_t,1);
    132134    }
    133135
     
    729731#endif
    730732         
     733          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_VAL",
     734                              dest,"out_DEPTH_"+toString(i)+"_VAL");
     735          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_FULL",
     736                              dest,"out_DEPTH_"+toString(i)+"_FULL");
    731737          if (_param->_have_port_depth)
    732738            {
     
    735741          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MIN",
    736742                              dest,"out_DEPTH_"+toString(i)+"_MIN");
    737             }
    738743          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MAX",
    739744                              dest,"out_DEPTH_"+toString(i)+"_MAX");
     745            }
    740746        }
    741747
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_deallocation.cpp

    r98 r101  
    7676        DELETE1_SIGNAL( in_EVENT_DEPTH  ,_param->_nb_context,_param->_size_depth      );
    7777
     78        DELETE1_SIGNAL(out_DEPTH_VAL          ,_param->_nb_context,1);
    7879        DELETE1_SIGNAL(out_DEPTH_CURRENT      ,_param->_nb_context,_param->_size_depth);
    7980        DELETE1_SIGNAL(out_DEPTH_MIN          ,_param->_nb_context,_param->_size_depth);
    80         DELETE1_SIGNAL(out_DEPTH_MAX          ,_param->_nb_context,_param->_size_depth+1);
     81        DELETE1_SIGNAL(out_DEPTH_MAX          ,_param->_nb_context,_param->_size_depth);
     82        DELETE1_SIGNAL(out_DEPTH_FULL         ,_param->_nb_context,1);
    8183      }
    8284    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/SelfTest/src/test.cpp

    r98 r101  
    117117  ALLOC1_SC_SIGNAL(out_DEPTH_MIN                      ,"out_DEPTH_MIN                      ",Tdepth_t             ,_param->_nb_context);
    118118  ALLOC1_SC_SIGNAL(out_DEPTH_MAX                      ,"out_DEPTH_MAX                      ",Tdepth_t             ,_param->_nb_context);
     119  ALLOC1_SC_SIGNAL(out_DEPTH_FULL                     ,"out_DEPTH_FULL                     ",Tcontrol_t           ,_param->_nb_context);
    119120  ALLOC1_SC_SIGNAL( in_SPR_SR_IEE                     ," in_SPR_SR_IEE                     ",Tcontrol_t           ,_param->_nb_context);
    120121  ALLOC1_SC_SIGNAL( in_SPR_SR_EPH                     ," in_SPR_SR_EPH                     ",Tcontrol_t           ,_param->_nb_context);
     
    206207  INSTANCE1_SC_SIGNAL(_Front_end, in_NB_INST_COMMIT_MEM             ,_param->_nb_context);
    207208  if (_param->_have_port_depth)
     209    {
    208210  INSTANCE1_SC_SIGNAL(_Front_end,out_DEPTH_MIN                      ,_param->_nb_context);
    209211  INSTANCE1_SC_SIGNAL(_Front_end,out_DEPTH_MAX                      ,_param->_nb_context);
     212    }
     213  INSTANCE1_SC_SIGNAL(_Front_end,out_DEPTH_FULL                     ,_param->_nb_context);
    210214  INSTANCE1_SC_SIGNAL(_Front_end, in_SPR_SR_IEE                     ,_param->_nb_context);
    211215  INSTANCE1_SC_SIGNAL(_Front_end, in_SPR_SR_EPH                     ,_param->_nb_context);
     
    257261      TEST(Tdepth_t  ,out_DEPTH_MIN           [i]->read(),0); // no branch speculated
    258262      TEST(Tdepth_t  ,out_DEPTH_MAX           [i]->read(),0); // no branch speculated
     263      TEST(Tdepth_t  ,out_DEPTH_FULL          [i]->read(),0); // no branch speculated
    259264    }
    260265  for (uint32_t i=0; i<_param->_sum_inst_decod; ++i)
     
    359364  DELETE1_SC_SIGNAL(out_DEPTH_MIN                      ,_param->_nb_context);
    360365  DELETE1_SC_SIGNAL(out_DEPTH_MAX                      ,_param->_nb_context);
     366  DELETE1_SC_SIGNAL(out_DEPTH_FULL                     ,_param->_nb_context);
    361367  DELETE1_SC_SIGNAL( in_SPR_SR_IEE                     ,_param->_nb_context);
    362368  DELETE1_SC_SIGNAL( in_SPR_SR_EPH                     ,_param->_nb_context);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/include/Front_end.h

    r98 r101  
    155155  public    : SC_OUT(Tdepth_t             ) ** out_DEPTH_MIN                        ;//[nb_context]
    156156  public    : SC_OUT(Tdepth_t             ) ** out_DEPTH_MAX                        ;//[nb_context]
     157  public    : SC_OUT(Tcontrol_t           ) ** out_DEPTH_FULL                       ;//[nb_context]
    157158
    158159    // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Front_end_allocation.cpp

    r98 r101  
    180180      ALLOC1_INTERFACE("depth",OUT,EAST,_("Interface depth"),_param->_nb_context);
    181181
    182       ALLOC1_SIGNAL_OUT (out_DEPTH_MIN                        ,"MIN"              ,Tdepth_t             ,_param->_size_depth  );
    183       ALLOC1_SIGNAL_OUT (out_DEPTH_MAX                        ,"MAX"              ,Tdepth_t             ,_param->_size_depth+1);
     182      ALLOC1_SIGNAL_OUT (out_DEPTH_MIN                        ,"MIN"              ,Tdepth_t             ,_param->_size_depth);
     183      ALLOC1_SIGNAL_OUT (out_DEPTH_MAX                        ,"MAX"              ,Tdepth_t             ,_param->_size_depth);
     184      ALLOC1_SIGNAL_OUT (out_DEPTH_FULL                       ,"FULL"             ,Tcontrol_t           ,1);
    184185    }
    185186
     
    611612#endif
    612613
     614          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_VAL",
     615                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_VAL");
    613616          if (_param->_have_port_depth)
    614617            {
     
    617620          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_MIN"    ,
    618621                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_MIN"    );
    619             }
    620622          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_MAX"    ,
    621623                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_MAX"    );
     624            }
     625          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+                "_FULL"   ,
     626                                   dest, "in_DEPTH_"+toString(i)+"_PREDICTION_UNIT_FULL"   );
    622627        }
    623628    }
     
    787792
    788793          if (_param->_have_port_depth)
     794            {
    789795          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+                           "_MIN",
    790796                                   dest,"out_DEPTH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_MIN");
    791797          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+                           "_MAX",
    792798                                   dest,"out_DEPTH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_MAX");
     799            }
     800          COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+                           "_FULL",
     801                                   dest,"out_DEPTH_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_FULL");
     802         
    793803        }
    794804
     
    828838#endif
    829839
     840          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+                           "_DEPTH_VAL",
     841                                   dest,"out_CONTEXT_"+toString(i)+"_"+toString(j)+"_DECOD_UNIT_DEPTH_VAL");
    830842          if (_param->_have_port_depth)
    831843          COMPONENT_MAP(_component,src , "in_CONTEXT_"+toString(j)+                           "_DEPTH",
     
    11801192
    11811193          if (_param->_have_port_depth)
     1194            {
    11821195          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MIN",
    11831196                              dest,"out_DEPTH_"+toString(i)+"_MIN");
    11841197          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MAX",
    11851198                              dest,"out_DEPTH_"+toString(i)+"_MAX");
    1186         }
    1187      
     1199            }
     1200          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_FULL",
     1201                              dest,"out_DEPTH_"+toString(i)+"_FULL");
     1202        }
     1203     
     1204      //   in_DEPTH_PREDICTION_UNIT_VAL                         - component_prediction_unit
    11881205      //   in_DEPTH_PREDICTION_UNIT_CURRENT                     - component_prediction_unit
    11891206      //   in_DEPTH_PREDICTION_UNIT_MIN                         - component_prediction_unit
    11901207      //   in_DEPTH_PREDICTION_UNIT_MAX                         - component_prediction_unit
     1208      //   in_DEPTH_PREDICTION_UNIT_FULL                        - component_prediction_unit
    11911209      //  out_DEPTH_DECOD_UNIT_MIN                              - component_decod_unit
    11921210      //  out_DEPTH_DECOD_UNIT_MAX                              - component_decod_unit
     1211      //  out_DEPTH_DECOD_UNIT_FULL                             - component_decod_unit
    11931212      //  out_DEPTH_CONTEXT_STATE_MIN                           - component_context_state
    11941213     
    11951214      // ~~~~~[ Interface : "context"" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1215      //  out_CONTEXT_DECOD_UNIT_DEPTH_VAL                      - component_decod_unit
    11961216      //  out_CONTEXT_DECOD_UNIT_DEPTH                          - component_decod_unit
    11971217    }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Front_end_deallocation.cpp

    r98 r101  
    104104        DELETE1_SIGNAL(out_DEPTH_MIN                        ,_param->_nb_context,_param->_size_depth  );
    105105        DELETE1_SIGNAL(out_DEPTH_MAX                        ,_param->_nb_context,_param->_size_depth+1);
     106        DELETE1_SIGNAL(out_DEPTH_FULL                       ,_param->_nb_context,_param->_size_depth+1);
    106107
    107108        DELETE1_SIGNAL( in_SPR_SR_IEE                       ,_param->_nb_context,1);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/SelfTest/src/test.cpp

    r98 r101  
    164164  ALLOC2_SC_SIGNAL( in_DEPTH_MIN                      ," in_DEPTH_MIN                      ",Tdepth_t          ,_param->_nb_front_end,_param->_nb_context[it1]);
    165165  ALLOC2_SC_SIGNAL( in_DEPTH_MAX                      ," in_DEPTH_MAX                      ",Tdepth_t          ,_param->_nb_front_end,_param->_nb_context[it1]);
     166  ALLOC2_SC_SIGNAL( in_DEPTH_FULL                     ," in_DEPTH_FULL                     ",Tcontrol_t        ,_param->_nb_front_end,_param->_nb_context[it1]);
    166167
    167168  ALLOC2_SC_SIGNAL( in_SPR_READ_SR_OVE                ," in_SPR_READ_SR_OVE                ",Tcontrol_t        ,_param->_nb_front_end,_param->_nb_context[it1]);
     
    308309  INSTANCE2_SC_SIGNAL(_Commit_unit,out_NB_INST_COMMIT_ALL             ,_param->_nb_front_end,_param->_nb_context[it1]);
    309310  INSTANCE2_SC_SIGNAL(_Commit_unit,out_NB_INST_COMMIT_MEM             ,_param->_nb_front_end,_param->_nb_context[it1]);
     311 
     312  if (_param->_have_port_depth)
     313    {
     314  INSTANCE2_SC_SIGNAL(_Commit_unit, in_DEPTH_MIN                      ,_param->_nb_front_end,_param->_nb_context[it1]);
    310315  INSTANCE2_SC_SIGNAL(_Commit_unit, in_DEPTH_MAX                      ,_param->_nb_front_end,_param->_nb_context[it1]);
     316    }
     317  INSTANCE2_SC_SIGNAL(_Commit_unit, in_DEPTH_FULL                     ,_param->_nb_front_end,_param->_nb_context[it1]);
    311318
    312319  INSTANCE2_SC_SIGNAL(_Commit_unit, in_SPR_READ_SR_OVE                ,_param->_nb_front_end,_param->_nb_context[it1]);
     
    321328  INSTANCE2_SC_SIGNAL(_Commit_unit,out_SPR_WRITE_SR_OV                ,_param->_nb_front_end,_param->_nb_context[it1]);
    322329
    323   for (uint32_t i=0; i<_param->_nb_front_end; i++)
    324     for (uint32_t j=0; j<_param->_nb_context[i]; j++)
    325       if (_param->_have_port_depth)
    326         INSTANCE_SC_SIGNAL(_Commit_unit, in_DEPTH_MIN  [i][j]);
    327  
    328330  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
    329331   
     
    703705  DELETE2_SC_SIGNAL( in_DEPTH_MIN                      ,_param->_nb_front_end,_param->_nb_context[it1]);
    704706  DELETE2_SC_SIGNAL( in_DEPTH_MAX                      ,_param->_nb_front_end,_param->_nb_context[it1]);
     707  DELETE2_SC_SIGNAL( in_DEPTH_FULL                     ,_param->_nb_front_end,_param->_nb_context[it1]);
    705708
    706709  DELETE2_SC_SIGNAL( in_SPR_READ_SR_OVE                ,_param->_nb_front_end,_param->_nb_context[it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Commit_unit.h

    r100 r101  
    194194  public    : SC_IN (Tdepth_t           ) ***  in_DEPTH_MIN                        ;//[nb_front_end][nb_context]
    195195  public    : SC_IN (Tdepth_t           ) ***  in_DEPTH_MAX                        ;//[nb_front_end][nb_context]
     196  public    : SC_IN (Tcontrol_t         ) ***  in_DEPTH_FULL                       ;//[nb_front_end][nb_context]
    196197
    197198    // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_allocation.cpp

    r100 r101  
    213213      ALLOC2_INTERFACE("depth",IN,WEST,_("Interface with Prediction unit."),_param->_nb_front_end, _param->_nb_context[it1]);
    214214
    215       _ALLOC2_SIGNAL_IN ( in_DEPTH_MIN                     ,"min"      ,Tdepth_t           ,_param->_size_depth  ,_param->_nb_front_end, _param->_nb_context[it1]);
    216       _ALLOC2_SIGNAL_IN ( in_DEPTH_MAX                     ,"max"      ,Tdepth_t           ,_param->_size_depth+1,_param->_nb_front_end, _param->_nb_context[it1]);
     215      _ALLOC2_SIGNAL_IN ( in_DEPTH_MIN                     ,"min"      ,Tdepth_t           ,_param->_size_depth,_param->_nb_front_end, _param->_nb_context[it1]);
     216      _ALLOC2_SIGNAL_IN ( in_DEPTH_MAX                     ,"max"      ,Tdepth_t           ,_param->_size_depth,_param->_nb_front_end, _param->_nb_context[it1]);
     217      _ALLOC2_SIGNAL_IN ( in_DEPTH_FULL                    ,"full"     ,Tcontrol_t         ,1                  ,_param->_nb_front_end, _param->_nb_context[it1]);
    217218    }
    218219
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_deallocation.cpp

    r100 r101  
    140140        DELETE2_SIGNAL(out_NB_INST_COMMIT_MEM             ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_nb_inst_commit);
    141141
    142         DELETE2_SIGNAL( in_DEPTH_MIN                      ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_depth  );
    143         DELETE2_SIGNAL( in_DEPTH_MAX                      ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_depth+1);
     142        DELETE2_SIGNAL( in_DEPTH_MIN                      ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_depth);
     143        DELETE2_SIGNAL( in_DEPTH_MAX                      ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_depth);
     144        DELETE2_SIGNAL( in_DEPTH_FULL                     ,_param->_nb_front_end, _param->_nb_context[it1],1);
    144145
    145146        DELETE2_SIGNAL( in_SPR_READ_SR_OVE                ,_param->_nb_front_end, _param->_nb_context[it1],1);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp

    r100 r101  
    347347        if (internal_REEXECUTE_VAL [0] and PORT_READ(in_REEXECUTE_ACK [0]))
    348348          {
     349            log_printf(TRACE,Commit_unit,FUNCTION,"  * REEXECUTE         [0]");
     350
    349351            uint32_t num_bank = internal_REEXECUTE_NUM_BANK [0];
    350352
     
    368370          if (internal_BRANCH_COMPLETE_VAL [i] and PORT_READ(in_BRANCH_COMPLETE_ACK [i]))
    369371            {
     372              log_printf(TRACE,Commit_unit,FUNCTION,"  * BRANCH_COMPLETE   [%d]",i);
     373              log_printf(TRACE,Commit_unit,FUNCTION,"    * miss_prediction : %d",PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i]));
     374
    370375              uint32_t num_bank = internal_BRANCH_COMPLETE_NUM_BANK [i];
    371376             
     
    378383#endif
    379384
    380               entry->state = (PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i]))?ROB_END_OK_SPECULATIVE:ROB_END_BRANCH_MISS_SPECULATIVE;
     385              entry->state = (PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i]))?ROB_END_BRANCH_MISS_SPECULATIVE:ROB_END_OK_SPECULATIVE;
    381386//               entry->state = ROB_END_OK_SPECULATIVE;
    382387            }
     
    410415              Tdepth_t     depth        = entry->depth;
    411416
    412               Tdepth_t     depth_min    = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [front_end_id][context_id]):0;
    413               Tdepth_t     depth_max    = PORT_READ(in_DEPTH_MAX[front_end_id][context_id]);
     417              Tdepth_t     depth_min    = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN[front_end_id][context_id]):0;
     418              Tdepth_t     depth_max    = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX[front_end_id][context_id]):0;
     419              Tcontrol_t   depth_full   = PORT_READ(in_DEPTH_FULL [front_end_id][context_id]);
    414420             
    415421              // is a valid instruction ?
    416422              // If DEPTH_CURRENT :
    417423              // equal at     DEPTH_MIN            -> not speculative
    418               // not include ]DEPTH_MIN:DEPTH_MAX[ -> previous branch miss
    419               //     include ]DEPTH_MIN:DEPTH_MAX[ -> speculative
     424              // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss
     425              //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
    420426             
    421427              // All case
     
    428434             
    429435              Tcontrol_t   is_valid      = ((depth == depth_min) or
    430                                             ((depth_min < depth_max)?
    431                                              (depth<depth_max):
    432                                              ((depth > depth_min) or (depth < depth_max))));
    433              
     436                                            depth_full or
     437                                            ((depth_min <= depth_max)?
     438                                             ((depth >= depth_min) and (depth <=depth_max)):
     439                                             ((depth >= depth_min) or  (depth <=depth_max))));
     440
     441              log_printf(TRACE,Commit_unit,FUNCTION,"  * HEAD              [%d]",i);
     442              log_printf(TRACE,Commit_unit,FUNCTION,"    * is_valid        : %d",is_valid);
     443              log_printf(TRACE,Commit_unit,FUNCTION,"    * depth           : %d",depth    );
     444              log_printf(TRACE,Commit_unit,FUNCTION,"    * depth_min       : %d",depth_min);
     445              log_printf(TRACE,Commit_unit,FUNCTION,"    * depth_max       : %d",depth_max);
     446
    434447              //------------------------------------------------------
    435448              // test if instruction is miss speculative
     
    542555                       toString((*it)->state).c_str() ,
    543556                       (*it)->ptr                     );
    544             log_printf(TRACE,Commit_unit,FUNCTION,"             %.1d %.5d %.6d, %.1d %.5d %.6d, %.1d %.5d %.6d, %.1d %.1d %.6d %.6d, %.1d %.1d %.6d %.6d ",
     557            log_printf(TRACE,Commit_unit,FUNCTION,"             %.1d %.2d %.6d, %.1d %.2d %.6d, %.1d %.1d %.6d, %.1d %.2d %.6d %.6d, %.1d %.1d %.6d %.6d ",
    545558                       (*it)->read_ra                 ,
    546559                       (*it)->num_reg_ra_log          ,
     
    562575           
    563576            log_printf(TRACE,Commit_unit,FUNCTION,"             %.2d %.2d %.1d %.1d %.8x",
     577                       (*it)->exception_use ,
    564578                       (*it)->exception     ,
    565                        (*it)->exception_use ,
    566579                       (*it)->flags         ,
    567580                       (*it)->no_sequence   ,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/src/Reexecute_unit_transition.cpp

    r98 r101  
    8686                {
    8787                  entry->data     =     PORT_READ(in_SPR_RDATA   [i]);
    88                   entry->write_rd = not PORT_READ(in_SPR_INVALID [i]);
     88//                entry->write_rd = not PORT_READ(in_SPR_INVALID [i]); // in all case write value
    8989                }
    9090
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_translation_unit_Glue/src/Register_translation_unit_Glue_genMealy_insert.cpp

    r98 r101  
    3636        Tcontrol_t         WRITE_RD           = PORT_READ(in_INSERT_DEPENDENCY_CHECKING_WRITE_RD           [i]);
    3737        Tgeneral_address_t NUM_REG_RD_LOG     = PORT_READ(in_INSERT_DEPENDENCY_CHECKING_NUM_REG_RD_LOG     [i]);
    38         Tgeneral_address_t NUM_REG_RD_PHY_OLD = (NUM_REG_RD_LOG!=0)?PORT_READ(in_INSERT_DEPENDENCY_CHECKING_NUM_REG_RD_PHY_OLD [i]):0;
    39         Tgeneral_address_t NUM_REG_RD_PHY_NEW = (NUM_REG_RD_LOG!=0)?PORT_READ(in_INSERT_DEPENDENCY_CHECKING_NUM_REG_RD_PHY_NEW [i]):0;
     38//      Tgeneral_address_t NUM_REG_RD_PHY_OLD = (NUM_REG_RD_LOG!=0)?PORT_READ(in_INSERT_DEPENDENCY_CHECKING_NUM_REG_RD_PHY_OLD [i]):0;
     39//      Tgeneral_address_t NUM_REG_RD_PHY_NEW = (NUM_REG_RD_LOG!=0)?PORT_READ(in_INSERT_DEPENDENCY_CHECKING_NUM_REG_RD_PHY_NEW [i]):0;
     40        Tgeneral_address_t NUM_REG_RD_PHY_OLD = PORT_READ(in_INSERT_DEPENDENCY_CHECKING_NUM_REG_RD_PHY_OLD [i]);
     41        Tgeneral_address_t NUM_REG_RD_PHY_NEW = PORT_READ(in_INSERT_DEPENDENCY_CHECKING_NUM_REG_RD_PHY_NEW [i]);
    4042        Tcontrol_t         WRITE_RE           = PORT_READ(in_INSERT_DEPENDENCY_CHECKING_WRITE_RE           [i]);
    4143        Tspecial_address_t NUM_REG_RE_LOG     = PORT_READ(in_INSERT_DEPENDENCY_CHECKING_NUM_REG_RE_LOG     [i]);
     
    4345        Tspecial_address_t NUM_REG_RE_PHY_NEW = PORT_READ(in_INSERT_DEPENDENCY_CHECKING_NUM_REG_RE_PHY_NEW [i]);
    4446
    45         PORT_WRITE(out_INSERT_FREE_LIST_GPR_VAL            [i], WRITE_RD and (NUM_REG_RD_LOG!=0));
     47//      PORT_WRITE(out_INSERT_FREE_LIST_GPR_VAL            [i], WRITE_RD and (NUM_REG_RD_LOG!=0));
     48        PORT_WRITE(out_INSERT_FREE_LIST_GPR_VAL            [i], WRITE_RD          );
    4649        PORT_WRITE(out_INSERT_FREE_LIST_SPR_VAL            [i], WRITE_RE          );
    4750
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/SelfTest/src/test.cpp

    r98 r101  
    167167  ALLOC2_SC_SIGNAL( in_DEPTH_MIN                        ," in_DEPTH_MIN                        ",Tdepth_t          ,_param->_nb_front_end,_param->_nb_context[it1]);
    168168  ALLOC2_SC_SIGNAL( in_DEPTH_MAX                        ," in_DEPTH_MAX                        ",Tdepth_t          ,_param->_nb_front_end,_param->_nb_context[it1]);
     169  ALLOC2_SC_SIGNAL( in_DEPTH_FULL                       ," in_DEPTH_FULL                       ",Tcontrol_t        ,_param->_nb_front_end,_param->_nb_context[it1]);
    169170
    170171  ALLOC2_SC_SIGNAL(out_SPR_SR_IEE                       ,"out_SPR_SR_IEE                       ",Tcontrol_t        ,_param->_nb_front_end,_param->_nb_context[it1]);
     
    313314  INSTANCE2_SC_SIGNAL(_OOO_Engine,out_NB_INST_COMMIT_MEM               ,_param->_nb_front_end,_param->_nb_context[it1]);
    314315 
    315   for (uint32_t i=0; i<_param->_nb_front_end; i++)
    316     for (uint32_t j=0; j<_param->_nb_context[i]; j++)
    317       if (_param->_have_port_depth)
    318         INSTANCE_SC_SIGNAL(_OOO_Engine, in_DEPTH_MIN  [i][j]);
     316  if (_param->_have_port_depth)
     317    {
     318  INSTANCE2_SC_SIGNAL(_OOO_Engine, in_DEPTH_MIN                        ,_param->_nb_front_end,_param->_nb_context[it1]);
    319319  INSTANCE2_SC_SIGNAL(_OOO_Engine, in_DEPTH_MAX                        ,_param->_nb_front_end,_param->_nb_context[it1]);
    320 
     320    }
     321  INSTANCE2_SC_SIGNAL(_OOO_Engine, in_DEPTH_FULL                       ,_param->_nb_front_end,_param->_nb_context[it1]);
    321322  INSTANCE2_SC_SIGNAL(_OOO_Engine,out_SPR_SR_IEE                       ,_param->_nb_front_end,_param->_nb_context[it1]);
    322323  INSTANCE2_SC_SIGNAL(_OOO_Engine,out_SPR_SR_EPH                       ,_param->_nb_front_end,_param->_nb_context[it1]);
     
    482483  DELETE2_SC_SIGNAL( in_DEPTH_MIN                        ,_param->_nb_front_end,_param->_nb_context[it1]);
    483484  DELETE2_SC_SIGNAL( in_DEPTH_MAX                        ,_param->_nb_front_end,_param->_nb_context[it1]);
     485  DELETE2_SC_SIGNAL( in_DEPTH_FULL                       ,_param->_nb_front_end,_param->_nb_context[it1]);
    484486  DELETE2_SC_SIGNAL(out_SPR_SR_IEE                       ,_param->_nb_front_end,_param->_nb_context[it1]);
    485487  DELETE2_SC_SIGNAL(out_SPR_SR_EPH                       ,_param->_nb_front_end,_param->_nb_context[it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/include/SPR.h

    r98 r101  
    478478
    479479  //----------------------------------------------------------
    480   // [0][19] CID
    481   //----------------------------------------------------------
    482   class CID : public GENERIC
    483   {
    484   public : CID (uint32_t num_front_end=0, uint32_t num_context=0,const Parameters * param=NULL) : GENERIC (num_front_end,num_context,param) {};
    485   };
    486 
    487   //----------------------------------------------------------
    488480  // [0][20] FPCSR
    489481  //----------------------------------------------------------
     
    548540      fpee = x >>  0;
    549541    };
     542  };
     543
     544  //----------------------------------------------------------
     545  // [0][21] CID
     546  //----------------------------------------------------------
     547  class CID : public GENERIC
     548  {
     549  public : CID (uint32_t num_front_end=0, uint32_t num_context=0,const Parameters * param=NULL) : GENERIC (num_front_end,num_context,param) {};
     550  };
     551
     552  //----------------------------------------------------------
     553  // [0][22] TID
     554  //----------------------------------------------------------
     555  class TID : public GENERIC
     556  {
     557  public : TID (uint32_t num_front_end=0, uint32_t num_context=0,const Parameters * param=NULL) : GENERIC (num_front_end,num_context,param) {};
     558  };
     559
     560  //----------------------------------------------------------
     561  // [0][23] TSR
     562  //----------------------------------------------------------
     563  class TSR : public GENERIC
     564  {
     565  public : TSR (uint32_t num_front_end=0, uint32_t num_context=0,const Parameters * param=NULL) : GENERIC (num_front_end,num_context,param) {};
    550566  };
    551567
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/src/Special_Register_unit_allocation.cpp

    r98 r101  
    168168                        _spr [i][j][k][SPR_SR          ] = new SR          (i,j,_param);
    169169                        _spr [i][j][k][SPR_PPC         ] = new PPC         (i,j,_param);
     170                        _spr [i][j][k][SPR_FPCSR       ] = new FPCSR       (i,j,_param);
    170171                        _spr [i][j][k][SPR_CID         ] = new CID         (i,j,_param);
    171                         _spr [i][j][k][SPR_FPCSR       ] = new FPCSR       (i,j,_param);
     172                        _spr [i][j][k][SPR_TID         ] = new TID         (i,j,_param);
     173                        _spr [i][j][k][SPR_TSR         ] = new TSR         (i,j,_param);
    172174                        _spr [i][j][k][SPR_EPCR        ] = new EPCR        (i,j,_param);
    173175                        _spr [i][j][k][SPR_EEAR        ] = new EEAR        (i,j,_param);
     
    197199                    case GROUP_TICK_TIMER          :
    198200                    case GROUP_FLOATING_POINT      :
    199 
    200201                    case GROUP_MAC                 :
    201202                    case GROUP_RESERVED_1          :
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/include/OOO_Engine.h

    r98 r101  
    197197  public    : SC_IN (Tdepth_t          )  ***  in_DEPTH_MIN                        ;//[nb_front_end][nb_context]
    198198  public    : SC_IN (Tdepth_t          )  ***  in_DEPTH_MAX                        ;//[nb_front_end][nb_context]
     199  public    : SC_IN (Tcontrol_t        )  ***  in_DEPTH_FULL                       ;//[nb_front_end][nb_context]
    199200
    200201    // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/src/OOO_Engine_allocation.cpp

    r98 r101  
    225225
    226226      _ALLOC2_SIGNAL_IN ( in_DEPTH_MIN                        ,"MIN"                        ,Tdepth_t         ,_param->_size_depth                  ,_param->_nb_front_end, _param->_nb_context[it1]);
    227       _ALLOC2_SIGNAL_IN ( in_DEPTH_MAX                        ,"MAX"                        ,Tdepth_t         ,_param->_size_depth+1                ,_param->_nb_front_end, _param->_nb_context[it1]);
     227      _ALLOC2_SIGNAL_IN ( in_DEPTH_MAX                        ,"MAX"                        ,Tdepth_t         ,_param->_size_depth                  ,_param->_nb_front_end, _param->_nb_context[it1]);
     228      _ALLOC2_SIGNAL_IN ( in_DEPTH_FULL                       ,"FULL"                       ,Tcontrol_t       ,1                                    ,_param->_nb_front_end, _param->_nb_context[it1]);
    228229    }
    229230
     
    990991
    991992            if (_param->_have_port_depth)
     993              {
    992994            PORT_MAP(_component,src , "in_DEPTH_"+toString(i)+"_"+toString(j)+"_MIN",
    993995                                dest, "in_DEPTH_"+toString(i)+"_"+toString(j)+"_MIN");
    994996            PORT_MAP(_component,src , "in_DEPTH_"+toString(i)+"_"+toString(j)+"_MAX",
    995997                                dest, "in_DEPTH_"+toString(i)+"_"+toString(j)+"_MAX");
     998              }
     999            PORT_MAP(_component,src , "in_DEPTH_"+toString(i)+"_"+toString(j)+"_FULL",
     1000                                dest, "in_DEPTH_"+toString(i)+"_"+toString(j)+"_FULL");
    9961001          }
    9971002
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/src/OOO_Engine_deallocation.cpp

    r98 r101  
    142142        DELETE2_SIGNAL(out_NB_INST_COMMIT_MEM               ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_nb_inst_commit         );
    143143        DELETE2_SIGNAL( in_DEPTH_MIN                        ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_depth                  );
    144         DELETE2_SIGNAL( in_DEPTH_MAX                        ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_depth+1                );
     144        DELETE2_SIGNAL( in_DEPTH_MAX                        ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_depth                  );
     145        DELETE2_SIGNAL( in_DEPTH_FULL                       ,_param->_nb_front_end,_param->_nb_context[it1],1                                    );
    145146        DELETE2_SIGNAL(out_SPR_SR_IEE                       ,_param->_nb_front_end,_param->_nb_context[it1],1                                    );
    146147        DELETE2_SIGNAL(out_SPR_SR_EPH                       ,_param->_nb_front_end,_param->_nb_context[it1],1                                    );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/src/Core_allocation.cpp

    r98 r101  
    383383       
    384384        // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    385         // out_DEPTH_MIN - ooo_engine. in_DEPTH_MIN     
    386         // out_DEPTH_MAX - ooo_engine. in_DEPTH_MAX
     385        // out_DEPTH_MIN  - ooo_engine. in_DEPTH_MIN     
     386        // out_DEPTH_MAX  - ooo_engine. in_DEPTH_MAX
     387        // out_DEPTH_FULL - ooo_engine. in_DEPTH_FULL
    387388       
    388389        // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    646647
    647648                if (_param->_have_port_depth)
     649                  {
    648650                COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+"_"+toString(k)+"_MIN",
    649651                                         dest,"out_DEPTH_"                +toString(k)+"_MIN");
    650652                COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+"_"+toString(k)+"_MAX",
    651653                                         dest,"out_DEPTH_"                +toString(k)+"_MAX");
     654                  }
     655                COMPONENT_MAP(_component,src , "in_DEPTH_"+toString(j)+"_"+toString(k)+"_FULL",
     656                                         dest,"out_DEPTH_"                +toString(k)+"_FULL");
    652657              }
    653658          }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/src/Parameters.cpp

    r97 r101  
    495495            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_BNF      ] |= (instruction_size_data(INSTRUCTION_L_BNF      ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_BNF      )._type][instruction_information(INSTRUCTION_L_BNF      )._operation]._latence > 0);
    496496            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_CMOV     ] |= (instruction_size_data(INSTRUCTION_L_CMOV     ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_CMOV     )._type][instruction_information(INSTRUCTION_L_CMOV     )._operation]._latence > 0);
    497             _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_CSYNC    ] |= (instruction_size_data(INSTRUCTION_L_CSYNC    ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_CSYNC    )._type][instruction_information(INSTRUCTION_L_CSYNC    )._operation]._latence > 0);
     497//          _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_CSYNC    ] |= (instruction_size_data(INSTRUCTION_L_CSYNC    ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_CSYNC    )._type][instruction_information(INSTRUCTION_L_CSYNC    )._operation]._latence > 0);
    498498            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_CUST1    ] |= (instruction_size_data(INSTRUCTION_L_CUST1    ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_CUST1    )._type][instruction_information(INSTRUCTION_L_CUST1    )._operation]._latence > 0);
    499499            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_CUST2    ] |= (instruction_size_data(INSTRUCTION_L_CUST2    ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_CUST2    )._type][instruction_information(INSTRUCTION_L_CUST2    )._operation]._latence > 0);
     
    531531            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_MOVHI    ] |= (instruction_size_data(INSTRUCTION_L_MOVHI    ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_MOVHI    )._type][instruction_information(INSTRUCTION_L_MOVHI    )._operation]._latence > 0);
    532532            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_MSB      ] |= (instruction_size_data(INSTRUCTION_L_MSB      ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_MSB      )._type][instruction_information(INSTRUCTION_L_MSB      )._operation]._latence > 0);
    533             _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_MSYNC    ] |= (instruction_size_data(INSTRUCTION_L_MSYNC    ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_MSYNC    )._type][instruction_information(INSTRUCTION_L_MSYNC    )._operation]._latence > 0);
     533//          _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_MSYNC    ] |= (instruction_size_data(INSTRUCTION_L_MSYNC    ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_MSYNC    )._type][instruction_information(INSTRUCTION_L_MSYNC    )._operation]._latence > 0);
    534534            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_MTSPR    ] |= (instruction_size_data(INSTRUCTION_L_MTSPR    ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_MTSPR    )._type][instruction_information(INSTRUCTION_L_MTSPR    )._operation]._latence > 0);
    535535            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_MUL      ] |= (instruction_size_data(INSTRUCTION_L_MUL      ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_MUL      )._type][instruction_information(INSTRUCTION_L_MUL      )._operation]._latence > 0);
     
    539539            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_OR       ] |= (instruction_size_data(INSTRUCTION_L_OR       ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_OR       )._type][instruction_information(INSTRUCTION_L_OR       )._operation]._latence > 0);
    540540            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_ORI      ] |= (instruction_size_data(INSTRUCTION_L_ORI      ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_ORI      )._type][instruction_information(INSTRUCTION_L_ORI      )._operation]._latence > 0);
    541             _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_PSYNC    ] |= (instruction_size_data(INSTRUCTION_L_PSYNC    ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_PSYNC    )._type][instruction_information(INSTRUCTION_L_PSYNC    )._operation]._latence > 0);
     541//          _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_PSYNC    ] |= (instruction_size_data(INSTRUCTION_L_PSYNC    ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_PSYNC    )._type][instruction_information(INSTRUCTION_L_PSYNC    )._operation]._latence > 0);
    542542            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_RFE      ] |= (instruction_size_data(INSTRUCTION_L_RFE      ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_RFE      )._type][instruction_information(INSTRUCTION_L_RFE      )._operation]._latence > 0);
    543543            _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_ROR      ] |= (instruction_size_data(INSTRUCTION_L_ROR      ) <= size_general_data) and (_timing[j][instruction_information(INSTRUCTION_L_ROR      )._type][instruction_information(INSTRUCTION_L_ROR      )._operation]._latence > 0);
     
    728728        _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_SH       ] |= (instruction_size_data(INSTRUCTION_L_SH       ) <= size_general_data);
    729729        _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_SW       ] |= (instruction_size_data(INSTRUCTION_L_SW       ) <= size_general_data);
     730
     731//      _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_CSYNC    ]  = true;
     732        _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_MSYNC    ]  = true;
     733        _front_end_instruction_implemeted [num_front_end][num_context][INSTRUCTION_L_PSYNC    ]  = true;
    730734      }
    731735
     736    // Reedit timing
     737    {
     738      multi_execute_loop::execute_loop::execute_timing_t timing_tmp [_nb_functionnal_unit][_nb_type][_nb_operation];
     739
     740      for (uint32_t i=0; i<_nb_functionnal_unit; ++i)
     741        for (uint32_t j=0; j<_nb_type; ++j)
     742          for (uint32_t k=0; k<_nb_operation; ++k)
     743            {
     744              timing_tmp [i][j][k]._latence = _timing [i][j][k]._latence;
     745              timing_tmp [i][j][k]._delay   = _timing [i][j][k]._delay  ;
     746
     747              // Reset
     748              _timing [i][j][k]._latence = _timing [i][j][k]._delay = 0;
     749            }
     750
     751      for (uint32_t i=0; i<_nb_thread; ++i)
     752        {
     753          uint32_t num_front_end = _link_context_with_thread [i].first;
     754          uint32_t num_context   = _link_context_with_thread [i].second;
     755         
     756          for (uint32_t j=0; j<_nb_functionnal_unit; ++j)
     757            {
     758              // Test if link
     759              if (not _link_thread_and_functionnal_unit[i][j])
     760                continue;
     761     
     762              for (uint32_t k=0; k<NB_INSTRUCTION; ++k)
     763                if (_front_end_instruction_implemeted [num_front_end][num_context][k])
     764                  {
     765                    uint32_t x = instruction_information(k)._type;
     766                    uint32_t y = instruction_information(k)._operation;
     767
     768                    _timing[j][x][y]._latence = timing_tmp[j][x][y]._latence;
     769                    _timing[j][x][y]._delay   = timing_tmp[j][x][y]._delay  ;
     770                  }
     771            }
     772        }
     773    }
     774   
    732775    ALLOC1(_front_end_nb_inst_branch_complete             ,uint32_t         ,_nb_front_end);
    733776    ALLOC2(_front_end_size_decod_queue                    ,uint32_t         ,_nb_front_end,_nb_decod_unit[it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_min.cfg

    r100 r101  
    331       1       *2      #_size_data
    440       1       +1      #_nb_port_slot
     50       0       +1      #_have_port_write
     60       0       +1      #_have_port_read
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_size_queue_log2.cfg

    r100 r101  
    3332      32      *2      #_size_data
    440       0       *2      #_nb_port_slot
     51       1       +1      #_have_port_write
     61       1       +1      #_have_port_read
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_size_queue_no_log2.cfg

    r100 r101  
    3332      32      *2      #_size_data
    440       0       *2      #_nb_port_slot
     51       1       +1      #_have_port_write
     61       1       +1      #_have_port_read
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_slot_out_size_queue_log2.cfg

    r100 r101  
    3332      32      *2      #_size_data
    441       8       *2      #_nb_port_slot
     51       1       +1      #_have_port_write
     61       1       +1      #_have_port_read
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_slot_out_size_queue_no_log2.cfg

    r100 r101  
    3332      32      *2      #_size_data
    441       8       *2      #_nb_port_slot
     51       1       +1      #_have_port_write
     61       1       +1      #_have_port_read
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/main.cpp

    r100 r101  
    88#include "Behavioural/Generic/Queue/SelfTest/include/test.h"
    99
    10 #define NB_PARAMS 3
     10#define NB_PARAMS 5
    1111
    1212void usage (int argc, char * argv[])
     
    1414  cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl
    1515       << "list_params is :" << endl
    16        << " - size_queue   (uint32_t)" << endl
    17        << " - size_data    (uint32_t)" << endl
    18        << " - nb_port_slot (uint32_t)" << endl
     16       << " - size_queue      (uint32_t)" << endl
     17       << " - size_data       (uint32_t)" << endl
     18       << " - nb_port_slot    (uint32_t)" << endl
     19       << " - have_port_write (bool    )" << endl
     20       << " - have_port_read  (bool    )" << endl
    1921       << "" << endl;
    2022
     
    3739  uint32_t       x = 1;
    3840 
    39   const string   name         =      argv[x++];
    40   const uint32_t size_queue   = atoi(argv[x++]);
    41   const uint32_t size_data    = atoi(argv[x++]);
    42   const uint32_t nb_port_slot = atoi(argv[x++]);
    43 
     41  const string   name            =      argv[x++];
     42  const uint32_t size_queue      = fromString<uint32_t>(argv[x++]);
     43  const uint32_t size_data       = fromString<uint32_t>(argv[x++]);
     44  const uint32_t nb_port_slot    = fromString<uint32_t>(argv[x++]);
     45  const bool     have_port_write = fromString<bool>(argv[x++]);
     46  const bool     have_port_read  = fromString<bool>(argv[x++]);
    4447  try
    4548    {
     
    4750        (size_queue,
    4851         size_data ,
    49          nb_port_slot
     52         nb_port_slot,
     53         have_port_write,
     54         have_port_read
    5055        );
    5156     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/test.cpp

    r100 r101  
    5858  ALLOC1_SC_SIGNAL(out_SLOT_VAL   ,"out_SLOT_VAL"   ,Tcontrol_t,_param->_nb_port_slot);
    5959  ALLOC1_SC_SIGNAL(out_SLOT_DATA  ,"out_SLOT_DATA"  ,Tdata_t   ,_param->_nb_port_slot);
     60  ALLOC0_SC_SIGNAL(out_PTR_WRITE  ,"out_PTR_WRITE"  ,Tptr_t    );
     61  ALLOC0_SC_SIGNAL(out_PTR_READ   ,"out_PTR_READ"   ,Tptr_t    );
    6062 
    6163  /********************************************************
     
    7678  INSTANCE1_SC_SIGNAL(_Queue,out_SLOT_VAL   ,_param->_nb_port_slot);
    7779  INSTANCE1_SC_SIGNAL(_Queue,out_SLOT_DATA  ,_param->_nb_port_slot);
     80  if (_param->_have_port_ptr_write)
     81  INSTANCE0_SC_SIGNAL(_Queue,out_PTR_WRITE  );
     82  if (_param->_have_port_ptr_read )
     83  INSTANCE0_SC_SIGNAL(_Queue,out_PTR_READ   );
    7884
    7985  cout << "<" << name << "> Start Simulation ............" << endl;
     
    168174  DELETE1_SC_SIGNAL(out_SLOT_VAL   ,_param->_nb_port_slot);
    169175  DELETE1_SC_SIGNAL(out_SLOT_DATA  ,_param->_nb_port_slot);
    170 
     176  DELETE0_SC_SIGNAL(out_PTR_WRITE  );
     177  DELETE0_SC_SIGNAL(out_PTR_READ   );
    171178#endif
    172179
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Parameters.h

    r100 r101  
    2222  {
    2323    //-----[ fields ]------------------------------------------------------------
    24   public : const uint32_t _size_queue  ;
    25   public : const uint32_t _size_data   ;
    26   public : const uint32_t _nb_port_slot;
     24  public : const uint32_t _size_queue         ;
     25  public : const uint32_t _size_data          ;
     26  public : const uint32_t _nb_port_slot       ;
     27  public : const bool     _have_port_ptr_write;
     28  public : const bool     _have_port_ptr_read ;
     29
     30  public : const uint32_t _size_ptr           ;
     31  public : const bool     _have_port_ptr      ;
    2732
    2833    //-----[ methods ]-----------------------------------------------------------
    29   public : Parameters  (uint32_t size_queue,
    30                         uint32_t size_data ,
    31                         uint32_t nb_port_slot);
     34  public : Parameters  (uint32_t size_queue         ,
     35                        uint32_t size_data          ,
     36                        uint32_t nb_port_slot       ,
     37                        bool     have_port_ptr_write,
     38                        bool     have_port_ptr_read );
    3239
    3340//   public : Parameters  (Parameters & param) ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Queue.h

    r100 r101  
    7878  public    : SC_OUT(Tdata_t   )           ** out_SLOT_DATA;
    7979
     80    // ~~~~~[ Interface "ptr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     81  public    : SC_OUT(Tptr_t    )            * out_PTR_WRITE;
     82  public    : SC_OUT(Tptr_t    )            * out_PTR_READ ;
     83
    8084    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    8185  protected : morpheo::behavioural::generic::queue_control::Queue_Control * _queue_control;
     
    8791  protected : Tcontrol_t                      internal_INSERT_ACK;
    8892  protected : Tcontrol_t                      internal_RETIRE_VAL;
    89 
    9093#endif
    9194
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Parameters.cpp

    r100 r101  
    77
    88#include "Behavioural/Generic/Queue/include/Parameters.h"
    9 
     9#include "Common/include/Log2.h"
    1010namespace morpheo {
    1111namespace behavioural {
     
    1616#undef  FUNCTION
    1717#define FUNCTION "Queue::Parameters"
    18   Parameters::Parameters (uint32_t size_queue,
    19                           uint32_t size_data ,
    20                           uint32_t nb_port_slot):
    21     _size_queue   (size_queue),
    22     _size_data    (size_data ),
    23     _nb_port_slot (nb_port_slot)
     18  Parameters::Parameters (uint32_t size_queue         ,
     19                          uint32_t size_data          ,
     20                          uint32_t nb_port_slot       ,
     21                          bool     have_port_ptr_write,
     22                          bool     have_port_ptr_read ):
     23    _size_queue          (size_queue),
     24    _size_data           (size_data ),
     25    _nb_port_slot        (nb_port_slot),
     26    _have_port_ptr_write (have_port_ptr_write and (log2(size_queue)>0)),
     27    _have_port_ptr_read  (have_port_ptr_read  and (log2(size_queue)>0)),
     28    _size_ptr            (log2(size_queue)),
     29    _have_port_ptr       (have_port_ptr_write or have_port_ptr_read)
    2430  {
    2531    log_printf(FUNC,Queue,FUNCTION,"Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_allocation.cpp

    r100 r101  
    7272      ALLOC1_SIGNAL_OUT(out_SLOT_DATA ,"data",Tdata_t,_param->_size_data);
    7373    }
     74
     75    // ~~~~~[ Interface "ptr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     76    if (_param->_have_port_ptr)
     77    {
     78      ALLOC0_INTERFACE("ptr", OUT, EAST, _("Internal pointer."));
     79     
     80      if (_param->_have_port_ptr_write)
     81      ALLOC0_SIGNAL_OUT(out_PTR_WRITE ,"write",Tptr_t,_param->_size_ptr);
     82      if (_param->_have_port_ptr_read )
     83      ALLOC0_SIGNAL_OUT(out_PTR_READ  ,"read" ,Tptr_t,_param->_size_ptr);
     84    }
    7485     
    7586    if (usage_is_set(_usage,USE_SYSTEMC))
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_deallocation.cpp

    r100 r101  
    3636        DELETE1_SIGNAL(out_SLOT_VAL    ,_param->_nb_port_slot,1);
    3737        DELETE1_SIGNAL(out_SLOT_DATA   ,_param->_nb_port_slot,_param->_size_data);
     38
     39        if (_param->_have_port_ptr_write)
     40        DELETE0_SIGNAL(out_PTR_WRITE   ,_param->_size_ptr);
     41        if (_param->_have_port_ptr_read )
     42        DELETE0_SIGNAL(out_PTR_READ    ,_param->_size_ptr);
    3843       
    3944        // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_genMoore.cpp

    r100 r101  
    2020    log_printf(FUNC,Queue,FUNCTION,"Begin");
    2121
     22    //---------------------------------------------
    2223    // Output
     24    //---------------------------------------------
    2325    internal_INSERT_ACK = not _queue_control->full();
    2426    internal_RETIRE_VAL = not _queue_control->empty();
     
    2830    PORT_WRITE(out_RETIRE_DATA,_queue_data[(*_queue_control)[0]]);
    2931
     32    //---------------------------------------------
    3033    // Slot
     34    //---------------------------------------------
    3135    // Note : Slot 0 is the same slot as retire interface.
    3236    uint32_t nb_elt = _queue_control->nb_elt();
     
    3741        PORT_WRITE(out_SLOT_DATA [i],_queue_data[(*_queue_control)[i]]);
    3842      }
     43
     44    //---------------------------------------------
     45    // Pointer
     46    //---------------------------------------------
     47    if (_param->_have_port_ptr_write)
     48    PORT_WRITE(out_PTR_WRITE, _queue_control->ptr_push());
     49    if (_param->_have_port_ptr_read )
     50    PORT_WRITE(out_PTR_READ , _queue_control->ptr_pop ());
    3951
    4052    log_printf(FUNC,Queue,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_vhdl_body.cpp

    r100 r101  
    6262          else
    6363            vhdl->set_body   (0,"out_SLOT_"+toString(i)+"_DATA       <= reg_DATA(conv_integer(0));");
     64      }
     65
     66    if (_param->_have_port_ptr)
     67      {
     68    vhdl->set_body   (0,"");
     69    vhdl->set_comment(0,"---------------------------------------------------------------------------");
     70    vhdl->set_comment(0," Slot");
     71    vhdl->set_comment(0,"---------------------------------------------------------------------------");
     72    vhdl->set_body   (0,"");
     73    if (_param->_have_port_ptr_write)
     74    vhdl->set_body   (0,"out_PTR_WRITE         <= signal_PTR_WRITE;");
     75    if (_param->_have_port_ptr_read)
     76    vhdl->set_body   (0,"out_PTR_READ          <= signal_PTR_READ;");
    6477      }
    6578
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/include/Queue_Control.h

    r81 r101  
    3535  public  : void     clear    (void);
    3636
     37  public  : uint32_t ptr_pop  (uint32_t index=0);
     38  public  : uint32_t ptr_push (void);
     39
     40
    3741  public  : uint32_t push     (void);
    3842  public  : uint32_t push_ovf (void);
    39   public  : void     pop      (uint32_t);
     43  public  : void     pop      (uint32_t index);
    4044  public  : void     pop      (void);
    41   public  : void     pop_ovf  (uint32_t);
     45  public  : void     pop_ovf  (uint32_t index);
    4246  public  : void     pop_ovf  (void);
    4347   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h

    r88 r101  
    2121  class Parameters : public morpheo::behavioural::Parameters
    2222  {
    23   public : const uint32_t _nb_port_read ;
    24   public : const uint32_t _nb_port_write;
    25   public : const uint32_t _nb_port_read_write;
    26   public : const uint32_t _nb_word      ;
    27   public : const uint32_t _size_word    ;
    28   public : const uint32_t _size_address ;
    29   public : const bool     _have_port_address;
     23  public : const uint32_t    _nb_port_read ;
     24  public : const uint32_t    _nb_port_write;
     25  public : const uint32_t    _nb_port_read_write;
     26  public : const uint32_t    _nb_word      ;
     27  public : const uint32_t    _size_word    ;
     28  public : const uint32_t    _size_address ;
     29  public : const bool        _have_port_address;
     30  public : const bool        _have_init_value;
     31  public : const std::string _init_value;
    3032
    31   public : Parameters (uint32_t nb_port_read ,
    32                        uint32_t nb_port_write,
    33                        uint32_t nb_port_read_write,
    34                        uint32_t nb_word      ,
    35                        uint32_t size_word    );
     33  public : Parameters (uint32_t    nb_port_read ,
     34                       uint32_t    nb_port_write,
     35                       uint32_t    nb_port_read_write,
     36                       uint32_t    nb_word      ,
     37                       uint32_t    size_word    ,
     38                       std::string init_value="");
    3639//   public : Parameters (Parameters & param) ;
    3740  public : ~Parameters () ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters.cpp

    r88 r101  
    1414namespace registerfile_monolithic    {
    1515
    16   Parameters::Parameters (uint32_t nb_port_read ,
    17                           uint32_t nb_port_write,
    18                           uint32_t nb_port_read_write ,
    19                           uint32_t nb_word      ,
    20                           uint32_t size_word     
     16  Parameters::Parameters (uint32_t    nb_port_read ,
     17                          uint32_t    nb_port_write,
     18                          uint32_t    nb_port_read_write ,
     19                          uint32_t    nb_word      ,
     20                          uint32_t    size_word    ,
     21                          std::string init_value
    2122                          ) :
    2223    _nb_port_read      (nb_port_read ),
     
    2627    _size_word         (size_word    ),
    2728    _size_address      (static_cast<uint32_t>(log2(_nb_word))),
    28     _have_port_address (_size_address != 0)
    29 
     29    _have_port_address (_size_address != 0),
     30    _have_init_value   (init_value != ""),
     31    _init_value        (init_value)
    3032  {
    3133    test();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters_msg_error.cpp

    r81 r101  
    3333      test.error("you need a write port");
    3434
     35    // Need test init_value
     36
    3537    return test;
    3638  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp

    r88 r101  
    1818    log_printf(FUNC,RegisterFile,"transition","Begin");
    1919
    20     for (uint32_t i=0; i<_param->_nb_port_write; i++)
     20    if (_param->_have_init_value and (PORT_READ(in_NRESET) == 0))
    2121      {
    22         // Have a write?
    23         if ( PORT_READ(in_WRITE_VAL[i]) == true)
    24           {
     22        for (uint32_t i=0; i<_param->_nb_word; ++i)
     23          reg_DATA[i] = fromString<Tdata_t>(_param->_init_value);
     24      }
     25    else
     26      {
     27        for (uint32_t i=0; i<_param->_nb_port_write; i++)
     28          {
     29            // Have a write?
     30            if ( PORT_READ(in_WRITE_VAL[i]) == true)
     31              {
    2532#ifdef STATISTICS
    26             if (usage_is_set(_usage,USE_STATISTICS))
    27               (*_stat_nb_write) ++;
    28 #endif   
    29 
    30             Taddress_t address;
    31             if (_param->_have_port_address)
    32               address = PORT_READ(in_WRITE_ADDRESS[i]);
    33             else
    34               address = 0;
    35 
    36             Tdata_t    data    = PORT_READ(in_WRITE_DATA   [i]);
    37            
    38             log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
    39 
    40             // Write in registerFile
    41             reg_DATA[address] = data;
    42           }
    43       }
    44     for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
    45       {
    46         // Have a read_write?
    47         if (PORT_READ(in_READ_WRITE_VAL[i]) == true)
    48           {
    49             if (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE)
    50               {
    51 #ifdef STATISTICS
    52                 if (usage_is_set(_usage,USE_STATISTICS))
     33                if (usage_is_set(_usage,USE_STATISTICS))
    5334                  (*_stat_nb_write) ++;
    5435#endif   
    55                
    56                 Taddress_t address;
    57                 if (_param->_have_port_address)
    58                   address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
    59                 else
    60                   address = 0;
    61                 Tdata_t    data    = PORT_READ(in_READ_WRITE_WDATA  [i]);
    62                
    63                 log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
    64                
    65                 // Write in registerFile
    66                 reg_DATA[address] = data;
    67               }
     36               
     37                Taddress_t address = (_param->_have_port_address)?PORT_READ(in_WRITE_ADDRESS[i]):0;
     38                Tdata_t    data    = PORT_READ(in_WRITE_DATA   [i]);
     39               
     40                log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
     41               
     42                // Write in registerFile
     43                reg_DATA[address] = data;
     44              }
     45          }
     46        for (uint32_t i=0; i<_param->_nb_port_read_write; i++)
     47          {
     48            // Have a read_write?
     49            if (PORT_READ(in_READ_WRITE_VAL[i]) == true)
     50              {
     51                if (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE)
     52                  {
    6853#ifdef STATISTICS
    69             else
    70               {
    71                 if (usage_is_set(_usage,USE_STATISTICS))
    72                   (*_stat_nb_read) ++;
    73               }
     54                    if (usage_is_set(_usage,USE_STATISTICS))
     55                      (*_stat_nb_write) ++;
    7456#endif   
    75           }
     57                   
     58                    Taddress_t address = (_param->_have_port_address)?PORT_READ(in_READ_WRITE_ADDRESS[i]):0;
     59                    Tdata_t    data    = PORT_READ(in_READ_WRITE_WDATA  [i]);
     60                   
     61                    log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
     62                   
     63                    // Write in registerFile
     64                    reg_DATA[address] = data;
     65                  }
     66#ifdef STATISTICS
     67                else
     68                  {
     69                    if (usage_is_set(_usage,USE_STATISTICS))
     70                      (*_stat_nb_read) ++;
     71                  }
     72#endif   
     73              }
     74          }
    7675      }
    7776
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp

    r94 r101  
    6565    vhdl->set_body   (0,"begin  -- process RegisterFile_write");
    6666    vhdl->set_body   (1,"if in_CLOCK'event and in_CLOCK = '1' then");
     67
     68    if (_param->_have_init_value)
     69      {
     70        vhdl->set_body   (2,"if in_NRESET = '0' then");
     71       
     72        std::string init_value = ((_param->_size_word>1)?"\"":"'")+_param->_init_value+((_param->_size_word>1)?"\"":"'");
     73       
     74        for (uint32_t i=0; i<_param->_nb_word; ++i)
     75          vhdl->set_body   (3,"reg_DATA("+toString(i)+") <= "+init_value+";");
     76
     77        vhdl->set_body   (2,"else");
     78      }
    6779   
    6880    for (uint32_t i = 0; i < _param->_nb_port_write; i++)
     
    92104
    93105    vhdl->set_body   (1,"end if;");
     106
     107    if (_param->_have_init_value)
     108      vhdl->set_body   (1,"end if;");
     109
    94110    vhdl->set_body   (0,"end process RegisterFile_write;");
    95111  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h

    r100 r101  
    1414
    1515  I Use reserved SPR :
    16   [0][19] - SPR_CID
     16  [0][21] - SPR_CID : Context Id     
     17  [0][22] - SPR_TID : Thread  Id     
     18  [0][23] - SPR_TSR : Thread  Status Register (Priority)
    1719*/
    1820
     
    216218#  define OPERATION_SPECIAL_L_MACRC                0x12       // 001_0010 l.macrc
    217219#  define OPERATION_SPECIAL_L_MSB                  0x14       // 001_0100 l.msb
    218 define OPERATION_SPECIAL_L_MSYNC                0x21       // 010_0001 l.msync
    219 define OPERATION_SPECIAL_L_PSYNC                0x22       // 010_0010 l.psync
    220 define OPERATION_SPECIAL_L_CSYNC                0x24       // 010_0100 l.csync
     220//#define OPERATION_SPECIAL_L_MSYNC                0x21       // 010_0001 l.msync
     221//#define OPERATION_SPECIAL_L_PSYNC                0x22       // 010_0010 l.psync
     222//#define OPERATION_SPECIAL_L_CSYNC                0x24       // 010_0100 l.csync
    221223#  define OPERATION_SPECIAL_L_SYS                  0x41       // 100_0001 l.sys 
    222224#  define OPERATION_SPECIAL_L_TRAP                 0x42       // 100_0010 l.trap
     
    542544#  define SPR_SR                                   17         // Supervision register
    543545#  define SPR_PPC                                  18         // PC mapped to SPR space (previous PC)
    544 #  define SPR_CID                                  19         // Context Id
    545546#  define SPR_FPCSR                                20         // FP Control Status register
     547#  define SPR_CID                                  21         // Context Id
     548#  define SPR_TID                                  22         // Thread  Id
     549#  define SPR_TSR                                  23         // Thread  Priority
    546550#  define SPR_EPCR                                 32         // Exception PC register
    547551#  define SPR_EEAR                                 48         // Exception EA register
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h

    r100 r101  
    1010#define MORPHEO_MAJOR_VERSION 0
    1111#define MORPHEO_MINOR_VERSION 2
    12 #define MORPHEO_REVISION      "100"
     12#define MORPHEO_REVISION      "101"
    1313#define MORPHEO_CODENAME      "Castor"
    1414
    15 #define MORPHEO_DATE_DAY      "08
     15#define MORPHEO_DATE_DAY      "15
    1616#define MORPHEO_DATE_MONTH    "01"
    1717#define MORPHEO_DATE_YEAR     "2009"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Types.cpp

    r100 r101  
    2727      case INSTRUCTION_L_BNF       : return instruction_t (TYPE_BRANCH ,OPERATION_BRANCH_L_TEST_NF      ,ORBIS32,1);
    2828      case INSTRUCTION_L_CMOV      : return instruction_t (TYPE_MOVE   ,OPERATION_MOVE_L_CMOV           ,ORBIS32,2);
    29       case INSTRUCTION_L_CSYNC     : return instruction_t (TYPE_SPECIAL,OPERATION_SPECIAL_L_CSYNC       ,ORBIS32,2);
     29//    case INSTRUCTION_L_CSYNC     : return instruction_t (TYPE_SPECIAL,OPERATION_SPECIAL_L_CSYNC       ,ORBIS32,2);
     30      case INSTRUCTION_L_CSYNC     : return instruction_t (TYPE_MEMORY ,OPERATION_MEMORY_SYNCHRONIZATION,ORBIS32,2);
    3031      case INSTRUCTION_L_CUST1     : return instruction_t (TYPE_CUSTOM ,OPERATION_CUSTOM_L_1            ,ORBIS32,2);
    3132      case INSTRUCTION_L_CUST2     : return instruction_t (TYPE_CUSTOM ,OPERATION_CUSTOM_L_2            ,ORBIS32,2);
     
    6364      case INSTRUCTION_L_MOVHI     : return instruction_t (TYPE_MOVE   ,OPERATION_MOVE_L_MOVHI          ,ORBIS32,1);
    6465      case INSTRUCTION_L_MSB       : return instruction_t (TYPE_SPECIAL,OPERATION_SPECIAL_L_MSB         ,ORBIS32,2);
    65       case INSTRUCTION_L_MSYNC     : return instruction_t (TYPE_SPECIAL,OPERATION_SPECIAL_L_MSYNC       ,ORBIS32,2);
     66//    case INSTRUCTION_L_MSYNC     : return instruction_t (TYPE_SPECIAL,OPERATION_SPECIAL_L_MSYNC       ,ORBIS32,2);
     67      case INSTRUCTION_L_MSYNC     : return instruction_t (TYPE_MEMORY ,OPERATION_MEMORY_SYNCHRONIZATION,ORBIS32,2);
    6668      case INSTRUCTION_L_MTSPR     : return instruction_t (TYPE_SPECIAL,OPERATION_SPECIAL_L_MTSPR       ,ORBIS32,1);
    6769      case INSTRUCTION_L_MUL       : return instruction_t (TYPE_MUL    ,OPERATION_MUL_L_MUL             ,ORBIS32,1);
     
    7173      case INSTRUCTION_L_OR        : return instruction_t (TYPE_ALU    ,OPERATION_ALU_L_OR              ,ORBIS32,1);
    7274      case INSTRUCTION_L_ORI       : return instruction_t (TYPE_ALU    ,OPERATION_ALU_L_OR              ,ORBIS32,1);
    73       case INSTRUCTION_L_PSYNC     : return instruction_t (TYPE_SPECIAL,OPERATION_SPECIAL_L_PSYNC       ,ORBIS32,2);
     75//    case INSTRUCTION_L_PSYNC     : return instruction_t (TYPE_SPECIAL,OPERATION_SPECIAL_L_PSYNC       ,ORBIS32,2);
     76      case INSTRUCTION_L_PSYNC     : return instruction_t (TYPE_MEMORY ,OPERATION_MEMORY_SYNCHRONIZATION,ORBIS32,2);
    7477      case INSTRUCTION_L_RFE       : return instruction_t (TYPE_SPECIAL,OPERATION_SPECIAL_L_RFE         ,ORBIS32,1);
    7578      case INSTRUCTION_L_ROR       : return instruction_t (TYPE_SHIFT  ,OPERATION_SHIFT_L_ROR           ,ORBIS32,2);
  • trunk/IPs/systemC/processor/Morpheo/Files/Morpheo.gen

    r100 r101  
    7373  <parameter name="btb_associativity"                     min="1"   max="8"    step="* 2" default="1"   level="..." description="..." />
    7474  <parameter name="btb_size_counter"                      min="2"   max="8"    step="* 2" default="2"   level="..." description="..." />
    75   <parameter name="btb_victim_scheme"                     min="1"   max="8"    step="+ 1" default="1"   level="..." description="..." />
    76   <parameter name="dir_predictor_scheme"                  min="1"   max="8"    step="* 2" default="1"   level="..." description="..." />
     75  <parameter name="btb_victim_scheme"                     min="0"   max="5"    step="+ 1" default="1"   level="..." description="0 : Random, 1 : Round Robin, 2 : Not Last Used, 3 : Pseudo LRU, 4 : Least Recently Used, 5 : FIFO" />
     76  <parameter name="dir_predictor_scheme"                  min="0"   max="8"    step="+ 1" default="1"   level="..." description="0 : Never take, 1 : Always Take, 2 : Static, 3 : Last Take, 4 : Counter, 5 : Local predictor, 6 : Global predictor, 7 : Meta predictor, 8 : Custom predictor" />
    7777  <parameter name="dir_have_bht"                          min="1"   max="8"    step="* 2" default="1"   level="..." description="..." />
    7878  <parameter name="dir_bht_size_shifter"                  min="1"   max="8"    step="* 2" default="1"   level="..." description="..." />
  • trunk/IPs/systemC/processor/Morpheo/Files/Morpheo.sim

    r100 r101  
    1515  <parameter name="statistics_period"          value="0" />
    1616                                               
    17   <parameter name="simulation_nb_cycle"        value="10000" />
     17  <parameter name="simulation_nb_cycle"        value="100" />
    1818  <parameter name="simulation_nb_instruction"  value="0"   />
    1919
     
    2323  <parameter name="directory_log"              value="." />
    2424
    25   <parameter name="debug_level"                value="0" />
     25  <parameter name="debug_level"                value="3" />
    2626  <parameter name="debug_cycle_start"          value="0" />
    27   <parameter name="debug_cycle_stop"           value="400" />
     27  <parameter name="debug_cycle_stop"           value="300" />
    2828  <parameter name="debug_have_log_file"        value="0" />
    2929
  • trunk/IPs/systemC/shared/mapping_memory.h

    r98 r101  
    33
    44#  define TEXT_BASE            0x00000000
    5 #  define TEXT_SIZE            0x00002000
     5#  define TEXT_SIZE            0x01000000
    66
    77#  define DATA_CACHED_BASE     0x10000000
    8 #  define DATA_CACHED_SIZE     0x00001000
     8#  define DATA_CACHED_SIZE     0x10000000
    99
    10 #  define DATA_UNCACHED_BASE   0x40000000
    11 #  define DATA_UNCACHED_SIZE   0x00001000
     10#  define DATA_STACK_BASE      0x40000000
     11#  define DATA_STACK_SIZE      0x02000000
     12
     13#  define DATA_UNCACHED_BASE   0x80000000
     14#  define DATA_UNCACHED_SIZE   0x01000000
    1215
    1316#  define TTY_BASE             0xa0000000
  • trunk/Platforms/Test/Makefile

    r98 r101  
    3535DIR_OBJ                         =       $(DIR_TMP)/obj
    3636DIR_BIN                         =       $(DIR_TMP)/bin
    37 DIR_LOG                         =       ./log
     37DIR_LOG                         =       $(DIR_TMP)/log
    3838DIR_DATA                        =       ./data
    3939DIR_SOFT                        =       $(MORPHEO_TOPLEVEL)/Softwares
     
    115115                                fi;                                                     \
    116116                                $(MAKE) $$logs;                                         \
    117                                 declare -i have_test_ko=0;                              \
     117                                declare -i nb_test=0;                                   \
     118                                declare -i nb_test_ko=0;                                \
    118119                                for log in $$logs; do                                   \
    119120                                        $(GREP) -q "Test OK" $$log;                     \
     
    122123                                        declare -i test_ko=$$?;                         \
    123124                                        if $(TEST) $$test_ko -eq 0 -o $$test_ok -ne 0;  \
    124                                         then have_test_ko=1;                            \
     125                                        then nb_test_ko=$$(($${nb_test_ko} + 1));       \
    125126                                        fi;                                             \
     127                                        nb_test=$$(($${nb_test} + 1));                  \
    126128                                done;                                                   \
    127                                 if $(TEST) $$have_test_ko -ne 0;                        \
    128                                 then $(ECHO) "-------------------| Test KO"; exit 1;    \
     129                                if $(TEST) $${nb_test_ko} -ne 0;                        \
     130                                then $(ECHO) "-------------------| Test KO !!! ($${nb_test_ko}/$${nb_test})"; exit 1;   \
    129131                                else $(ECHO) "-------------------| Test OK"; exit 0;    \
    130132                                fi;
    131133
    132134execute                         : run
    133 
    134135
    135136$(DIR_LOG)/%.log                : %.cfg
     
    146147                                declare timing=$$($(GREP) -h "Timing" $$log);           \
    147148                                if $(TEST) $$test_ko -ne 0 -a $$test_ok -eq 0;          \
    148                                 then $(ECHO) -e "                     $$file ... OK\t$$timing"; \
    149                                 else $(ECHO) -e "                     $$file ... KO\t$$timing"; \
    150                                      have_test_ko=1;                                    \
     149                                then $(ECHO) -e "                     $$file ... OK    \t$$timing";     \
     150                                else $(ECHO) -e "                     $$file ... KO !!!\t$$timing";     \
    151151                                fi;                                                     \
    152152
  • trunk/Platforms/Test/data/Test_000_000.cfg

    r98 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_000/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_001.cfg

    r98 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_001/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_002.cfg

    r98 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_002/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_003.cfg

    r98 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_003/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_004.cfg

    r98 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_004/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_005.cfg

    r98 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_005/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_006.cfg

    r98 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_006/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_007.cfg

    r98 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_007/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_008.cfg

    r98 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_008/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_009.cfg

    r98 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_009/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_010.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_010/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_011.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_011/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_012.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_012/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_013.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_013/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_014.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_014/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_015.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_015/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_016.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_016/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_017.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_017/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_018.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_018/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_019.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_019/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_020.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_020/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_021.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_021/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_022.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_022/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_023.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_023/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_024.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_024/bin/soft.x
    550
  • trunk/Platforms/Test/data/Test_000_025.cfg

    r100 r101  
    11../../IPs/systemC/processor/Morpheo/Files/Morpheo.sim
    22../../IPs/systemC/processor/Morpheo/Files/Morpheo.gen
    3 ../../IPs/systemC/processor/Morpheo/Files/Instance_min.cfg
     3../../IPs/systemC/processor/Morpheo/Files/Instance_debug.cfg
    44../../Softwares/Test/Test_025/bin/soft.x
    550
  • trunk/Platforms/Test/src/test.cpp

    r88 r101  
    240240  segtable->setDefaultTarget(0,0);
    241241   
    242   // Add a segment    ,name      ,address of base   ,size              ,global index,local index,uncache
    243   segtable->addSegment("text"    ,TEXT_BASE         ,TEXT_SIZE         ,0           ,0          ,false);
    244   segtable->addSegment("data"    ,DATA_CACHED_BASE  ,DATA_CACHED_SIZE  ,0           ,0          ,false);
    245   segtable->addSegment("data_unc",DATA_UNCACHED_BASE,DATA_UNCACHED_SIZE,0           ,0          ,true );
     242  // Add a segment    ,name          ,address of base   ,size              ,global index,local index,uncache
     243  segtable->addSegment("text"        ,TEXT_BASE         ,TEXT_SIZE         ,0           ,0          ,false);
     244  segtable->addSegment("data"        ,DATA_CACHED_BASE  ,DATA_CACHED_SIZE  ,0           ,0          ,false);
     245  segtable->addSegment("data_stack"  ,DATA_STACK_BASE   ,DATA_STACK_SIZE   ,0           ,0          ,false);
     246  segtable->addSegment("data_unc"    ,DATA_UNCACHED_BASE,DATA_UNCACHED_SIZE,0           ,0          ,true );
    246247
    247248  Parameters * param_environment = new Parameters
  • trunk/Softwares/Common/include/find_one.h

    r81 r101  
    11unsigned int  find_first_one (unsigned int val);
     2// unsigned int  find_last_one  (unsigned int val);
  • trunk/Softwares/Common/include/func_io.h

    r81 r101  
    11#include "mapping_memory.h"
    22
    3 void print(int data);
    4 void quit (int data);
     3void tty  (unsigned char data);
     4void print(char * data);
     5void quit (unsigned int data);
     6void show (unsigned int data);
  • trunk/Softwares/Common/include/service_clock.h

    r81 r101  
    1 unsigned int service_clock ();
     1// unsigned int service_clock ();
  • trunk/Softwares/Common/ldscript/or32.ld

    r88 r101  
    66
    77/*
    8  * Memory Mapping
     8 * Memory Mapping : cf ${MORPHEO_TOPLEVEL}/IPs/systemC/shared/mapping_memory.h
    99 */
    1010
     
    1313        iram     : ORIGIN = 0x00000000, LENGTH = 0x01000000
    1414        dram     : ORIGIN = 0x10000000, LENGTH = 0x10000000
    15         dram_unc : ORIGIN = 0x40000000, LENGTH = 0x01000000
     15        dram_unc : ORIGIN = 0x80000000, LENGTH = 0x01000000
    1616}
    1717
     
    2020 * grows down.
    2121 */
    22 PROVIDE (_stack       = 0x52000000 - 4);
    23 PROVIDE (__stack      = 0x52000000 - 4);
     22PROVIDE (_stack       = 0x42000000 - 4);
    2423PROVIDE (_stack_alloc = 0x00500000    );
    2524PROVIDE (_tty         = 0xa0000000    );
     25PROVIDE (_ramlock     = 0xb0000000    );
     26PROVIDE (_sim2os      = 0xc0000000    );
    2627
    2728SECTIONS
  • trunk/Softwares/Common/src/asm/cpu_info.s

    r81 r101  
    1010_get_cpu_id :
    1111        l.jr    r9
    12         l.mfspr r11,r0,0xF800  /* R11 <- SPR[31][0] */
    13 
     12        l.mfspr r11,r0,21      /* R11 <- SPR[0][21] */
     13       
    1414        .global _set_cpu_id
    1515_set_cpu_id :
    1616        l.jr    r9
    17         l.mtspr r0 ,r3,0xF800  /* SPR[31][0] <- r3  */
     17        l.mtspr r0 ,r3,21  /* SPR[0][21] <- r3  */
    1818
  • trunk/Softwares/Common/src/asm/find_one.s

    r81 r101  
    1212        l.ff1   r11,r3
    1313
    14 /*
     14/*       
    1515        .global _find_last_one
    1616_find_last_one :
  • trunk/Softwares/Common/src/asm/thread_info.s

    r81 r101  
    1010_get_thread_id :
    1111        l.jr    r9                             
    12         l.mfspr r11,r0,0xF801                   /* R11 <- SPR[31][1] */
    13        
     12        l.mfspr r11,r0,22                       /* R11 <- SPR[0][22] */
     13       
    1414        .global _set_thread_id
    1515_set_thread_id :
    1616        l.jr    r9
    17         l.mtspr r0 ,r3,0xF801                   /* SPR[31][1] <- r3  */
     17        l.mtspr r0 ,r3,22                       /* SPR[0][22] <- r3  */
    1818
    1919        .global _get_thread_priority
    2020_get_thread_priority :
    2121        l.jr    r9
    22         l.mfspr r11,r0,0xF802                   /* R11 <- SPR[31][2] */
     22        l.mfspr r11,r0,23                       /* R11 <- SPR[0][23] */
    2323
    2424        .global _set_thread_priority
    2525_set_thread_priority :
    2626        l.jr    r9
    27         l.mtspr r0 ,r3,0xF802                   /* SPR[31][2] <- r3  */
     27        l.mtspr r0 ,r3,23                       /* SPR[0][23] <- r3  */
    2828       
  • trunk/Softwares/Common/src/c/func_io.c

    r81 r101  
    22#include "thread_info.h"
    33
    4 void print(int data)
     4void tty (unsigned char data)
    55{
    6   int *show   =(int*)(TTY_BASE + (get_thread_id() << 4) + 8);
     6  unsigned int * addr =(unsigned int*)(TTY_BASE + (get_thread_id() << 4) + 0);
    77
    8   *(show) = data;
     8  *(addr) = data;
    99}
    1010
    11 void quit (int data)
     11void print (char * data)
    1212{
    13   int *stop   =(int*)(TTY_BASE + (get_thread_id() << 4) + 4);
     13  unsigned int * addr =(unsigned int*)(TTY_BASE + (get_thread_id() << 4) + 0);
    1414
    15   *(stop) = data;
     15  while ((*data) != '\0')
     16    {
     17      *(addr) = (*data);
     18      data++;
     19    }
    1620}
     21
     22void show (unsigned int data)
     23{
     24  unsigned int * addr =(unsigned int*)(TTY_BASE + (get_thread_id() << 4) + 8);
     25
     26  *(addr) = data;
     27}
     28
     29void quit (unsigned int data)
     30{
     31  unsigned int * addr = (unsigned int*)(TTY_BASE + (get_thread_id() << 4) + 4);
     32
     33  *(addr) = data;
     34}
  • trunk/Softwares/Common/src/c/service_clock.c

    r81 r101  
    1 #include <time.h>
    2 #include <errno.h>
    3 #include <sys/lock.h>
    4 #include "mapping_memory.h"
    5 #include "sim2os.h"
    6 #include "service_clock.h"
     1/* #include <time.h> */
     2/* #include <errno.h> */
     3/* #include <sys/lock.h> */
     4/* #include "mapping_memory.h" */
     5/* #include "sim2os.h" */
     6/* #include "service_clock.h" */
    77
    8 unsigned int service_clock ()
    9 {
    10   unsigned int * addr   = (unsigned int *)(SIM2OS_BASE);
    11   unsigned int   result = -1;
     8/* unsigned int service_clock () */
     9/* { */
     10/*   unsigned int * addr   = (unsigned int *)(SIM2OS_BASE); */
     11/*   unsigned int   result = -1; */
    1212
    13   __lock_init    (service_lock);
     13/*   __lock_init    (service_lock); */
    1414 
    15   __lock_acquire (service_lock);
     15/*   __lock_acquire (service_lock); */
    1616
    17   *(addr+0) = (unsigned int)SERVICE_CLOCK;
     17/*   *(addr+0) = (unsigned int)SERVICE_CLOCK; */
    1818 
    19   // memory synchronisation
    20   // (else read (with an address that depend not of store address) can be lunch before a store)
    21   asm("l.msync;");
     19/*   // memory synchronisation */
     20/*   // (else read (with an address that depend not of store address) can be lunch before a store) */
     21/*   asm("l.msync;"); */
    2222
    23   result    = (clock_t) *(addr+1);
     23/*   result    = (clock_t) *(addr+1); */
    2424 
    25   if (result == (clock_t)-1)
    26     errno = (int) *(addr+2);
     25/*   if (result == (clock_t)-1) */
     26/*     errno = (int) *(addr+2); */
    2727
    28   __lock_release (service_lock);
     28/*   __lock_release (service_lock); */
    2929
    30   return result;
    31 }
     30/*   return result; */
     31/* } */
  • trunk/Softwares/Makefile.Software

    r100 r101  
    2020
    2121DIR_COMMON              = $(MORPHEO_TOPLEVEL)/Softwares/Common
    22 DIR_COMMON_C            = $(DIR_GLOBAL)/src/c
    23 DIR_COMMON_ASM          = $(DIR_GLOBAL)/src/asm
    24 DIR_COMMON_SYS          = $(DIR_GLOBAL)/src/sys
    25 DIR_COMMON_INC          = $(DIR_GLOBAL)/include
     22DIR_COMMON_C            = $(DIR_COMMON)/src/c
     23DIR_COMMON_ASM          = $(DIR_COMMON)/src/asm
     24DIR_COMMON_SYS          = $(DIR_COMMON)/src/sys
     25DIR_COMMON_INC          = $(DIR_COMMON)/include
    2626
    27 OBJECTS_COMMON          =       $(patsubst $(DIR_COMMON_ASM)/%.s,$(DIR_OBJ)/%.o,$(wildcard $(DIR_COMMON_ASM)/*.s))      \
    28                                 $(patsubst $(DIR_COMMON_SYS)/%.s,$(DIR_OBJ)/%.o,$(wildcard $(DIR_COMMON_SYS)/*.s))      \
     27OBJECTS_COMMON          =       $(patsubst $(DIR_COMMON_SYS)/%.s,$(DIR_OBJ)/%.o,$(wildcard $(DIR_COMMON_SYS)/*.s))      \
     28                                $(patsubst $(DIR_COMMON_ASM)/%.s,$(DIR_OBJ)/%.o,$(wildcard $(DIR_COMMON_ASM)/*.s))      \
    2929                                $(patsubst $(DIR_COMMON_C)/%.c,$(DIR_OBJ)/%.o,$(wildcard $(DIR_COMMON_C)/*.c))
    3030
    3131
    3232#-----[ To the compilation ]------------------------------------------------------
    33 OPTIMIZE                        = -O3 -fomit-frame-pointer -fdelayed-branch -mror -mcmov -msext -mhard-mul -msoft-div -msoft-float
     33OPTIMIZE                        = -O3 -std=c99 -fomit-frame-pointer -fdelayed-branch -mror -mcmov -msext -mhard-mul -msoft-div -msoft-float
    3434#Option :
    3535# -fomit-frame-pointer                  : n'utilise pas le pointeur de frame
     
    6464.PRECIOUS                       : $(DIR_BIN)/%.x.txt $(DIR_BIN)/%.x $(DIR_OBJ)/%.o
    6565
    66 vpath   %.h     $(DIR_INC)
    67 vpath   %.c     $(DIR_C)
    68 vpath   %.s     $(DIR_ASM):$(DIR_SYS)
     66vpath   %.h     $(DIR_INC):$(DIR_COMMON_INC)
     67vpath   %.c     $(DIR_C):$(DIR_COMMON_C)
     68vpath   %.s     $(DIR_ASM):$(DIR_SYS):$(DIR_COMMON_ASM):$(DIR_COMMON_SYS)
    6969vpath   %.o     $(DIR_OBJ)
    7070vpath   %.x     $(DIR_BIN)
     
    8282                                $(OR32_NM)      $(OR32_NM_OPT)      $^ > $@.nm; \
    8383                                $(ECHO) "Display info       : $*.x.txt";                \
    84                                 $(OR32_OBJDUMP) $(OR32_OBJDUMP_OPT) $^ > $@.txt;
     84                                $(OR32_OBJDUMP) $(OR32_OBJDUMP_OPT) $@ > $@.txt;
    8585
    8686$(DIR_OBJ)/%.o                  : %.s   
  • trunk/Softwares/Test/Test_000/src/sys/crt0.s

    r88 r101  
    2525        l.movhi r1,     hi(_tty)
    2626        l.ori   r1, r1, lo(_tty)
    27         l.sw    4(r1), r1 /* stop address */
     27        l.sw    4(r1), r0 /* stop address */
    2828        l.nop
    2929        l.nop
  • trunk/Softwares/Test/Test_001/src/sys/crt0.s

    r88 r101  
    1919        l.movhi r1,     hi(_tty)
    2020        l.ori   r1, r1, lo(_tty)
    21         l.sw    4(r1), r1 /* stop address */
     21        l.sw    4(r1), r0 /* stop address */
    2222        l.nop
    2323        l.nop
  • trunk/Softwares/Test/Test_002/src/sys/crt0.s

    r88 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_003/src/sys/crt0.s

    r88 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_004/src/sys/crt0.s

    r88 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    4245        l.movhi r1,     hi(_tty)
    4346        l.ori   r1, r1, lo(_tty)
    44         l.sw    4(r1), r1 /* stop address */
     47        l.sw    4(r1), r0 /* stop address */
    4548       
  • trunk/Softwares/Test/Test_005/src/sys/crt0.s

    r88 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_006/src/sys/crt0.s

    r98 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_007/src/sys/crt0.s

    r98 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_008/src/sys/crt0.s

    r98 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_009/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_010/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_011/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_012/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_013/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_014/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_015/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
     
    3437_start:
    3538
    36         l.movhi r2,     hi(0x00000010) /* count max */
    37         l.ori   r2, r2, lo(0x00000010)
     39        l.movhi r2,     hi(0x00000002) /* count max */
     40        l.ori   r2, r2, lo(0x00000002)
    3841       
    3942        /**********/
     
    4649        /* Test result */
    4750_test_1_loop :
    48         l.sfeq  r1, r2
    49         l.bf    _test_1_end
     51        l.sfne  r1, r2
     52        l.bf    _test_1_loop
    5053        l.addi  r1, r1, 1
    5154_test_1_end :
     
    6063        /* Test result */
    6164_test_2_loop :
    62         l.sfne  r1, r2
    63         l.bf    _test_2_loop
     65        l.sfeq  r1, r2
     66        l.bf    _test_2_end
    6467        l.addi  r1, r1, 1
     68        l.j     _test_2_loop
     69        l.nop   
    6570_test_2_end :
    6671       
  • trunk/Softwares/Test/Test_016/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
     
    4649        /* Test result */
    4750_test_1_loop :
    48         l.sfne  r1, r2
    49         l.bnf   _test_1_end
     51        l.sfeq  r1, r2
     52        l.bnf   _test_1_loop
    5053        l.addi  r1, r1, 1
    5154_test_1_end :
     
    6063        /* Test result */
    6164_test_2_loop :
    62         l.sfeq  r1, r2
    63         l.bnf   _test_2_loop
     65        l.sfne  r1, r2
     66        l.bnf   _test_2_end
    6467        l.addi  r1, r1, 1
     68        l.j     _test_2_loop
     69        l.nop   
    6570_test_2_end :
    6671       
  • trunk/Softwares/Test/Test_017/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_018/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_019/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_020/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_021/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_022/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_023/src/sys/crt0.s

    r100 r101  
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_024/src/sys/crt0.s

    r100 r101  
    11/*
    2  * Test_024
     2 * Test_025
    33 *
    44 * end_ko : infinite_loop
    55 * end_ok : Write in R1 the stop address and stop an data
    66 *          The store in the destination of an jump
    7  * start  : Test l.jr
     7 * start  : Test l.jr (no return procedure)
    88 */
    99       
     
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
  • trunk/Softwares/Test/Test_025/src/sys/crt0.s

    r100 r101  
    11/*
    2  * Test_023
     2 * Test_025
    33 *
    44 * end_ko : infinite_loop
    55 * end_ok : Write in R1 the stop address and stop an data
    66 *          The store in the destination of an jump
    7  * start  : Test l.jalr
     7 * start  : Test l.jr (return procedure)
    88 */
    99       
     
    1919        .org 0x0
    2020_end_ko        :       
     21        l.movhi r1,     hi(_tty)
     22        l.ori   r1, r1, lo(_tty)
     23        l.sw    4(r1), r1 /* stop address */
    2124_infinite_loop :       
    2225        l.j     _infinite_loop
     
    2629        l.movhi r1,     hi(_tty)
    2730        l.ori   r1, r1, lo(_tty)
    28         l.sw    4(r1), r1 /* stop address */
     31        l.sw    4(r1), r0 /* stop address */
    2932
    3033
Note: See TracChangeset for help on using the changeset viewer.