[53] | 1 | #ifndef morpheo_behavioural_generic_registerfile_registerfile_multi_banked_RegisterFile_Multi_Banked_h |
---|
| 2 | #define morpheo_behavioural_generic_registerfile_registerfile_multi_banked_RegisterFile_Multi_Banked_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: RegisterFile_Multi_Banked.h 137 2010-02-16 12:35:48Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | #include <iostream> |
---|
| 16 | #include "Common/include/ToString.h" |
---|
| 17 | #include "Common/include/Debug.h" |
---|
| 18 | |
---|
| 19 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Parameters.h" |
---|
| 20 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h" |
---|
| 21 | #ifdef STATISTICS |
---|
[75] | 22 | #include "Behavioural/include/Stat.h" |
---|
[53] | 23 | #endif |
---|
| 24 | #include "Behavioural/include/Component.h" |
---|
| 25 | #ifdef VHDL |
---|
| 26 | #include "Behavioural/include/Vhdl.h" |
---|
| 27 | #endif |
---|
[82] | 28 | #include "Behavioural/include/Usage.h" |
---|
[53] | 29 | |
---|
| 30 | namespace morpheo { |
---|
| 31 | namespace behavioural { |
---|
| 32 | namespace generic { |
---|
| 33 | namespace registerfile { |
---|
| 34 | namespace registerfile_multi_banked { |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | class RegisterFile_Multi_Banked |
---|
| 38 | #if SYSTEMC |
---|
| 39 | : public sc_module |
---|
| 40 | #endif |
---|
| 41 | { |
---|
| 42 | // -----[ fields ]---------------------------------------------------- |
---|
| 43 | // Parameters |
---|
[82] | 44 | protected : const std::string _name; |
---|
[57] | 45 | protected : const Parameters * _param; |
---|
[82] | 46 | private : const Tusage_t _usage; |
---|
| 47 | |
---|
[53] | 48 | #ifdef STATISTICS |
---|
[75] | 49 | public : Stat * _stat; |
---|
[137] | 50 | |
---|
| 51 | private : counter_t * _stat_nb_read; |
---|
| 52 | private : counter_t * _stat_nb_write; |
---|
| 53 | private : counter_t * _stat_nb_conflict_on_read; |
---|
| 54 | private : counter_t * _stat_nb_conflict_on_write; |
---|
[53] | 55 | #endif |
---|
| 56 | |
---|
| 57 | public : Component * _component; |
---|
| 58 | private : Interfaces * _interfaces; |
---|
| 59 | |
---|
| 60 | #ifdef SYSTEMC |
---|
| 61 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 62 | // Interface |
---|
| 63 | public : SC_CLOCK * in_CLOCK ; |
---|
| 64 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 65 | |
---|
| 66 | // ----- Interface Read |
---|
| 67 | public : SC_IN (Tcontrol_t) ** in_READ_VAL ; |
---|
| 68 | public : SC_OUT (Tcontrol_t) ** out_READ_ACK ; |
---|
| 69 | public : SC_IN (Taddress_t) ** in_READ_ADDRESS ; |
---|
| 70 | public : SC_OUT (Tdata_t) ** out_READ_DATA ; |
---|
| 71 | |
---|
| 72 | // ----- Interface Write |
---|
| 73 | public : SC_IN (Tcontrol_t) ** in_WRITE_VAL ; |
---|
| 74 | public : SC_OUT (Tcontrol_t) ** out_WRITE_ACK ; |
---|
| 75 | public : SC_IN (Taddress_t) ** in_WRITE_ADDRESS; |
---|
| 76 | public : SC_IN (Tdata_t) ** in_WRITE_DATA ; |
---|
| 77 | |
---|
| 78 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 79 | |
---|
| 80 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[78] | 81 | private : Tdata_t ** reg_DATA; |
---|
[53] | 82 | |
---|
| 83 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 84 | private : bool * internal_WRITE_VAL; |
---|
| 85 | private : Taddress_t * internal_WRITE_BANK; |
---|
| 86 | private : Taddress_t * internal_WRITE_NUM_REG; |
---|
| 87 | |
---|
[137] | 88 | #ifdef STATISTICS |
---|
| 89 | private : bool * internal_READ_VAL; |
---|
| 90 | //private : Taddress_t * internal_READ_BANK; |
---|
| 91 | #endif |
---|
| 92 | |
---|
[53] | 93 | // function pointer |
---|
| 94 | public : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_transition ) (void); |
---|
| 95 | public : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_genMealy_read ) (void); |
---|
| 96 | public : void (morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::*function_genMealy_write) (void); |
---|
| 97 | #endif |
---|
| 98 | |
---|
| 99 | // -----[ methods ]--------------------------------------------------- |
---|
| 100 | |
---|
| 101 | #ifdef SYSTEMC |
---|
| 102 | SC_HAS_PROCESS (RegisterFile_Multi_Banked); |
---|
| 103 | #endif |
---|
| 104 | public : RegisterFile_Multi_Banked ( |
---|
| 105 | #ifdef SYSTEMC |
---|
[57] | 106 | sc_module_name name, |
---|
[53] | 107 | #else |
---|
[75] | 108 | std::string name, |
---|
[53] | 109 | #endif |
---|
| 110 | #ifdef STATISTICS |
---|
[57] | 111 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
[53] | 112 | #endif |
---|
[82] | 113 | Parameters * param, |
---|
| 114 | Tusage_t usage); |
---|
[53] | 115 | |
---|
| 116 | public : ~RegisterFile_Multi_Banked (void); |
---|
| 117 | |
---|
| 118 | private : void allocation (void); |
---|
| 119 | private : void deallocation (void); |
---|
| 120 | |
---|
[88] | 121 | #ifdef SYSTEMC |
---|
[53] | 122 | private : Taddress_t address_bank (Taddress_t address); |
---|
| 123 | private : Taddress_t address_num_reg (Taddress_t address); |
---|
| 124 | |
---|
| 125 | public : void transition (void); |
---|
| 126 | public : void genMealy_read (void); |
---|
| 127 | public : void genMealy_write (void); |
---|
| 128 | |
---|
| 129 | public : void full_crossbar_transition (void); |
---|
| 130 | public : void full_crossbar_genMealy_read (void); |
---|
| 131 | public : void full_crossbar_genMealy_write (void); |
---|
| 132 | |
---|
| 133 | public : void partial_crossbar_transition (void); |
---|
| 134 | public : void partial_crossbar_genMealy_read (void); |
---|
| 135 | public : void partial_crossbar_genMealy_write(void); |
---|
| 136 | #endif |
---|
| 137 | |
---|
| 138 | #if VHDL |
---|
| 139 | public : void vhdl (void); |
---|
| 140 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 141 | private : void vhdl_body (Vhdl * & vhdl); |
---|
| 142 | #endif |
---|
| 143 | |
---|
[75] | 144 | #ifdef STATISTICS |
---|
| 145 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
[53] | 146 | #endif |
---|
[75] | 147 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 148 | private : void end_cycle (void); |
---|
| 149 | #endif |
---|
[53] | 150 | }; |
---|
| 151 | |
---|
| 152 | }; // end namespace registerfile_multi_banked |
---|
| 153 | }; // end namespace registerfile |
---|
| 154 | }; // end namespace generic |
---|
| 155 | |
---|
| 156 | }; // end namespace behavioural |
---|
| 157 | }; // end namespace morpheo |
---|
| 158 | |
---|
| 159 | #endif |
---|