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