[2] | 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> |
---|
[44] | 16 | #include "Common/include/ToString.h" |
---|
| 17 | #include "Common/include/Debug.h" |
---|
[2] | 18 | |
---|
| 19 | #include "Behavioural/Generic/Counter/include/Parameters.h" |
---|
| 20 | #include "Behavioural/Generic/Counter/include/Types.h" |
---|
| 21 | #ifdef STATISTICS |
---|
[71] | 22 | #include "Behavioural/include/Stat.h" |
---|
[2] | 23 | #endif |
---|
| 24 | #ifdef VHDL |
---|
| 25 | #include "Behavioural/include/Vhdl.h" |
---|
| 26 | #endif |
---|
[42] | 27 | #include "Behavioural/include/Component.h" |
---|
[82] | 28 | #include "Behavioural/include/Usage.h" |
---|
[2] | 29 | |
---|
[42] | 30 | namespace morpheo { |
---|
[2] | 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 |
---|
[113] | 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 | // Interface |
---|
| 56 | public : SC_CLOCK * in_CLOCK ; |
---|
[42] | 57 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
[2] | 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 |
---|
[75] | 76 | public : Counter (std::string name, |
---|
[2] | 77 | #endif |
---|
| 78 | #ifdef STATISTICS |
---|
[71] | 79 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
[2] | 80 | #endif |
---|
[113] | 81 | Parameters * param, |
---|
| 82 | Tusage_t usage); |
---|
[2] | 83 | |
---|
[113] | 84 | // public : Counter (Parameters param ); |
---|
[2] | 85 | public : ~Counter (void); |
---|
| 86 | |
---|
| 87 | private : void allocation (void); |
---|
| 88 | private : void deallocation (void); |
---|
| 89 | |
---|
[88] | 90 | #ifdef SYSTEMC |
---|
[2] | 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 |
---|
[71] | 97 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
[2] | 98 | #endif |
---|
| 99 | |
---|
| 100 | #if VHDL |
---|
| 101 | public : void vhdl (void); |
---|
[42] | 102 | private : void vhdl_port (Vhdl * & vhdl); |
---|
| 103 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 104 | private : void vhdl_body (Vhdl * & vhdl); |
---|
[2] | 105 | #endif |
---|
| 106 | |
---|
[71] | 107 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 108 | private : void end_cycle (void); |
---|
[2] | 109 | #endif |
---|
| 110 | }; |
---|
| 111 | |
---|
| 112 | }; // end namespace counter |
---|
| 113 | }; // end namespace generic |
---|
| 114 | }; // end namespace behavioural |
---|
| 115 | }; // end namespace morpheo |
---|
| 116 | |
---|
| 117 | #endif |
---|