Ignore:
Timestamp:
Mar 27, 2008, 11:04:49 AM (16 years ago)
Author:
rosiere
Message:

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h

    r75 r78  
    55 * $Id$
    66 *
    7  * [ Description ]
     7 * [ Description ]
    88 *
    99 */
     
    5353#endif
    5454  {
    55     // -----[ internal class ]--------------------------------------------
    56   protected : class entry_t
    57   {
    58     // Numerotation of victim_pseudo_lru's tree
    59     // Tree of Pseudo-LRU
    60     //
    61     // | d2              [3]                 |
    62     // |          0_______|_______1          |
    63     // |          |               |          |
    64     // | d1      [1]             [5]         |
    65     // |      0___|___1       0___|___1      |
    66     // |      |       |       |       |      |
    67     // | d0  [0]     [2]     [4]     [6]     |
    68     // |    0_|_1   0_|_1   0_|_1   0_|_1    |
    69     // |    |   |   |   |   |   |   |   |    |
    70     // |   Way Way Way Way Way Way Way Way   |
    71     // |    0   1   2   3   4   5   6   7    |
    72     //
    73     // Access :  Way N with N=2*n   -> bit 2*n = 0
    74     //                 with N=2*n+1 -> bit 2*n = 1
    75     //
    76     // if bit = B, depth = D, next_B = B+D if B==1
    77     //                               = B-D if B==0
    78     //
    79     // Update :
     55    // -----[ fields ]----------------------------------------------------
     56    // Parameters
     57  protected : const std::string   _name;
    8058
    81   private : bool    * _entry;
    82   private : uint32_t  _size;
    83 
    84   public  : entry_t ()
    85     {
    86     };
    87   public  : entry_t (uint32_t size) : _size (size)
    88     {
    89       _entry = new bool [size];
    90      
    91       // initialisation
    92       for (uint32_t i=0; i<size; i++)
    93         _entry [i] = false;
    94     }
    95    
    96   public : ~entry_t ()
    97     {
    98       delete _entry;
    99     }
    100    
    101   private : uint32_t one_access (uint32_t index, uint32_t offset)
    102     {
    103       bool val = _entry[index];
    104      
    105       // Compute next slot
    106       if (val == true)
    107         return index + offset;
    108       else
    109         return index - offset;
    110     }
    111 
    112   public : uint32_t access ()
    113     {
    114       uint32_t index = (_size>>1)-1; // medium
    115 
    116       for (int32_t i=static_cast<uint32_t>(log2(_size)-1); i>= 1; i--)
    117         {
    118           index = one_access (index,(1<<(i-1)));
    119         }
    120       index = one_access (index,0);
    121      
    122       // reverse by one_access make always a reverse
    123       uint32_t offset = (_entry[index]==true)?1:0;
    124 
    125       return index+offset;
    126     }
    127 
    128   private : uint32_t one_update (uint32_t index, uint32_t offset, uint32_t value)
    129     {
    130       uint32_t mask = (offset==0)?1:(offset<<1);
    131       bool     val  = ((value & mask) != 0);
    132 
    133       // reverse
    134       _entry[index] = not val;
    135 
    136       if (val == true)
    137       // Compute next slot
    138         return index + offset;
    139       else
    140         return index - offset;
    141     }
    142   public : void update (uint32_t value)
    143     {
    144       uint32_t index = (_size>>1)-1; // medium
    145 
    146       for (int32_t i=static_cast<uint32_t>(log2(_size)-1); i>=1; i--)
    147         {
    148           index = one_update (index,1<<(i-1),value);
    149         }
    150       index = one_update (index,0,value);
    151     }
    152 
    153   public : std::string print ()
    154     {
    155       std::string res = "";
    156 
    157       for (int32_t i=static_cast<int32_t>(_size)-1; i>=0; i--)
    158         res += toString(_entry[i]) + " ";
    159 
    160       return res;
    161     }
    162 
    163   };
    164     // -----[ fields ]----------------------------------------------------
    165     // Parameters
    166   protected : const std::string     _name;
    167 
    168   protected : const Parameters _param;
     59  protected : const Parameters  * _param;
    16960#ifdef STATISTICS
    17061  public    : Stat                           * _stat;
     
    17566
    17667#ifdef SYSTEMC
    177     // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     68    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    17869    // Interface
    17970  public    : SC_CLOCK                      *  in_CLOCK         ;
     
    18475  public    : SC_OUT(Tcontrol_t)           ** out_ACCESS_ACK    ;
    18576  public    : SC_IN (Taddress_t)           **  in_ACCESS_ADDRESS;
    186   public    : SC_OUT(Tentity_t )           ** out_ACCESS_ENTITY ;
    187     // Interface update
    188   public    : SC_IN (Tcontrol_t)           **  in_UPDATE_VAL    ;
    189   public    : SC_OUT(Tcontrol_t)           ** out_UPDATE_ACK    ;
    190   public    : SC_IN (Taddress_t)           **  in_UPDATE_ADDRESS;
    191   public    : SC_IN (Tentity_t )           **  in_UPDATE_ENTITY ;
     77  public    : SC_IN (Tcontrol_t)           **  in_ACCESS_HIT    ; // hit = 1 : update next_victim with in_entity else with out_victim
     78  public    : SC_IN (Tentity_t )           **  in_ACCESS_ENTITY ;
     79  public    : SC_OUT(Tentity_t )           ** out_ACCESS_VICTIM ;
    19280
    19381    // Interface update
    194     // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     82    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    19583  private   : entry_t                      ** reg_TABLE;
    19684
    197     // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    198   private   : Tentity_t                     * internal_ACCESS_ENTITY;
     85    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     86  private   : Tcontrol_t                    * internal_ACCESS_ACK   ;
     87  private   : Tentity_t                     * internal_ACCESS_VICTIM;
    19988#endif
    20089
    201     // -----[ methods ]---------------------------------------------------
     90    // -----[ methods ]---------------------------------------------------
    20291
    20392#ifdef SYSTEMC
     
    20594#endif
    20695
    207   public  :          Victim_Pseudo_LRU              (
     96  public  :          Victim_Pseudo_LRU             
     97  (
    20898#ifdef SYSTEMC
    209                                               sc_module_name                                name,
     99   sc_module_name                                name,
    210100#else                                         
    211                                               std::string                                   name,
     101   std::string                                   name,
    212102#endif                                         
    213103#ifdef STATISTICS
    214                                               morpheo::behavioural::Parameters_Statistics * param_statistics,
     104   morpheo::behavioural::Parameters_Statistics * param_statistics,
    215105#endif
    216                                               Parameters                                    param );
     106   Parameters                                  * param );
    217107                                               
    218108  public  :          Victim_Pseudo_LRU              (Parameters param );
     
    224114                                               
    225115  public  : void     transition                (void);
    226   public  : void     genMealy_access           (void);
     116  public  : void     genMoore                  (void);
    227117#endif
    228118                                               
Note: See TracChangeset for help on using the changeset viewer.