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