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