[10] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[15] | 8 | #include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h" |
---|
[10] | 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace generic { |
---|
| 13 | namespace select { |
---|
[15] | 14 | namespace select_priority_fixed { |
---|
[10] | 15 | |
---|
| 16 | |
---|
| 17 | #ifdef SYSTEMC |
---|
[15] | 18 | Select_Priority_Fixed::Select_Priority_Fixed (sc_module_name name, |
---|
[10] | 19 | #else |
---|
[15] | 20 | Select_Priority_Fixed::Select_Priority_Fixed (string name, |
---|
[10] | 21 | #endif |
---|
| 22 | #ifdef STATISTICS |
---|
| 23 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
| 24 | #endif |
---|
[15] | 25 | morpheo::behavioural::generic::select::select_priority_fixed::Parameters param ): |
---|
[10] | 26 | _name (name) |
---|
| 27 | ,_param (param) |
---|
| 28 | // #ifdef STATISTICS |
---|
| 29 | // ,_param_statistics (param_statistics) |
---|
| 30 | // #endif |
---|
| 31 | { |
---|
[15] | 32 | log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin"); |
---|
[10] | 33 | |
---|
[29] | 34 | #ifdef SYSTEMC |
---|
| 35 | log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation"); |
---|
| 36 | |
---|
| 37 | allocation (); |
---|
| 38 | #endif |
---|
| 39 | |
---|
[10] | 40 | #ifdef STATISTICS |
---|
[15] | 41 | log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics"); |
---|
[10] | 42 | |
---|
| 43 | // Allocation of statistics |
---|
| 44 | _stat = new Statistics (static_cast<string>(_name), |
---|
| 45 | param_statistics , |
---|
| 46 | param); |
---|
| 47 | #endif |
---|
| 48 | |
---|
| 49 | #ifdef VHDL |
---|
| 50 | // generate the vhdl |
---|
[15] | 51 | log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Generate the vhdl"); |
---|
[10] | 52 | |
---|
| 53 | vhdl(); |
---|
| 54 | #endif |
---|
| 55 | |
---|
| 56 | #ifdef SYSTEMC |
---|
| 57 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
[15] | 58 | log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition"); |
---|
[10] | 59 | |
---|
| 60 | SC_METHOD (transition); |
---|
| 61 | dont_initialize (); |
---|
| 62 | sensitive_pos << *(in_CLOCK); |
---|
| 63 | #endif |
---|
| 64 | |
---|
[15] | 65 | log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity"); |
---|
[10] | 66 | |
---|
| 67 | SC_METHOD (genMealy_entity); |
---|
| 68 | dont_initialize (); |
---|
| 69 | //sensitive_pos << *(in_CLOCK); |
---|
| 70 | for (uint32_t i=0; i<_param._nb_entity; i++) |
---|
| 71 | sensitive << *(in_VAL [i]); |
---|
| 72 | |
---|
| 73 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 74 | // List dependency information |
---|
| 75 | |
---|
| 76 | for (uint32_t i=0; i<_param._nb_entity; i++) |
---|
| 77 | { |
---|
| 78 | if (_param._encoding_one_hot) |
---|
| 79 | (*(out_ACK [i])) (*(in_VAL [i])); |
---|
| 80 | if (_param._encoding_compact) |
---|
| 81 | { |
---|
| 82 | (*(out_ENTITY )) (*(in_VAL [i])); |
---|
| 83 | (*(out_ENTITY_ACK)) (*(in_VAL [i])); |
---|
| 84 | } |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | #endif |
---|
| 88 | #endif |
---|
[15] | 89 | log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End"); |
---|
[10] | 90 | }; |
---|
| 91 | |
---|
[15] | 92 | Select_Priority_Fixed::~Select_Priority_Fixed (void) |
---|
[10] | 93 | { |
---|
[15] | 94 | log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin"); |
---|
[10] | 95 | |
---|
| 96 | #ifdef STATISTICS |
---|
[15] | 97 | log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file"); |
---|
[10] | 98 | |
---|
| 99 | _stat->generate_file(statistics(0)); |
---|
| 100 | |
---|
| 101 | delete _stat; |
---|
| 102 | #endif |
---|
| 103 | |
---|
| 104 | #ifdef SYSTEMC |
---|
[15] | 105 | log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Deallocation"); |
---|
[10] | 106 | |
---|
| 107 | deallocation (); |
---|
| 108 | #endif |
---|
| 109 | |
---|
[15] | 110 | log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","End"); |
---|
[10] | 111 | }; |
---|
| 112 | |
---|
[15] | 113 | }; // end namespace select_priority_fixed |
---|
[10] | 114 | }; // end namespace select |
---|
| 115 | }; // end namespace generic |
---|
| 116 | }; // end namespace behavioural |
---|
| 117 | }; // end namespace morpheo |
---|