[2] | 1 | #ifndef morpheo_behavioural_generic_shifter_Shifter_h |
---|
| 2 | #define morpheo_behavioural_generic_shifter_Shifter_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | #include <iostream> |
---|
[44] | 16 | #include "Common/include/ToString.h" |
---|
[2] | 17 | |
---|
| 18 | #include "Behavioural/Generic/Shifter/include/Parameters.h" |
---|
| 19 | #include "Behavioural/Generic/Shifter/include/Types.h" |
---|
| 20 | #ifdef STATISTICS |
---|
[75] | 21 | #include "Behavioural/include/Stat.h" |
---|
[2] | 22 | #endif |
---|
| 23 | #ifdef VHDL |
---|
| 24 | #include "Behavioural/include/Vhdl.h" |
---|
| 25 | #endif |
---|
[42] | 26 | #include "Behavioural/include/Component.h" |
---|
[2] | 27 | |
---|
| 28 | namespace morpheo { |
---|
| 29 | namespace behavioural { |
---|
| 30 | namespace generic { |
---|
| 31 | namespace shifter { |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | class Shifter |
---|
| 35 | #if SYSTEMC |
---|
| 36 | : public sc_module |
---|
| 37 | #endif |
---|
| 38 | { |
---|
| 39 | // -----[ fields ]---------------------------------------------------- |
---|
| 40 | // Parameters |
---|
[75] | 41 | protected : const std::string _name; |
---|
[2] | 42 | |
---|
| 43 | protected : const Parameters _param; |
---|
| 44 | #ifdef STATISTICS |
---|
[75] | 45 | public : Stat * _stat; |
---|
[2] | 46 | #endif |
---|
| 47 | |
---|
[42] | 48 | public : Component * _component; |
---|
| 49 | private : Interfaces * _interfaces; |
---|
[2] | 50 | |
---|
| 51 | #ifdef SYSTEMC |
---|
| 52 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 53 | public : SC_CLOCK * in_CLOCK ; |
---|
[42] | 54 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 55 | |
---|
[2] | 56 | // Interface "shifter" |
---|
| 57 | public : SC_IN (Tdata_t) ** in_SHIFTER_DATA ; |
---|
| 58 | public : SC_IN (Tshift_t) ** in_SHIFTER_SHIFT ; |
---|
| 59 | public : SC_IN (Tdirection_t) ** in_SHIFTER_DIRECTION ; |
---|
| 60 | public : SC_IN (Ttype_t) ** in_SHIFTER_TYPE ; |
---|
| 61 | public : SC_IN (Tcarry_t) ** in_SHIFTER_CARRY ; |
---|
| 62 | public : SC_IN (Tcontrol_t) ** in_SHIFTER_CARRY_IN ; // Completion == type bool |
---|
| 63 | public : SC_IN (Tdata_t) ** in_SHIFTER_COMPLETION; // Completion != type bool |
---|
| 64 | public : SC_OUT(Tdata_t) ** out_SHIFTER_DATA ; |
---|
| 65 | |
---|
| 66 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 67 | |
---|
| 68 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 69 | #endif |
---|
| 70 | |
---|
| 71 | // -----[ methods ]--------------------------------------------------- |
---|
| 72 | |
---|
| 73 | #ifdef SYSTEMC |
---|
| 74 | SC_HAS_PROCESS (Shifter); |
---|
| 75 | #endif |
---|
| 76 | |
---|
| 77 | public : Shifter ( |
---|
| 78 | #ifdef SYSTEMC |
---|
[75] | 79 | sc_module_name name, |
---|
[2] | 80 | #else |
---|
[75] | 81 | std::string name, |
---|
[2] | 82 | #endif |
---|
| 83 | #ifdef STATISTICS |
---|
[75] | 84 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
[2] | 85 | #endif |
---|
[75] | 86 | Parameters param ); |
---|
[2] | 87 | |
---|
| 88 | public : Shifter (Parameters param ); |
---|
| 89 | public : ~Shifter (void); |
---|
| 90 | |
---|
| 91 | #ifdef SYSTEMC |
---|
| 92 | private : void allocation (void); |
---|
| 93 | private : void deallocation (void); |
---|
| 94 | |
---|
| 95 | #if (defined(STATISTICS) || defined (VHDL_TESTBENCH)) |
---|
| 96 | public : void transition (void); |
---|
| 97 | #endif |
---|
| 98 | public : void genMealy_shift (void); |
---|
| 99 | #endif |
---|
| 100 | |
---|
| 101 | #if VHDL |
---|
| 102 | public : void vhdl (void); |
---|
[42] | 103 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 104 | private : void vhdl_body (Vhdl * & vhdl); |
---|
[2] | 105 | #endif |
---|
[75] | 106 | |
---|
[2] | 107 | #ifdef STATISTICS |
---|
[75] | 108 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
[2] | 109 | #endif |
---|
[75] | 110 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 111 | private : void end_cycle (void); |
---|
[2] | 112 | #endif |
---|
| 113 | }; |
---|
| 114 | |
---|
| 115 | }; // end namespace shifter |
---|
| 116 | }; // end namespace generic |
---|
| 117 | |
---|
| 118 | }; // end namespace behavioural |
---|
| 119 | }; // end namespace morpheo |
---|
| 120 | |
---|
| 121 | #endif |
---|