[2] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
[15] | 9 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h" |
---|
[2] | 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace registerfile { |
---|
[15] | 15 | namespace registerfile_monolithic { |
---|
[2] | 16 | |
---|
[15] | 17 | void RegisterFile_Monolithic::genMealy_read (void) |
---|
[2] | 18 | { |
---|
[53] | 19 | log_printf(FUNC,RegisterFile,"genMealy_read","Begin"); |
---|
[2] | 20 | |
---|
[55] | 21 | for (uint32_t i=0; i<_param->_nb_port_read; i++) |
---|
[2] | 22 | { |
---|
| 23 | // Have a write? |
---|
[6] | 24 | if ( PORT_READ(in_READ_VAL [i]) == 1) |
---|
[2] | 25 | { |
---|
[62] | 26 | Taddress_t address; |
---|
| 27 | if (_param->_have_port_address) |
---|
| 28 | address = PORT_READ(in_READ_ADDRESS[i]); |
---|
| 29 | else |
---|
| 30 | address = 0; |
---|
[78] | 31 | Tdata_t data = reg_DATA[address]; |
---|
[3] | 32 | |
---|
[53] | 33 | log_printf(TRACE,RegisterFile,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); |
---|
[3] | 34 | |
---|
[2] | 35 | // Write in registerFile |
---|
[3] | 36 | PORT_WRITE(out_READ_DATA[i],data); |
---|
[2] | 37 | } |
---|
| 38 | else |
---|
| 39 | { |
---|
[53] | 40 | //log_printf(TRACE,RegisterFile,"genMealy_read","Read [%d] : No transaction",i); |
---|
[2] | 41 | PORT_WRITE(out_READ_DATA[i],0); |
---|
| 42 | } |
---|
| 43 | } |
---|
[55] | 44 | |
---|
| 45 | for (uint32_t i=0; i<_param->_nb_port_read_write; i++) |
---|
| 46 | { |
---|
| 47 | Tdata_t data; |
---|
| 48 | |
---|
| 49 | // Have a write? |
---|
| 50 | if ( (PORT_READ(in_READ_WRITE_VAL [i]) == 1) and |
---|
| 51 | (PORT_READ(in_READ_WRITE_RW [i]) == RW_READ) |
---|
| 52 | ) |
---|
| 53 | { |
---|
[62] | 54 | Taddress_t address; |
---|
| 55 | if (_param->_have_port_address) |
---|
| 56 | address = PORT_READ(in_READ_WRITE_ADDRESS[i]); |
---|
| 57 | else |
---|
| 58 | address = 0; |
---|
[55] | 59 | |
---|
[78] | 60 | data = reg_DATA[address]; |
---|
[55] | 61 | |
---|
| 62 | log_printf(TRACE,RegisterFile,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); |
---|
| 63 | } |
---|
| 64 | else |
---|
| 65 | { |
---|
| 66 | //log_printf(TRACE,RegisterFile,"genMealy_read","Read [%d] : No transaction",i); |
---|
| 67 | data = 0; |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | PORT_WRITE(out_READ_WRITE_RDATA[i],data); |
---|
| 71 | } |
---|
| 72 | |
---|
[53] | 73 | log_printf(FUNC,RegisterFile,"genMealy_read","End"); |
---|
[2] | 74 | |
---|
| 75 | }; |
---|
| 76 | |
---|
[15] | 77 | }; // end namespace registerfile_monolithic |
---|
[2] | 78 | }; // end namespace registerfile |
---|
| 79 | }; // end namespace generic |
---|
| 80 | }; // end namespace behavioural |
---|
| 81 | }; // end namespace morpheo |
---|
| 82 | #endif |
---|