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