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