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