[2] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/@DIRECTORY/include/@COMPONENT.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | @NAMESPACE_BEGIN |
---|
| 13 | |
---|
| 14 | #ifdef SYSTEMC |
---|
| 15 | @COMPONENT::@COMPONENT (sc_module_name name, |
---|
| 16 | #else |
---|
| 17 | @COMPONENT::@COMPONENT (string name, |
---|
| 18 | #endif |
---|
| 19 | #ifdef STATISTICS |
---|
| 20 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
| 21 | #endif |
---|
| 22 | morpheo::behavioural::@NAMESPACE_USE::Parameters param ): |
---|
| 23 | _name (name) |
---|
| 24 | ,_param (param) |
---|
| 25 | // #ifdef STATISTICS |
---|
| 26 | // ,_param_statistics (param_statistics) |
---|
| 27 | // #endif |
---|
| 28 | { |
---|
| 29 | log_printf(FUNC,@COMPONENT,"@COMPONENT","Begin"); |
---|
| 30 | |
---|
| 31 | #ifdef STATISTICS |
---|
[15] | 32 | log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation of statistics"); |
---|
| 33 | |
---|
[2] | 34 | // Allocation of statistics |
---|
| 35 | _stat = new Statistics (static_cast<string>(_name), |
---|
| 36 | param_statistics , |
---|
| 37 | param); |
---|
| 38 | #endif |
---|
| 39 | |
---|
| 40 | #ifdef VHDL_TESTBENCH |
---|
[15] | 41 | log_printf(INFO,@COMPONENT,"@COMPONENT","Creation of a testbench"); |
---|
| 42 | |
---|
[2] | 43 | // Creation of a testbench |
---|
| 44 | // -> port |
---|
| 45 | // -> clock's signals |
---|
| 46 | _vhdl_testbench = new Vhdl_Testbench (_name); |
---|
| 47 | #endif |
---|
| 48 | |
---|
| 49 | #ifdef VHDL |
---|
| 50 | // generate the vhdl |
---|
[15] | 51 | log_printf(INFO,@COMPONENT,"@COMPONENT","Generate the vhdl"); |
---|
| 52 | |
---|
[2] | 53 | vhdl(); |
---|
| 54 | #endif |
---|
| 55 | |
---|
[15] | 56 | #ifdef VHDL_TESTBENCH |
---|
| 57 | // must be invoke after affect of port |
---|
| 58 | _vhdl_testbench->set_clock ("in_CLOCK",true); |
---|
| 59 | #endif |
---|
| 60 | |
---|
[2] | 61 | #ifdef SYSTEMC |
---|
[15] | 62 | log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation"); |
---|
| 63 | |
---|
[2] | 64 | allocation (); |
---|
| 65 | |
---|
[15] | 66 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 67 | log_printf(INFO,@COMPONENT,"@COMPONENT","Method - transition"); |
---|
| 68 | |
---|
[2] | 69 | SC_METHOD (transition); |
---|
| 70 | dont_initialize (); |
---|
| 71 | sensitive_pos << *(in_CLOCK); |
---|
[15] | 72 | //#endif |
---|
[2] | 73 | |
---|
| 74 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 75 | // List dependency information |
---|
| 76 | #endif |
---|
| 77 | |
---|
| 78 | #endif |
---|
| 79 | log_printf(FUNC,@COMPONENT,"@COMPONENT","End"); |
---|
| 80 | }; |
---|
| 81 | |
---|
| 82 | @COMPONENT::~@COMPONENT (void) |
---|
| 83 | { |
---|
| 84 | log_printf(FUNC,@COMPONENT,"~@COMPONENT","Begin"); |
---|
| 85 | |
---|
| 86 | #ifdef VHDL_TESTBENCH |
---|
[15] | 87 | log_printf(INFO,@COMPONENT,"~@COMPONENT","Generate Testbench file"); |
---|
| 88 | |
---|
[2] | 89 | // generate the test bench |
---|
| 90 | _vhdl_testbench->generate_file(); |
---|
| 91 | delete _vhdl_testbench; |
---|
| 92 | #endif |
---|
| 93 | |
---|
| 94 | #ifdef STATISTICS |
---|
[15] | 95 | log_printf(INFO,@COMPONENT,"~@COMPONENT","Generate Statistics file"); |
---|
| 96 | |
---|
[2] | 97 | _stat->generate_file(statistics(0)); |
---|
| 98 | |
---|
| 99 | delete _stat; |
---|
| 100 | #endif |
---|
| 101 | |
---|
| 102 | #ifdef SYSTEMC |
---|
[15] | 103 | log_printf(INFO,@COMPONENT,"~@COMPONENT","Deallocation"); |
---|
| 104 | |
---|
[2] | 105 | deallocation (); |
---|
| 106 | #endif |
---|
| 107 | |
---|
| 108 | log_printf(FUNC,@COMPONENT,"~@COMPONENT","End"); |
---|
| 109 | }; |
---|
| 110 | |
---|
| 111 | @NAMESPACE_END |
---|
| 112 | }; // end namespace behavioural |
---|
| 113 | }; // end namespace morpheo |
---|