[88] | 1 | #ifndef morpheo_behavioural_core_Core_h |
---|
| 2 | #define morpheo_behavioural_core_Core_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Core.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 | |
---|
| 15 | #include "Behavioural/Core/Multi_Front_end/Front_end/include/Front_end.h" |
---|
| 16 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/include/OOO_Engine.h" |
---|
| 17 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/include/Execute_loop.h" |
---|
| 18 | #include "Behavioural/Core/Icache_Access/include/Icache_Access.h" |
---|
| 19 | #include "Behavioural/Core/Dcache_Access/include/Dcache_Access.h" |
---|
| 20 | #include "Behavioural/Core/Core_Glue/include/Core_Glue.h" |
---|
| 21 | |
---|
| 22 | #include "Behavioural/Core/include/Parameters.h" |
---|
| 23 | #include "Behavioural/include/Types.h" |
---|
| 24 | |
---|
| 25 | #ifdef STATISTICS |
---|
| 26 | #include "Behavioural/include/Stat.h" |
---|
| 27 | #endif |
---|
| 28 | #include "Behavioural/include/Component.h" |
---|
| 29 | #ifdef VHDL |
---|
| 30 | #include "Behavioural/include/Vhdl.h" |
---|
| 31 | #endif |
---|
| 32 | #include "Behavioural/include/Usage.h" |
---|
[145] | 33 | // #include "Behavioural/include/Function_pointer.h" |
---|
[88] | 34 | |
---|
| 35 | #include "Common/include/ToString.h" |
---|
| 36 | #include "Common/include/Debug.h" |
---|
| 37 | |
---|
| 38 | #include <iostream> |
---|
| 39 | |
---|
| 40 | namespace morpheo { |
---|
| 41 | namespace behavioural { |
---|
| 42 | namespace core { |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | class Core |
---|
| 46 | #if SYSTEMC |
---|
| 47 | : public sc_module |
---|
| 48 | #endif |
---|
| 49 | { |
---|
| 50 | // -----[ fields ]---------------------------------------------------- |
---|
| 51 | // Parameters |
---|
| 52 | protected : const std::string _name; |
---|
| 53 | protected : const Parameters * _param; |
---|
| 54 | private : const Tusage_t _usage; |
---|
| 55 | |
---|
| 56 | #ifdef STATISTICS |
---|
| 57 | public : Stat * _stat; |
---|
| 58 | #endif |
---|
| 59 | |
---|
| 60 | public : Component * _component; |
---|
| 61 | private : Interfaces * _interfaces; |
---|
| 62 | |
---|
| 63 | #ifdef SYSTEMC |
---|
| 64 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 65 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 66 | public : SC_CLOCK * in_CLOCK ; |
---|
| 67 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 68 | |
---|
| 69 | // ~~~~~[ Interface "icache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 70 | public : SC_OUT(Tcontrol_t ) ** out_ICACHE_REQ_VAL ;//[nb_icache_port] |
---|
| 71 | public : SC_IN (Tcontrol_t ) ** in_ICACHE_REQ_ACK ;//[nb_icache_port] |
---|
| 72 | public : SC_OUT(Tcontext_t ) ** out_ICACHE_REQ_THREAD_ID ;//[nb_icache_port] |
---|
| 73 | public : SC_OUT(Tpacket_t ) ** out_ICACHE_REQ_PACKET_ID ;//[nb_icache_port] |
---|
| 74 | public : SC_OUT(Ticache_address_t ) ** out_ICACHE_REQ_ADDRESS ;//[nb_icache_port] |
---|
| 75 | public : SC_OUT(Ticache_type_t ) ** out_ICACHE_REQ_TYPE ;//[nb_icache_port] |
---|
| 76 | |
---|
| 77 | // ~~~~~[ Interface "icache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 78 | public : SC_IN (Tcontrol_t ) ** in_ICACHE_RSP_VAL ;//[nb_icache_port] |
---|
| 79 | public : SC_OUT(Tcontrol_t ) ** out_ICACHE_RSP_ACK ;//[nb_icache_port] |
---|
| 80 | public : SC_IN (Tcontext_t ) ** in_ICACHE_RSP_THREAD_ID ;//[nb_icache_port] |
---|
| 81 | public : SC_IN (Tpacket_t ) ** in_ICACHE_RSP_PACKET_ID ;//[nb_icache_port] |
---|
| 82 | public : SC_IN (Ticache_instruction_t) *** in_ICACHE_RSP_INSTRUCTION ;//[nb_icache_port][icache_nb_instruction] |
---|
| 83 | public : SC_IN (Ticache_error_t ) ** in_ICACHE_RSP_ERROR ;//[nb_icache_port] |
---|
| 84 | |
---|
| 85 | // ~~~~~[ Interface "dcache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 86 | public : SC_OUT(Tcontrol_t ) ** out_DCACHE_REQ_VAL ;//[nb_dcache_port] |
---|
| 87 | public : SC_IN (Tcontrol_t ) ** in_DCACHE_REQ_ACK ;//[nb_dcache_port] |
---|
| 88 | public : SC_OUT(Tcontext_t ) ** out_DCACHE_REQ_THREAD_ID ;//[nb_dcache_port] |
---|
| 89 | public : SC_OUT(Tpacket_t ) ** out_DCACHE_REQ_PACKET_ID ;//[nb_dcache_port] |
---|
| 90 | public : SC_OUT(Tdcache_address_t ) ** out_DCACHE_REQ_ADDRESS ;//[nb_dcache_port] |
---|
| 91 | public : SC_OUT(Tdcache_data_t ) ** out_DCACHE_REQ_WDATA ;//[nb_dcache_port] |
---|
| 92 | public : SC_OUT(Tdcache_type_t ) ** out_DCACHE_REQ_TYPE ;//[nb_dcache_port] |
---|
| 93 | |
---|
| 94 | // ~~~~~[ Interface "dcache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 95 | public : SC_IN (Tcontrol_t ) ** in_DCACHE_RSP_VAL ;//[nb_dcache_port] |
---|
| 96 | public : SC_OUT(Tcontrol_t ) ** out_DCACHE_RSP_ACK ;//[nb_dcache_port] |
---|
| 97 | public : SC_IN (Tcontext_t ) ** in_DCACHE_RSP_THREAD_ID ;//[nb_dcache_port] |
---|
| 98 | public : SC_IN (Tpacket_t ) ** in_DCACHE_RSP_PACKET_ID ;//[nb_dcache_port] |
---|
| 99 | public : SC_IN (Tdcache_data_t ) ** in_DCACHE_RSP_RDATA ;//[nb_dcache_port] |
---|
| 100 | public : SC_IN (Tdcache_error_t ) ** in_DCACHE_RSP_ERROR ;//[nb_dcache_port] |
---|
| 101 | |
---|
| 102 | // ~~~~~[ Interface : "interrupt" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 103 | public : SC_IN (Tcontrol_t ) ** in_INTERRUPT_ENABLE ;//[nb_thread] - Interrupt Exception |
---|
| 104 | |
---|
| 105 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 106 | private : core::multi_front_end::front_end::Front_end ** _component_front_end; |
---|
| 107 | private : core::multi_ooo_engine::ooo_engine::OOO_Engine ** _component_ooo_engine; |
---|
| 108 | private : core::multi_execute_loop::execute_loop::Execute_loop ** _component_execute_loop; |
---|
| 109 | private : core::icache_access::Icache_Access * _component_icache_access; |
---|
| 110 | private : core::dcache_access::Dcache_Access * _component_dcache_access; |
---|
| 111 | private : core::core_glue::Core_Glue * _component_glue; |
---|
| 112 | |
---|
| 113 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 114 | |
---|
| 115 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 116 | #endif |
---|
| 117 | |
---|
| 118 | // -----[ Methods ]--------------------------------------------------- |
---|
| 119 | |
---|
| 120 | #ifdef SYSTEMC |
---|
| 121 | SC_HAS_PROCESS (Core); |
---|
| 122 | #endif |
---|
| 123 | public : Core |
---|
| 124 | ( |
---|
| 125 | #ifdef SYSTEMC |
---|
| 126 | sc_module_name name, |
---|
| 127 | #else |
---|
| 128 | std::string name, |
---|
| 129 | #endif |
---|
| 130 | #ifdef STATISTICS |
---|
| 131 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 132 | #endif |
---|
| 133 | Parameters * param, |
---|
[145] | 134 | morpheo::behavioural::Tusage_t usage// , |
---|
| 135 | // morpheo::behavioural::Function_pointer * function_pointer |
---|
[88] | 136 | ); |
---|
| 137 | public : ~Core (void); |
---|
| 138 | |
---|
| 139 | |
---|
| 140 | private : void allocation ( |
---|
| 141 | #ifdef STATISTICS |
---|
| 142 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 143 | #else |
---|
[145] | 144 | void |
---|
[88] | 145 | #endif |
---|
[145] | 146 | |
---|
| 147 | // #ifdef STATISTICS |
---|
| 148 | // morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 149 | // #endif |
---|
| 150 | // morpheo::behavioural::Function_pointer * function_pointer |
---|
[88] | 151 | ); |
---|
| 152 | private : void deallocation (void); |
---|
| 153 | |
---|
| 154 | #ifdef SYSTEMC |
---|
| 155 | # if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 156 | public : void transition (void); |
---|
| 157 | # endif |
---|
| 158 | #endif |
---|
| 159 | |
---|
| 160 | #if VHDL |
---|
| 161 | public : void vhdl (void); |
---|
| 162 | #endif |
---|
| 163 | |
---|
| 164 | #ifdef STATISTICS |
---|
| 165 | public : void statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
| 166 | public : void statistics_deallocation (void); |
---|
| 167 | #endif |
---|
| 168 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 169 | private : void end_cycle (void); |
---|
| 170 | #endif |
---|
| 171 | }; |
---|
| 172 | |
---|
| 173 | }; // end namespace core |
---|
| 174 | }; // end namespace behavioural |
---|
| 175 | }; // end namespace morpheo |
---|
| 176 | |
---|
| 177 | #endif |
---|