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