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