| 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> | 
|---|
| 16 | #include "Include/ToString.h" | 
|---|
| 17 |  | 
|---|
| 18 | #include "Behavioural/Generic/Shifter/include/Parameters.h" | 
|---|
| 19 | #include "Behavioural/Generic/Shifter/include/Types.h" | 
|---|
| 20 | #ifdef STATISTICS | 
|---|
| 21 | #include "Behavioural/Generic/Shifter/include/Statistics.h" | 
|---|
| 22 | #endif | 
|---|
| 23 | #ifdef VHDL | 
|---|
| 24 | #include "Behavioural/include/Vhdl.h" | 
|---|
| 25 | #endif | 
|---|
| 26 | #include "Behavioural/include/Component.h" | 
|---|
| 27 |  | 
|---|
| 28 | using namespace std; | 
|---|
| 29 |  | 
|---|
| 30 | namespace morpheo                    { | 
|---|
| 31 | namespace behavioural { | 
|---|
| 32 | namespace generic { | 
|---|
| 33 | namespace shifter { | 
|---|
| 34 |  | 
|---|
| 35 |  | 
|---|
| 36 | class Shifter | 
|---|
| 37 | #if SYSTEMC | 
|---|
| 38 | : public sc_module | 
|---|
| 39 | #endif | 
|---|
| 40 | { | 
|---|
| 41 | // -----[ fields ]---------------------------------------------------- | 
|---|
| 42 | // Parameters | 
|---|
| 43 | protected : const string     _name; | 
|---|
| 44 |  | 
|---|
| 45 | protected : const Parameters _param; | 
|---|
| 46 | #ifdef STATISTICS | 
|---|
| 47 | private   : Statistics                     * _stat; | 
|---|
| 48 | #endif | 
|---|
| 49 |  | 
|---|
| 50 | public    : Component                      * _component; | 
|---|
| 51 | private   : Interfaces                     * _interfaces; | 
|---|
| 52 |  | 
|---|
| 53 | #ifdef SYSTEMC | 
|---|
| 54 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 
|---|
| 55 | public    : SC_CLOCK                      *  in_CLOCK             ; | 
|---|
| 56 | public    : SC_IN (Tcontrol_t)            *  in_NRESET            ; | 
|---|
| 57 |  | 
|---|
| 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 | 
|---|
| 81 | sc_module_name                              name, | 
|---|
| 82 | #else | 
|---|
| 83 | string                                      name, | 
|---|
| 84 | #endif | 
|---|
| 85 | #ifdef STATISTICS | 
|---|
| 86 | morpheo::behavioural::Parameters_Statistics param_statistics, | 
|---|
| 87 | #endif | 
|---|
| 88 | Parameters                                  param ); | 
|---|
| 89 |  | 
|---|
| 90 | public  :          Shifter              (Parameters param ); | 
|---|
| 91 | public  :          ~Shifter             (void); | 
|---|
| 92 |  | 
|---|
| 93 | #ifdef SYSTEMC | 
|---|
| 94 | private : void     allocation                (void); | 
|---|
| 95 | private : void     deallocation              (void); | 
|---|
| 96 |  | 
|---|
| 97 | #if (defined(STATISTICS) || defined (VHDL_TESTBENCH)) | 
|---|
| 98 | public  : void     transition                (void); | 
|---|
| 99 | #endif | 
|---|
| 100 | public  : void     genMealy_shift            (void); | 
|---|
| 101 | #endif | 
|---|
| 102 |  | 
|---|
| 103 | #if VHDL | 
|---|
| 104 | public  : void     vhdl                      (void); | 
|---|
| 105 | private : void     vhdl_port                 (Vhdl * & vhdl); | 
|---|
| 106 | private : void     vhdl_declaration          (Vhdl * & vhdl); | 
|---|
| 107 | private : void     vhdl_body                 (Vhdl * & vhdl); | 
|---|
| 108 | #endif | 
|---|
| 109 | #ifdef STATISTICS | 
|---|
| 110 | public  : string   statistics                (uint32_t depth); | 
|---|
| 111 | #endif | 
|---|
| 112 |  | 
|---|
| 113 | #ifdef VHDL_TESTBENCH | 
|---|
| 114 | private : void     vhdl_testbench_transition (void); | 
|---|
| 115 | #endif | 
|---|
| 116 |  | 
|---|
| 117 | }; | 
|---|
| 118 |  | 
|---|
| 119 | }; // end namespace shifter | 
|---|
| 120 | }; // end namespace generic | 
|---|
| 121 |  | 
|---|
| 122 | }; // end namespace behavioural | 
|---|
| 123 | }; // end namespace morpheo | 
|---|
| 124 |  | 
|---|
| 125 | #endif | 
|---|