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/IPs/systemC/Environment
Files:
8 edited

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");
Note: See TracChangeset for help on using the changeset viewer.