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