[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 | |
---|
[40] | 31 | #ifdef SYSTEMC |
---|
| 32 | log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation"); |
---|
| 33 | |
---|
| 34 | allocation (); |
---|
| 35 | #endif |
---|
| 36 | |
---|
[2] | 37 | #ifdef STATISTICS |
---|
[15] | 38 | log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation of statistics"); |
---|
| 39 | |
---|
[2] | 40 | // Allocation of statistics |
---|
| 41 | _stat = new Statistics (static_cast<string>(_name), |
---|
| 42 | param_statistics , |
---|
| 43 | param); |
---|
| 44 | #endif |
---|
| 45 | |
---|
| 46 | #ifdef VHDL_TESTBENCH |
---|
[15] | 47 | log_printf(INFO,@COMPONENT,"@COMPONENT","Creation of a testbench"); |
---|
| 48 | |
---|
[2] | 49 | _vhdl_testbench = new Vhdl_Testbench (_name); |
---|
| 50 | #endif |
---|
| 51 | |
---|
| 52 | #ifdef VHDL |
---|
| 53 | // generate the vhdl |
---|
[15] | 54 | log_printf(INFO,@COMPONENT,"@COMPONENT","Generate the vhdl"); |
---|
| 55 | |
---|
[2] | 56 | vhdl(); |
---|
| 57 | #endif |
---|
| 58 | |
---|
| 59 | #ifdef SYSTEMC |
---|
[15] | 60 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 61 | log_printf(INFO,@COMPONENT,"@COMPONENT","Method - transition"); |
---|
| 62 | |
---|
[2] | 63 | SC_METHOD (transition); |
---|
| 64 | dont_initialize (); |
---|
| 65 | sensitive_pos << *(in_CLOCK); |
---|
[15] | 66 | //#endif |
---|
[2] | 67 | |
---|
| 68 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 69 | // List dependency information |
---|
| 70 | #endif |
---|
| 71 | |
---|
| 72 | #endif |
---|
| 73 | log_printf(FUNC,@COMPONENT,"@COMPONENT","End"); |
---|
| 74 | }; |
---|
| 75 | |
---|
| 76 | @COMPONENT::~@COMPONENT (void) |
---|
| 77 | { |
---|
| 78 | log_printf(FUNC,@COMPONENT,"~@COMPONENT","Begin"); |
---|
| 79 | |
---|
| 80 | #ifdef VHDL_TESTBENCH |
---|
[15] | 81 | log_printf(INFO,@COMPONENT,"~@COMPONENT","Generate Testbench file"); |
---|
| 82 | |
---|
[2] | 83 | // generate the test bench |
---|
| 84 | _vhdl_testbench->generate_file(); |
---|
| 85 | delete _vhdl_testbench; |
---|
| 86 | #endif |
---|
| 87 | |
---|
| 88 | #ifdef STATISTICS |
---|
[15] | 89 | log_printf(INFO,@COMPONENT,"~@COMPONENT","Generate Statistics file"); |
---|
| 90 | |
---|
[2] | 91 | _stat->generate_file(statistics(0)); |
---|
| 92 | |
---|
| 93 | delete _stat; |
---|
| 94 | #endif |
---|
| 95 | |
---|
| 96 | #ifdef SYSTEMC |
---|
[15] | 97 | log_printf(INFO,@COMPONENT,"~@COMPONENT","Deallocation"); |
---|
| 98 | |
---|
[2] | 99 | deallocation (); |
---|
| 100 | #endif |
---|
| 101 | |
---|
| 102 | log_printf(FUNC,@COMPONENT,"~@COMPONENT","End"); |
---|
| 103 | }; |
---|
| 104 | |
---|
| 105 | @NAMESPACE_END |
---|
| 106 | }; // end namespace behavioural |
---|
| 107 | }; // end namespace morpheo |
---|