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