source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h @ 88

Last change on this file since 88 was 88, checked in by rosiere, 16 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 4.5 KB
RevLine 
[15]1#ifndef morpheo_behavioural_generic_victim_victim_pseudo_lru_Victim_Pseudo_LRU_h
2#define morpheo_behavioural_generic_victim_victim_pseudo_lru_Victim_Pseudo_LRU_h
[10]3
4/*
5 * $Id: Victim_Pseudo_LRU.h 88 2008-12-10 18:31:39Z rosiere $
6 *
[78]7 * [ Description ]
[10]8 *
9 */
10    // Tree of Pseudo-LRU
11    //
12    // |               4-5-6-7?              |
13    // |          0_______|_______1          |
14    // |          |               |          |
15    // |         2-3?            6-7?        |
16    // |      0___|___1       0___|___1      |
17    // |      |       |       |       |      |
18    // |      1?      3?      5?      7?     |
19    // |    0_|_1   0_|_1   0_|_1   0_|_1    |
20    // |    |   |   |   |   |   |   |   |    |
21    // |   Way Way Way Way Way Way Way Way   |
22    // |    0   1   2   3   4   5   6   7    |
23
24
25
26#ifdef SYSTEMC
27#include "systemc.h"
28#endif
29
30#include <iostream>
[44]31#include "Common/include/ToString.h"
32#include "Common/include/Debug.h"
[10]33
[15]34#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Parameters.h"
35#include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h"
[10]36#ifdef STATISTICS
[75]37#include "Behavioural/include/Stat.h"
[10]38#endif
39#ifdef VHDL
40#include "Behavioural/include/Vhdl.h"
41#endif
[42]42#include "Behavioural/include/Component.h"
[82]43#include "Behavioural/include/Usage.h"
[10]44
45namespace morpheo {
46namespace behavioural {
47namespace generic {
48namespace victim {
[15]49namespace victim_pseudo_lru {
[10]50
[15]51  class Victim_Pseudo_LRU
[10]52#if SYSTEMC
53    : public sc_module
54#endif
55  {
[78]56    // -----[ fields ]----------------------------------------------------
[10]57    // Parameters
[82]58  protected : const std::string  _name;
59  protected : const Parameters * _param;
60  private   : const Tusage_t     _usage;
[10]61
62#ifdef STATISTICS
[75]63  public    : Stat                           * _stat;
[10]64#endif
65
[75]66  public    : Component                      * _component;
[42]67  private   : Interfaces                     * _interfaces;
[10]68
69#ifdef SYSTEMC
[78]70    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[10]71    // Interface
72  public    : SC_CLOCK                      *  in_CLOCK         ;
[15]73  public    : SC_IN (Tcontrol_t)            *  in_NRESET        ;
[10]74
75    // Interface access
76  public    : SC_IN (Tcontrol_t)           **  in_ACCESS_VAL    ;
77  public    : SC_OUT(Tcontrol_t)           ** out_ACCESS_ACK    ;
78  public    : SC_IN (Taddress_t)           **  in_ACCESS_ADDRESS;
[78]79  public    : SC_IN (Tcontrol_t)           **  in_ACCESS_HIT    ; // hit = 1 : update next_victim with in_entity else with out_victim
80  public    : SC_IN (Tentity_t )           **  in_ACCESS_ENTITY ;
81  public    : SC_OUT(Tentity_t )           ** out_ACCESS_VICTIM ;
[10]82
83    // Interface update
[78]84    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
[10]85  private   : entry_t                      ** reg_TABLE;
86
[78]87    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88  private   : Tcontrol_t                    * internal_ACCESS_ACK   ;
89  private   : Tentity_t                     * internal_ACCESS_VICTIM;
[10]90#endif
91
[78]92    // -----[ methods ]---------------------------------------------------
[10]93
94#ifdef SYSTEMC
[15]95    SC_HAS_PROCESS (Victim_Pseudo_LRU);
[10]96#endif
97
[78]98  public  :          Victim_Pseudo_LRU             
99  (
[10]100#ifdef SYSTEMC
[78]101   sc_module_name                                name,
[10]102#else                                         
[78]103   std::string                                   name,
[10]104#endif                                         
105#ifdef STATISTICS
[78]106   morpheo::behavioural::Parameters_Statistics * param_statistics,
[10]107#endif
[82]108   Parameters                                  * param ,
109   morpheo::behavioural::Tusage_t                usage);
[10]110                                               
[15]111  public  :          Victim_Pseudo_LRU              (Parameters param );
112  public  :          ~Victim_Pseudo_LRU             (void);
[10]113                                               
114  private : void     allocation                (void);
115  private : void     deallocation              (void);
116                                               
[88]117#ifdef SYSTEMC                                 
[10]118  public  : void     transition                (void);
[88]119  public  : void     genMealy                  (void);
[10]120#endif
121                                               
122#if VHDL                                       
123  public  : void     vhdl                      (void);
[42]124  private : void     vhdl_declaration          (Vhdl * & vhdl);
125  private : void     vhdl_body                 (Vhdl * & vhdl);
[10]126#endif                                         
127                                               
[75]128#ifdef STATISTICS
129  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
[10]130#endif
131
[75]132#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
133  private : void     end_cycle                 (void);
134#endif
[10]135  };
136
[15]137}; // end namespace victim_pseudo_lru
[10]138}; // end namespace victim
139}; // end namespace generic
140
141}; // end namespace behavioural
142}; // end namespace morpheo             
143
144#endif
Note: See TracBrowser for help on using the repository browser.