[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 | |
---|
[57] | 16 | RegisterFile_Monolithic::RegisterFile_Monolithic |
---|
| 17 | ( |
---|
[2] | 18 | #ifdef SYSTEMC |
---|
[57] | 19 | sc_module_name name, |
---|
[2] | 20 | #else |
---|
[57] | 21 | string name , |
---|
[2] | 22 | #endif |
---|
| 23 | #ifdef STATISTICS |
---|
[57] | 24 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
[2] | 25 | #endif |
---|
[57] | 26 | morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters * param, |
---|
| 27 | morpheo::behavioural::Tusage_t usage |
---|
| 28 | ): |
---|
| 29 | _name (name), |
---|
| 30 | _param (param), |
---|
| 31 | _usage (usage) |
---|
[2] | 32 | { |
---|
[41] | 33 | log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","Begin"); |
---|
| 34 | |
---|
| 35 | log_printf(INFO,RegisterFile_Monolithic,"RegisterFile_Monolithic","Allocation"); |
---|
| 36 | allocation (); |
---|
| 37 | |
---|
[2] | 38 | #ifdef STATISTICS |
---|
| 39 | _stat = new Statistics (static_cast<string>(_name), |
---|
| 40 | param_statistics , |
---|
| 41 | param); |
---|
| 42 | #endif |
---|
| 43 | |
---|
| 44 | #ifdef VHDL |
---|
| 45 | // generate the vhdl |
---|
| 46 | vhdl(); |
---|
| 47 | #endif |
---|
| 48 | |
---|
| 49 | #ifdef SYSTEMC |
---|
[57] | 50 | if (_usage & USE_SYSTEMC) |
---|
[2] | 51 | { |
---|
[57] | 52 | SC_METHOD (transition); |
---|
| 53 | dont_initialize (); |
---|
| 54 | sensitive_pos << *(in_CLOCK); |
---|
| 55 | |
---|
| 56 | SC_METHOD (genMealy_read); |
---|
| 57 | dont_initialize (); |
---|
| 58 | sensitive_neg << *(in_CLOCK); |
---|
| 59 | for (uint32_t i=0; i<_param->_nb_port_read; i++) |
---|
| 60 | sensitive << *(in_READ_VAL [i]) |
---|
| 61 | << *(in_READ_ADDRESS [i]); |
---|
| 62 | for (uint32_t i=0; i<_param->_nb_port_read_write; i++) |
---|
| 63 | sensitive << *(in_READ_WRITE_VAL [i]) |
---|
| 64 | << *(in_READ_WRITE_RW [i]) |
---|
| 65 | << *(in_READ_WRITE_ADDRESS [i]); |
---|
| 66 | |
---|
| 67 | # ifdef SYSTEMCASS_SPECIFIC |
---|
| 68 | // List dependency information |
---|
| 69 | for (uint32_t i=0; i<_param->_nb_port_read; i++) |
---|
| 70 | { |
---|
| 71 | (*(out_READ_DATA [i])) (*( in_READ_VAL [i])); |
---|
| 72 | (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i])); |
---|
| 73 | } |
---|
| 74 | for (uint32_t i=0; i<_param->_nb_port_read_write; i++) |
---|
| 75 | { |
---|
| 76 | (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_VAL [i])); |
---|
| 77 | (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_RW [i])); |
---|
| 78 | (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i])); |
---|
| 79 | } |
---|
| 80 | # endif |
---|
| 81 | |
---|
| 82 | for (uint32_t i=0; i<_param->_nb_port_read ; i++) |
---|
| 83 | PORT_WRITE(out_READ_ACK [i], 1); |
---|
| 84 | for (uint32_t i=0; i<_param->_nb_port_write ; i++) |
---|
| 85 | PORT_WRITE(out_WRITE_ACK [i], 1); |
---|
| 86 | for (uint32_t i=0; i<_param->_nb_port_read_write ; i++) |
---|
| 87 | PORT_WRITE(out_READ_WRITE_ACK [i], 1); |
---|
[2] | 88 | } |
---|
| 89 | #endif |
---|
[57] | 90 | |
---|
[41] | 91 | log_printf(FUNC,RegisterFile_Monolithic,"RegisterFile_Monolithic","End"); |
---|
[2] | 92 | }; |
---|
| 93 | |
---|
[15] | 94 | RegisterFile_Monolithic::~RegisterFile_Monolithic (void) |
---|
[2] | 95 | { |
---|
| 96 | #ifdef STATISTICS |
---|
| 97 | _stat->generate_file(statistics(0)); |
---|
| 98 | delete _stat; |
---|
| 99 | #endif |
---|
[41] | 100 | |
---|
| 101 | deallocation (); |
---|
[2] | 102 | }; |
---|
| 103 | |
---|
[15] | 104 | }; // end namespace registerfile_monolithic |
---|
[2] | 105 | }; // end namespace registerfile |
---|
| 106 | }; // end namespace generic |
---|
| 107 | }; // end namespace behavioural |
---|
| 108 | }; // end namespace morpheo |
---|