[2] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[15] | 8 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h" |
---|
[2] | 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace generic { |
---|
| 13 | namespace registerfile { |
---|
[15] | 14 | namespace registerfile_monolithic { |
---|
[2] | 15 | |
---|
[15] | 16 | RegisterFile_Monolithic::RegisterFile_Monolithic ( |
---|
[2] | 17 | #ifdef SYSTEMC |
---|
[15] | 18 | sc_module_name name, |
---|
[2] | 19 | #else |
---|
[15] | 20 | string name , |
---|
[2] | 21 | #endif |
---|
| 22 | #ifdef STATISTICS |
---|
[15] | 23 | morpheo::behavioural::Parameters_Statistics param_statistics, |
---|
[2] | 24 | #endif |
---|
[15] | 25 | morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters param ): |
---|
| 26 | _name (name), |
---|
| 27 | _param (param) |
---|
[2] | 28 | { |
---|
| 29 | #ifdef STATISTICS |
---|
| 30 | _stat = new Statistics (static_cast<string>(_name), |
---|
| 31 | param_statistics , |
---|
| 32 | param); |
---|
| 33 | #endif |
---|
| 34 | |
---|
| 35 | #ifdef VHDL_TESTBENCH |
---|
| 36 | _vhdl_testbench = new Vhdl_Testbench (_name); |
---|
| 37 | vhdl_testbench_port (*_vhdl_testbench); |
---|
| 38 | _vhdl_testbench->set_clock ("in_CLOCK",true); |
---|
| 39 | #endif |
---|
| 40 | |
---|
| 41 | #ifdef VHDL |
---|
| 42 | // generate the vhdl |
---|
| 43 | vhdl(); |
---|
| 44 | #endif |
---|
| 45 | |
---|
| 46 | #ifdef SYSTEMC |
---|
| 47 | allocation (); |
---|
| 48 | |
---|
| 49 | SC_METHOD (transition); |
---|
| 50 | dont_initialize (); |
---|
| 51 | sensitive_pos << *(in_CLOCK); |
---|
| 52 | |
---|
| 53 | SC_METHOD (genMealy_read); |
---|
| 54 | dont_initialize (); |
---|
| 55 | sensitive_neg << *(in_CLOCK); |
---|
| 56 | for (uint32_t i=0; i<_param._nb_port_read; i++) |
---|
[6] | 57 | sensitive << *(in_READ_VAL [i]) |
---|
[2] | 58 | << *(in_READ_ADDRESS [i]); |
---|
| 59 | |
---|
| 60 | #ifdef SYSTEMCASS_SPECIFIC |
---|
| 61 | // List dependency information |
---|
| 62 | for (uint32_t i=0; i<_param._nb_port_read; i++) |
---|
| 63 | { |
---|
[6] | 64 | (*(out_READ_DATA [i])) (*( in_READ_VAL [i])); |
---|
[2] | 65 | (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i])); |
---|
| 66 | } |
---|
| 67 | #endif |
---|
[6] | 68 | |
---|
| 69 | for (uint32_t i=0; i<_param._nb_port_read ; i++) |
---|
| 70 | PORT_WRITE(out_READ_ACK [i], 1); |
---|
| 71 | for (uint32_t i=0; i<_param._nb_port_write; i++) |
---|
| 72 | PORT_WRITE(out_WRITE_ACK [i], 1); |
---|
[2] | 73 | #endif |
---|
| 74 | }; |
---|
| 75 | |
---|
[15] | 76 | RegisterFile_Monolithic::~RegisterFile_Monolithic (void) |
---|
[2] | 77 | { |
---|
| 78 | #ifdef SYSTEMC |
---|
| 79 | deallocation (); |
---|
| 80 | #endif |
---|
| 81 | |
---|
| 82 | #ifdef VHDL_TESTBENCH |
---|
| 83 | // generate the test bench |
---|
| 84 | _vhdl_testbench->generate_file(); |
---|
| 85 | delete _vhdl_testbench; |
---|
| 86 | #endif |
---|
| 87 | |
---|
| 88 | #ifdef STATISTICS |
---|
| 89 | _stat->generate_file(statistics(0)); |
---|
| 90 | delete _stat; |
---|
| 91 | #endif |
---|
| 92 | }; |
---|
| 93 | |
---|
[15] | 94 | }; // end namespace registerfile_monolithic |
---|
[2] | 95 | }; // end namespace registerfile |
---|
| 96 | }; // end namespace generic |
---|
| 97 | }; // end namespace behavioural |
---|
| 98 | }; // end namespace morpheo |
---|