[112] | 1 | #ifndef morpheo_behavioural_generic_comparator_Comparator_h |
---|
| 2 | #define morpheo_behavioural_generic_comparator_Comparator_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Comparator.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 | |
---|
| 16 | #include "Behavioural/Generic/Comparator/include/Parameters.h" |
---|
| 17 | #include "Behavioural/Generic/Comparator/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 comparator { |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | class Comparator |
---|
| 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 | // ~~~~~[ Interface : "compare" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 64 | public : SC_IN (Tdata_t ) * in_COMPARE_DATA_0; |
---|
| 65 | public : SC_IN (Tdata_t ) * in_COMPARE_DATA_1; |
---|
[113] | 66 | public : SC_OUT(Tcontrol_t) * out_COMPARE_TEST ; |
---|
[112] | 67 | |
---|
| 68 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 69 | |
---|
| 70 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 71 | |
---|
| 72 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 73 | #endif |
---|
| 74 | |
---|
| 75 | // -----[ Methods ]--------------------------------------------------- |
---|
| 76 | |
---|
| 77 | #ifdef SYSTEMC |
---|
| 78 | SC_HAS_PROCESS (Comparator); |
---|
| 79 | #endif |
---|
| 80 | public : Comparator |
---|
| 81 | ( |
---|
| 82 | #ifdef SYSTEMC |
---|
| 83 | sc_module_name name, |
---|
| 84 | #else |
---|
| 85 | std::string name, |
---|
| 86 | #endif |
---|
| 87 | #ifdef STATISTICS |
---|
| 88 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 89 | #endif |
---|
| 90 | Parameters * param, |
---|
| 91 | morpheo::behavioural::Tusage_t usage |
---|
| 92 | ); |
---|
| 93 | public : ~Comparator (void); |
---|
| 94 | |
---|
| 95 | private : void allocation ( |
---|
| 96 | #ifdef STATISTICS |
---|
| 97 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 98 | #else |
---|
| 99 | void |
---|
| 100 | #endif |
---|
| 101 | ); |
---|
| 102 | private : void deallocation (void); |
---|
| 103 | |
---|
| 104 | #ifdef SYSTEMC |
---|
| 105 | public : void transition (void); |
---|
[113] | 106 | public : void genMealy (void); |
---|
[112] | 107 | #endif |
---|
| 108 | |
---|
| 109 | #if VHDL |
---|
| 110 | public : void vhdl (void); |
---|
| 111 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 112 | private : void vhdl_body (Vhdl * & vhdl); |
---|
[113] | 113 | |
---|
| 114 | private : void vhdl_xilinx_declaration (Vhdl * & vhdl); |
---|
| 115 | private : void vhdl_xilinx_body (Vhdl * & vhdl); |
---|
[112] | 116 | #endif |
---|
| 117 | |
---|
| 118 | #ifdef STATISTICS |
---|
| 119 | public : void statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
| 120 | public : void statistics_deallocation (void); |
---|
| 121 | #endif |
---|
| 122 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 123 | private : void end_cycle (void); |
---|
| 124 | #endif |
---|
| 125 | }; |
---|
| 126 | |
---|
| 127 | }; // end namespace comparator |
---|
| 128 | }; // end namespace generic |
---|
| 129 | |
---|
| 130 | }; // end namespace behavioural |
---|
| 131 | }; // end namespace morpheo |
---|
| 132 | |
---|
| 133 | #endif |
---|