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