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