[78] | 1 | /* |
---|
| 2 | * $Id: Execute_loop.cpp 136 2009-10-20 18:52:15Z 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 |
---|
[88] | 72 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
[78] | 73 | { |
---|
[136] | 74 | log_printf(INFO,Execute_loop,FUNCTION,_("<%s> Method - transition"),_name.c_str()); |
---|
[78] | 75 | |
---|
| 76 | SC_METHOD (transition); |
---|
| 77 | dont_initialize (); |
---|
| 78 | sensitive << (*(in_CLOCK)).pos(); |
---|
| 79 | |
---|
| 80 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 81 | // List dependency information |
---|
| 82 | # endif |
---|
| 83 | |
---|
| 84 | #endif |
---|
| 85 | } |
---|
[136] | 86 | log_printf(FUNC,Execute_loop,FUNCTION,_("<%s> End"),_name.c_str()); |
---|
[78] | 87 | }; |
---|
| 88 | |
---|
| 89 | #undef FUNCTION |
---|
| 90 | #define FUNCTION "Execute_loop::~Execute_loop" |
---|
| 91 | Execute_loop::~Execute_loop (void) |
---|
| 92 | { |
---|
[136] | 93 | log_printf(FUNC,Execute_loop,FUNCTION,_("<%s> Begin"),_name.c_str()); |
---|
[78] | 94 | |
---|
| 95 | #ifdef STATISTICS |
---|
[88] | 96 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
[78] | 97 | { |
---|
[136] | 98 | log_printf(INFO,Execute_loop,FUNCTION,_("<%s> Generate Statistics file"),_name.c_str()); |
---|
[78] | 99 | |
---|
| 100 | delete _stat; |
---|
| 101 | } |
---|
| 102 | #endif |
---|
| 103 | |
---|
[136] | 104 | log_printf(INFO,Execute_loop,FUNCTION,_("<%s> Deallocation"),_name.c_str()); |
---|
[78] | 105 | deallocation (); |
---|
| 106 | |
---|
[136] | 107 | log_printf(FUNC,Execute_loop,FUNCTION,_("<%s> End"),_name.c_str()); |
---|
[78] | 108 | }; |
---|
| 109 | |
---|
| 110 | }; // end namespace execute_loop |
---|
| 111 | }; // end namespace multi_execute_loop |
---|
| 112 | }; // end namespace core |
---|
| 113 | |
---|
| 114 | }; // end namespace behavioural |
---|
| 115 | }; // end namespace morpheo |
---|