[78] | 1 | /* |
---|
| 2 | * $Id: Ifetch_queue.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Ifetch_queue.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace core { |
---|
| 13 | namespace multi_front_end { |
---|
| 14 | namespace front_end { |
---|
| 15 | namespace ifetch_unit { |
---|
| 16 | namespace ifetch_queue { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Ifetch_queue::Ifetch_queue" |
---|
| 21 | Ifetch_queue::Ifetch_queue |
---|
| 22 | ( |
---|
| 23 | #ifdef SYSTEMC |
---|
| 24 | sc_module_name name, |
---|
| 25 | #else |
---|
| 26 | string name, |
---|
| 27 | #endif |
---|
| 28 | #ifdef STATISTICS |
---|
| 29 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 30 | #endif |
---|
| 31 | morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Parameters * param, |
---|
| 32 | morpheo::behavioural::Tusage_t usage |
---|
| 33 | ): |
---|
| 34 | _name (name) |
---|
| 35 | ,_param (param) |
---|
| 36 | ,_usage (usage) |
---|
| 37 | { |
---|
| 38 | log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin"); |
---|
| 39 | |
---|
| 40 | log_printf(INFO,Ifetch_queue,FUNCTION,"Allocation"); |
---|
| 41 | |
---|
| 42 | allocation ( |
---|
| 43 | #ifdef STATISTICS |
---|
| 44 | param_statistics |
---|
| 45 | #endif |
---|
| 46 | ); |
---|
| 47 | |
---|
| 48 | #ifdef STATISTICS |
---|
| 49 | if (_usage & USE_STATISTICS) |
---|
| 50 | { |
---|
| 51 | log_printf(INFO,Ifetch_queue,FUNCTION,"Allocation of statistics"); |
---|
| 52 | |
---|
| 53 | statistics_allocation(param_statistics); |
---|
| 54 | } |
---|
| 55 | #endif |
---|
| 56 | |
---|
| 57 | #ifdef VHDL |
---|
| 58 | if (_usage & USE_VHDL) |
---|
| 59 | { |
---|
| 60 | // generate the vhdl |
---|
| 61 | log_printf(INFO,Ifetch_queue,FUNCTION,"Generate the vhdl"); |
---|
| 62 | |
---|
| 63 | vhdl(); |
---|
| 64 | } |
---|
| 65 | #endif |
---|
| 66 | |
---|
| 67 | #ifdef SYSTEMC |
---|
| 68 | if (_usage & USE_SYSTEMC) |
---|
| 69 | { |
---|
| 70 | // constant output |
---|
| 71 | internal_ICACHE_RSP_ACK = 1; |
---|
| 72 | internal_EVENT_RESET_ACK = 1; |
---|
| 73 | |
---|
| 74 | PORT_WRITE(out_ICACHE_RSP_ACK , internal_ICACHE_RSP_ACK ); |
---|
| 75 | PORT_WRITE(out_EVENT_RESET_ACK, internal_EVENT_RESET_ACK); |
---|
| 76 | |
---|
| 77 | log_printf(INFO,Ifetch_queue,FUNCTION,"Method - transition"); |
---|
| 78 | |
---|
| 79 | SC_METHOD (transition); |
---|
| 80 | dont_initialize (); |
---|
| 81 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 82 | |
---|
| 83 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 84 | // List dependency information |
---|
| 85 | # endif |
---|
| 86 | |
---|
| 87 | log_printf(INFO,Ifetch_queue,FUNCTION,"Method - genMoore"); |
---|
| 88 | |
---|
| 89 | SC_METHOD (genMoore); |
---|
| 90 | dont_initialize (); |
---|
| 91 | sensitive << (*(in_CLOCK)).neg(); // use internal register |
---|
| 92 | |
---|
| 93 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 94 | // List dependency information |
---|
| 95 | # endif |
---|
| 96 | |
---|
| 97 | #endif |
---|
| 98 | } |
---|
| 99 | log_printf(FUNC,Ifetch_queue,FUNCTION,"End"); |
---|
| 100 | }; |
---|
| 101 | |
---|
| 102 | #undef FUNCTION |
---|
| 103 | #define FUNCTION "Ifetch_queue::~Ifetch_queue" |
---|
| 104 | Ifetch_queue::~Ifetch_queue (void) |
---|
| 105 | { |
---|
| 106 | log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin"); |
---|
| 107 | |
---|
| 108 | #ifdef STATISTICS |
---|
| 109 | if (_usage & USE_STATISTICS) |
---|
| 110 | { |
---|
| 111 | statistics_deallocation(); |
---|
| 112 | } |
---|
| 113 | #endif |
---|
| 114 | |
---|
| 115 | log_printf(INFO,Ifetch_queue,FUNCTION,"Deallocation"); |
---|
| 116 | deallocation (); |
---|
| 117 | |
---|
| 118 | log_printf(FUNC,Ifetch_queue,FUNCTION,"End"); |
---|
| 119 | }; |
---|
| 120 | |
---|
| 121 | }; // end namespace ifetch_queue |
---|
| 122 | }; // end namespace ifetch_unit |
---|
| 123 | }; // end namespace front_end |
---|
| 124 | }; // end namespace multi_front_end |
---|
| 125 | }; // end namespace core |
---|
| 126 | |
---|
| 127 | }; // end namespace behavioural |
---|
| 128 | }; // end namespace morpheo |
---|