[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$ |
---|
| 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" |
---|
[10] | 43 | |
---|
| 44 | namespace morpheo { |
---|
| 45 | namespace behavioural { |
---|
| 46 | namespace generic { |
---|
| 47 | namespace victim { |
---|
[15] | 48 | namespace victim_pseudo_lru { |
---|
[10] | 49 | |
---|
[15] | 50 | class Victim_Pseudo_LRU |
---|
[10] | 51 | #if SYSTEMC |
---|
| 52 | : public sc_module |
---|
| 53 | #endif |
---|
| 54 | { |
---|
[78] | 55 | // -----[ fields ]---------------------------------------------------- |
---|
[10] | 56 | // Parameters |
---|
[78] | 57 | protected : const std::string _name; |
---|
[10] | 58 | |
---|
[78] | 59 | protected : const Parameters * _param; |
---|
[10] | 60 | #ifdef STATISTICS |
---|
[75] | 61 | public : Stat * _stat; |
---|
[10] | 62 | #endif |
---|
| 63 | |
---|
[75] | 64 | public : Component * _component; |
---|
[42] | 65 | private : Interfaces * _interfaces; |
---|
[10] | 66 | |
---|
| 67 | #ifdef SYSTEMC |
---|
[78] | 68 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[10] | 69 | // Interface |
---|
| 70 | public : SC_CLOCK * in_CLOCK ; |
---|
[15] | 71 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
[10] | 72 | |
---|
| 73 | // Interface access |
---|
| 74 | public : SC_IN (Tcontrol_t) ** in_ACCESS_VAL ; |
---|
| 75 | public : SC_OUT(Tcontrol_t) ** out_ACCESS_ACK ; |
---|
| 76 | public : SC_IN (Taddress_t) ** in_ACCESS_ADDRESS; |
---|
[78] | 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 ; |
---|
[10] | 80 | |
---|
| 81 | // Interface update |
---|
[78] | 82 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[10] | 83 | private : entry_t ** reg_TABLE; |
---|
| 84 | |
---|
[78] | 85 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 86 | private : Tcontrol_t * internal_ACCESS_ACK ; |
---|
| 87 | private : Tentity_t * internal_ACCESS_VICTIM; |
---|
[10] | 88 | #endif |
---|
| 89 | |
---|
[78] | 90 | // -----[ methods ]--------------------------------------------------- |
---|
[10] | 91 | |
---|
| 92 | #ifdef SYSTEMC |
---|
[15] | 93 | SC_HAS_PROCESS (Victim_Pseudo_LRU); |
---|
[10] | 94 | #endif |
---|
| 95 | |
---|
[78] | 96 | public : Victim_Pseudo_LRU |
---|
| 97 | ( |
---|
[10] | 98 | #ifdef SYSTEMC |
---|
[78] | 99 | sc_module_name name, |
---|
[10] | 100 | #else |
---|
[78] | 101 | std::string name, |
---|
[10] | 102 | #endif |
---|
| 103 | #ifdef STATISTICS |
---|
[78] | 104 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
[10] | 105 | #endif |
---|
[78] | 106 | Parameters * param ); |
---|
[10] | 107 | |
---|
[15] | 108 | public : Victim_Pseudo_LRU (Parameters param ); |
---|
| 109 | public : ~Victim_Pseudo_LRU (void); |
---|
[10] | 110 | |
---|
| 111 | #ifdef SYSTEMC |
---|
| 112 | private : void allocation (void); |
---|
| 113 | private : void deallocation (void); |
---|
| 114 | |
---|
| 115 | public : void transition (void); |
---|
[78] | 116 | public : void genMoore (void); |
---|
[10] | 117 | #endif |
---|
| 118 | |
---|
| 119 | #if VHDL |
---|
| 120 | public : void vhdl (void); |
---|
[42] | 121 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 122 | private : void vhdl_body (Vhdl * & vhdl); |
---|
[10] | 123 | #endif |
---|
| 124 | |
---|
[75] | 125 | #ifdef STATISTICS |
---|
| 126 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
[10] | 127 | #endif |
---|
| 128 | |
---|
[75] | 129 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 130 | private : void end_cycle (void); |
---|
| 131 | #endif |
---|
[10] | 132 | }; |
---|
| 133 | |
---|
[15] | 134 | }; // end namespace victim_pseudo_lru |
---|
[10] | 135 | }; // end namespace victim |
---|
| 136 | }; // end namespace generic |
---|
| 137 | |
---|
| 138 | }; // end namespace behavioural |
---|
| 139 | }; // end namespace morpheo |
---|
| 140 | |
---|
| 141 | #endif |
---|