[15] | 1 | #ifndef morpheo_behavioural_generic_registerfile_registerfile_monolithic_RegisterFile_Monolithic |
---|
| 2 | #define morpheo_behavioural_generic_registerfile_registerfile_monolithic_RegisterFile_Monolithic |
---|
[2] | 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | #include "Include/Debug.h" |
---|
| 16 | #include "Include/ToString.h" |
---|
| 17 | #include <iostream> |
---|
| 18 | using namespace std; |
---|
| 19 | |
---|
[15] | 20 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h" |
---|
| 21 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h" |
---|
[2] | 22 | #ifdef STATISTICS |
---|
[15] | 23 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h" |
---|
[2] | 24 | #endif |
---|
[41] | 25 | #ifdef POSITION |
---|
| 26 | #include "Behavioural/include/Position.h" |
---|
| 27 | #else |
---|
| 28 | #include "Behavioural/include/Interfaces.h" |
---|
| 29 | #endif |
---|
[2] | 30 | #ifdef VHDL |
---|
| 31 | #include "Behavioural/include/Vhdl.h" |
---|
| 32 | #endif |
---|
| 33 | |
---|
| 34 | using namespace std; |
---|
| 35 | |
---|
| 36 | namespace morpheo { |
---|
| 37 | namespace behavioural { |
---|
| 38 | namespace generic { |
---|
| 39 | namespace registerfile { |
---|
[15] | 40 | namespace registerfile_monolithic { |
---|
[2] | 41 | |
---|
[15] | 42 | class RegisterFile_Monolithic |
---|
[2] | 43 | #if SYSTEMC |
---|
| 44 | : public sc_module |
---|
| 45 | #endif |
---|
| 46 | { |
---|
| 47 | // -----[ fields ]---------------------------------------------------- |
---|
| 48 | // Parameters |
---|
| 49 | protected : const string _name; |
---|
| 50 | |
---|
| 51 | protected : const Parameters _param; |
---|
| 52 | #ifdef STATISTICS |
---|
| 53 | private : Statistics * _stat; |
---|
| 54 | |
---|
| 55 | private : uint32_t _stat_nb_read; |
---|
| 56 | private : uint32_t _stat_nb_write; |
---|
| 57 | #endif |
---|
| 58 | |
---|
[41] | 59 | #ifdef POSITION |
---|
| 60 | private : Position * _position; |
---|
[2] | 61 | #endif |
---|
| 62 | |
---|
[41] | 63 | private : Interfaces * _interfaces; |
---|
| 64 | |
---|
[2] | 65 | #ifdef SYSTEMC |
---|
| 66 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 67 | // Interface |
---|
| 68 | public : SC_CLOCK * in_CLOCK ; |
---|
[41] | 69 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
[2] | 70 | |
---|
| 71 | // ----- Interface Read |
---|
[6] | 72 | public : SC_IN (Tcontrol_t) ** in_READ_VAL ; |
---|
| 73 | public : SC_OUT (Tcontrol_t) ** out_READ_ACK ; |
---|
[2] | 74 | public : SC_IN (Taddress_t) ** in_READ_ADDRESS ; |
---|
| 75 | public : SC_OUT (Tdata_t) ** out_READ_DATA ; |
---|
| 76 | |
---|
| 77 | // ----- Interface Write |
---|
[6] | 78 | public : SC_IN (Tcontrol_t) ** in_WRITE_VAL ; |
---|
| 79 | public : SC_OUT (Tcontrol_t) ** out_WRITE_ACK ; |
---|
[2] | 80 | public : SC_IN (Taddress_t) ** in_WRITE_ADDRESS; |
---|
| 81 | public : SC_IN (Tdata_t) ** in_WRITE_DATA ; |
---|
| 82 | |
---|
| 83 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 84 | private : SC_REGISTER (Tdata_t) ** reg_DATA ; |
---|
| 85 | |
---|
| 86 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 87 | #endif |
---|
| 88 | |
---|
| 89 | // -----[ methods ]--------------------------------------------------- |
---|
| 90 | |
---|
| 91 | #ifdef SYSTEMC |
---|
[15] | 92 | SC_HAS_PROCESS (RegisterFile_Monolithic); |
---|
[2] | 93 | #endif |
---|
| 94 | |
---|
[15] | 95 | public : RegisterFile_Monolithic ( |
---|
[2] | 96 | #ifdef SYSTEMC |
---|
| 97 | sc_module_name name, |
---|
| 98 | #else |
---|
| 99 | string name, |
---|
| 100 | #endif |
---|
| 101 | #ifdef STATISTICS |
---|
| 102 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
| 103 | #endif |
---|
| 104 | Parameters param ); |
---|
| 105 | |
---|
[15] | 106 | public : RegisterFile_Monolithic (Parameters param ); |
---|
| 107 | public : ~RegisterFile_Monolithic (void); |
---|
[2] | 108 | |
---|
| 109 | #ifdef SYSTEMC |
---|
| 110 | private : void allocation (void); |
---|
| 111 | private : void deallocation (void); |
---|
| 112 | |
---|
| 113 | public : void transition (void); |
---|
| 114 | //public : void genMoore (void) {/* empty */}; |
---|
| 115 | public : void genMealy_read (void); |
---|
| 116 | #endif |
---|
| 117 | |
---|
| 118 | #ifdef STATISTICS |
---|
| 119 | public : string statistics (uint32_t depth); |
---|
| 120 | #endif |
---|
| 121 | #if VHDL |
---|
| 122 | private : void vhdl (void); |
---|
[41] | 123 | private : void vhdl_port (Vhdl * & vhdl); |
---|
| 124 | private : void vhdl_type (Vhdl * & vhdl); |
---|
| 125 | private : void vhdl_signal (Vhdl * & vhdl); |
---|
| 126 | private : void vhdl_body (Vhdl * & vhdl); |
---|
[2] | 127 | #endif |
---|
| 128 | |
---|
| 129 | #ifdef VHDL_TESTBENCH |
---|
[41] | 130 | private : void vhdl_testbench_transition (void); |
---|
[2] | 131 | #endif |
---|
| 132 | |
---|
| 133 | }; |
---|
| 134 | |
---|
[15] | 135 | }; // end namespace registerfile_monolithic |
---|
[2] | 136 | }; // end namespace registerfile |
---|
| 137 | }; // end namespace generic |
---|
| 138 | }; // end namespace behavioural |
---|
| 139 | }; // end namespace morpheo |
---|
| 140 | |
---|
| 141 | #endif |
---|