[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 |
---|
[42] | 25 | #include "Behavioural/include/Component.h" |
---|
[2] | 26 | #ifdef VHDL |
---|
| 27 | #include "Behavioural/include/Vhdl.h" |
---|
| 28 | #endif |
---|
| 29 | |
---|
| 30 | using namespace std; |
---|
| 31 | |
---|
| 32 | namespace morpheo { |
---|
| 33 | namespace behavioural { |
---|
| 34 | namespace generic { |
---|
| 35 | namespace registerfile { |
---|
[15] | 36 | namespace registerfile_monolithic { |
---|
[2] | 37 | |
---|
[15] | 38 | class RegisterFile_Monolithic |
---|
[2] | 39 | #if SYSTEMC |
---|
| 40 | : public sc_module |
---|
| 41 | #endif |
---|
| 42 | { |
---|
| 43 | // -----[ fields ]---------------------------------------------------- |
---|
| 44 | // Parameters |
---|
| 45 | protected : const string _name; |
---|
| 46 | |
---|
| 47 | protected : const Parameters _param; |
---|
| 48 | #ifdef STATISTICS |
---|
| 49 | private : Statistics * _stat; |
---|
| 50 | |
---|
| 51 | private : uint32_t _stat_nb_read; |
---|
| 52 | private : uint32_t _stat_nb_write; |
---|
| 53 | #endif |
---|
| 54 | |
---|
[42] | 55 | public : Component * _component; |
---|
[41] | 56 | private : Interfaces * _interfaces; |
---|
| 57 | |
---|
[2] | 58 | #ifdef SYSTEMC |
---|
| 59 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 60 | // Interface |
---|
| 61 | public : SC_CLOCK * in_CLOCK ; |
---|
[41] | 62 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
[2] | 63 | |
---|
| 64 | // ----- Interface Read |
---|
[6] | 65 | public : SC_IN (Tcontrol_t) ** in_READ_VAL ; |
---|
| 66 | public : SC_OUT (Tcontrol_t) ** out_READ_ACK ; |
---|
[2] | 67 | public : SC_IN (Taddress_t) ** in_READ_ADDRESS ; |
---|
| 68 | public : SC_OUT (Tdata_t) ** out_READ_DATA ; |
---|
| 69 | |
---|
| 70 | // ----- Interface Write |
---|
[6] | 71 | public : SC_IN (Tcontrol_t) ** in_WRITE_VAL ; |
---|
| 72 | public : SC_OUT (Tcontrol_t) ** out_WRITE_ACK ; |
---|
[2] | 73 | public : SC_IN (Taddress_t) ** in_WRITE_ADDRESS; |
---|
| 74 | public : SC_IN (Tdata_t) ** in_WRITE_DATA ; |
---|
| 75 | |
---|
| 76 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 77 | private : SC_REGISTER (Tdata_t) ** reg_DATA ; |
---|
| 78 | |
---|
| 79 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 80 | #endif |
---|
| 81 | |
---|
| 82 | // -----[ methods ]--------------------------------------------------- |
---|
| 83 | |
---|
| 84 | #ifdef SYSTEMC |
---|
[15] | 85 | SC_HAS_PROCESS (RegisterFile_Monolithic); |
---|
[2] | 86 | #endif |
---|
| 87 | |
---|
[15] | 88 | public : RegisterFile_Monolithic ( |
---|
[2] | 89 | #ifdef SYSTEMC |
---|
| 90 | sc_module_name name, |
---|
| 91 | #else |
---|
| 92 | string name, |
---|
| 93 | #endif |
---|
| 94 | #ifdef STATISTICS |
---|
| 95 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
| 96 | #endif |
---|
| 97 | Parameters param ); |
---|
| 98 | |
---|
[15] | 99 | public : RegisterFile_Monolithic (Parameters param ); |
---|
| 100 | public : ~RegisterFile_Monolithic (void); |
---|
[2] | 101 | |
---|
| 102 | #ifdef SYSTEMC |
---|
| 103 | private : void allocation (void); |
---|
| 104 | private : void deallocation (void); |
---|
| 105 | |
---|
| 106 | public : void transition (void); |
---|
| 107 | //public : void genMoore (void) {/* empty */}; |
---|
| 108 | public : void genMealy_read (void); |
---|
| 109 | #endif |
---|
| 110 | |
---|
| 111 | #ifdef STATISTICS |
---|
| 112 | public : string statistics (uint32_t depth); |
---|
| 113 | #endif |
---|
| 114 | #if VHDL |
---|
| 115 | private : void vhdl (void); |
---|
[43] | 116 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
[41] | 117 | private : void vhdl_body (Vhdl * & vhdl); |
---|
[2] | 118 | #endif |
---|
| 119 | |
---|
| 120 | #ifdef VHDL_TESTBENCH |
---|
[41] | 121 | private : void vhdl_testbench_transition (void); |
---|
[2] | 122 | #endif |
---|
| 123 | |
---|
| 124 | }; |
---|
| 125 | |
---|
[15] | 126 | }; // end namespace registerfile_monolithic |
---|
[2] | 127 | }; // end namespace registerfile |
---|
| 128 | }; // end namespace generic |
---|
| 129 | }; // end namespace behavioural |
---|
| 130 | }; // end namespace morpheo |
---|
| 131 | |
---|
| 132 | #endif |
---|