| 1 | #ifndef morpheo_behavioural_generic_queue_Queue_h |
|---|
| 2 | #define morpheo_behavioural_generic_queue_Queue_h |
|---|
| 3 | |
|---|
| 4 | /* |
|---|
| 5 | * $Id$ |
|---|
| 6 | * |
|---|
| 7 | * [ Description ] |
|---|
| 8 | * |
|---|
| 9 | */ |
|---|
| 10 | |
|---|
| 11 | #ifdef SYSTEMC |
|---|
| 12 | #include "systemc.h" |
|---|
| 13 | #endif |
|---|
| 14 | |
|---|
| 15 | #include <iostream> |
|---|
| 16 | #include "Common/include/ToString.h" |
|---|
| 17 | #include "Common/include/Debug.h" |
|---|
| 18 | |
|---|
| 19 | #include "Behavioural/Generic/Queue_Control/include/Queue_Control.h" |
|---|
| 20 | |
|---|
| 21 | #include "Behavioural/Generic/Queue/include/Types.h" |
|---|
| 22 | #include "Behavioural/Generic/Queue/include/Parameters.h" |
|---|
| 23 | #ifdef STATISTICS |
|---|
| 24 | #include "Behavioural/include/Stat.h" |
|---|
| 25 | #endif |
|---|
| 26 | #include "Behavioural/include/Component.h" |
|---|
| 27 | #ifdef VHDL |
|---|
| 28 | #include "Behavioural/include/Vhdl.h" |
|---|
| 29 | #endif |
|---|
| 30 | #include "Behavioural/include/Usage.h" |
|---|
| 31 | |
|---|
| 32 | namespace morpheo { |
|---|
| 33 | namespace behavioural { |
|---|
| 34 | namespace generic { |
|---|
| 35 | namespace queue { |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | class Queue |
|---|
| 39 | #if SYSTEMC |
|---|
| 40 | : public sc_module |
|---|
| 41 | #endif |
|---|
| 42 | { |
|---|
| 43 | // -----[ fields ]---------------------------------------------------- |
|---|
| 44 | // Parameters |
|---|
| 45 | protected : const std::string _name; |
|---|
| 46 | protected : const Parameters * _param; |
|---|
| 47 | private : const Tusage_t _usage; |
|---|
| 48 | |
|---|
| 49 | //#ifdef STATISTICS |
|---|
| 50 | // protected : const morpheo::behavioural::Parameters_Statistics * _param_statistics; |
|---|
| 51 | //#endif |
|---|
| 52 | |
|---|
| 53 | #ifdef STATISTICS |
|---|
| 54 | public : Stat * _stat; |
|---|
| 55 | #endif |
|---|
| 56 | |
|---|
| 57 | public : Component * _component; |
|---|
| 58 | private : Interfaces * _interfaces; |
|---|
| 59 | |
|---|
| 60 | #ifdef SYSTEMC |
|---|
| 61 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 62 | // Interface |
|---|
| 63 | public : SC_CLOCK * in_CLOCK ; |
|---|
| 64 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
|---|
| 65 | |
|---|
| 66 | // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 67 | public : SC_IN (Tcontrol_t) * in_INSERT_VAL; |
|---|
| 68 | public : SC_OUT(Tcontrol_t) * out_INSERT_ACK; |
|---|
| 69 | public : SC_IN (Tdata_t ) * in_INSERT_DATA; |
|---|
| 70 | |
|---|
| 71 | // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 72 | public : SC_OUT(Tcontrol_t) * out_RETIRE_VAL; |
|---|
| 73 | public : SC_IN (Tcontrol_t) * in_RETIRE_ACK; |
|---|
| 74 | public : SC_OUT(Tdata_t ) * out_RETIRE_DATA; |
|---|
| 75 | |
|---|
| 76 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 77 | protected : morpheo::behavioural::generic::queue_control::Queue_Control * _queue_control; |
|---|
| 78 | |
|---|
| 79 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 80 | protected : Tdata_t * _queue_data; |
|---|
| 81 | |
|---|
| 82 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 83 | protected : Tcontrol_t internal_INSERT_ACK; |
|---|
| 84 | protected : Tcontrol_t internal_RETIRE_VAL; |
|---|
| 85 | |
|---|
| 86 | #endif |
|---|
| 87 | |
|---|
| 88 | // -----[ methods ]--------------------------------------------------- |
|---|
| 89 | |
|---|
| 90 | #ifdef SYSTEMC |
|---|
| 91 | SC_HAS_PROCESS (Queue); |
|---|
| 92 | #endif |
|---|
| 93 | public : Queue |
|---|
| 94 | ( |
|---|
| 95 | #ifdef SYSTEMC |
|---|
| 96 | sc_module_name name, |
|---|
| 97 | #else |
|---|
| 98 | std::string name, |
|---|
| 99 | #endif |
|---|
| 100 | #ifdef STATISTICS |
|---|
| 101 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
|---|
| 102 | #endif |
|---|
| 103 | Parameters * param, |
|---|
| 104 | morpheo::behavioural::Tusage_t usage=USE_ALL |
|---|
| 105 | ); |
|---|
| 106 | public : ~Queue (void); |
|---|
| 107 | |
|---|
| 108 | private : void allocation (void); |
|---|
| 109 | private : void deallocation (void); |
|---|
| 110 | |
|---|
| 111 | #ifdef SYSTEMC |
|---|
| 112 | public : void transition (void); |
|---|
| 113 | public : void genMoore (void); |
|---|
| 114 | #endif |
|---|
| 115 | |
|---|
| 116 | #ifdef STATISTICS |
|---|
| 117 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
|---|
| 118 | #endif |
|---|
| 119 | |
|---|
| 120 | #if VHDL |
|---|
| 121 | public : void vhdl (void); |
|---|
| 122 | private : void vhdl_declaration (Vhdl * & vhdl); |
|---|
| 123 | private : void vhdl_body (Vhdl * & vhdl); |
|---|
| 124 | #endif |
|---|
| 125 | |
|---|
| 126 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
|---|
| 127 | private : void end_cycle (void); |
|---|
| 128 | #endif |
|---|
| 129 | }; |
|---|
| 130 | |
|---|
| 131 | }; // end namespace queue |
|---|
| 132 | }; // end namespace generic |
|---|
| 133 | |
|---|
| 134 | }; // end namespace behavioural |
|---|
| 135 | }; // end namespace morpheo |
|---|
| 136 | |
|---|
| 137 | #endif |
|---|