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