[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 |
---|
[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" |
---|
[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 | |
---|
| 47 | #ifdef STATISTICS |
---|
[71] | 48 | private : Stat * _stat; |
---|
[2] | 49 | #endif |
---|
| 50 | |
---|
[42] | 51 | public : Component * _component; |
---|
| 52 | private : Interfaces * _interfaces; |
---|
[2] | 53 | |
---|
| 54 | #ifdef SYSTEMC |
---|
| 55 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 56 | // Interface |
---|
| 57 | public : SC_CLOCK * in_CLOCK ; |
---|
[42] | 58 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
[2] | 59 | public : SC_IN (Tdata_t) ** in_COUNTER_DATA ; |
---|
| 60 | public : SC_IN (Tcontrol_t) ** in_COUNTER_ADDSUB ; |
---|
| 61 | public : SC_OUT(Tdata_t) ** out_COUNTER_DATA ; |
---|
| 62 | |
---|
| 63 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 64 | |
---|
| 65 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 66 | |
---|
| 67 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 68 | #endif |
---|
| 69 | |
---|
| 70 | // -----[ methods ]--------------------------------------------------- |
---|
| 71 | |
---|
| 72 | #ifdef SYSTEMC |
---|
| 73 | SC_HAS_PROCESS (Counter); |
---|
| 74 | |
---|
| 75 | public : Counter (sc_module_name name, |
---|
| 76 | #else |
---|
| 77 | public : Counter (string name, |
---|
| 78 | #endif |
---|
| 79 | #ifdef STATISTICS |
---|
[71] | 80 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
[2] | 81 | #endif |
---|
| 82 | Parameters param ); |
---|
| 83 | |
---|
| 84 | public : Counter (Parameters param ); |
---|
| 85 | public : ~Counter (void); |
---|
| 86 | |
---|
| 87 | #ifdef SYSTEMC |
---|
| 88 | private : void allocation (void); |
---|
| 89 | private : void deallocation (void); |
---|
| 90 | |
---|
| 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); |
---|
| 98 | public : string statistics_print (uint32_t depth); |
---|
[2] | 99 | #endif |
---|
| 100 | |
---|
| 101 | #if VHDL |
---|
| 102 | public : void vhdl (void); |
---|
[42] | 103 | private : void vhdl_port (Vhdl * & vhdl); |
---|
| 104 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 105 | private : void vhdl_body (Vhdl * & vhdl); |
---|
[2] | 106 | #endif |
---|
| 107 | |
---|
[71] | 108 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 109 | private : void end_cycle (void); |
---|
[2] | 110 | #endif |
---|
| 111 | }; |
---|
| 112 | |
---|
| 113 | }; // end namespace counter |
---|
| 114 | }; // end namespace generic |
---|
| 115 | }; // end namespace behavioural |
---|
| 116 | }; // end namespace morpheo |
---|
| 117 | |
---|
| 118 | #endif |
---|