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