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