| 1 | #ifdef SYSTEMC |
|---|
| 2 | /* |
|---|
| 3 | * $Id$ |
|---|
| 4 | * |
|---|
| 5 | * [ Description ] |
|---|
| 6 | * |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h" |
|---|
| 10 | |
|---|
| 11 | namespace morpheo { |
|---|
| 12 | namespace behavioural { |
|---|
| 13 | namespace generic { |
|---|
| 14 | namespace registerfile { |
|---|
| 15 | namespace registerfile_monolithic { |
|---|
| 16 | |
|---|
| 17 | void RegisterFile_Monolithic::genMealy_read (void) |
|---|
| 18 | { |
|---|
| 19 | log_printf(FUNC,Register_File,"genMealy_read","Begin"); |
|---|
| 20 | |
|---|
| 21 | #ifdef STATISTICS |
|---|
| 22 | _stat_nb_read = 0; |
|---|
| 23 | #endif |
|---|
| 24 | |
|---|
| 25 | for (uint32_t i=0; i<_param._nb_port_read; i++) |
|---|
| 26 | { |
|---|
| 27 | // Have a write? |
|---|
| 28 | if ( PORT_READ(in_READ_VAL [i]) == 1) |
|---|
| 29 | { |
|---|
| 30 | Taddress_t address = PORT_READ(in_READ_ADDRESS[i]); |
|---|
| 31 | Tdata_t data = REGISTER_READ(reg_DATA[address]); |
|---|
| 32 | |
|---|
| 33 | log_printf(TRACE,Register_File,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); |
|---|
| 34 | |
|---|
| 35 | #ifdef STATISTICS |
|---|
| 36 | _stat_nb_read ++; |
|---|
| 37 | #endif |
|---|
| 38 | // Write in registerFile |
|---|
| 39 | PORT_WRITE(out_READ_DATA[i],data); |
|---|
| 40 | } |
|---|
| 41 | else |
|---|
| 42 | { |
|---|
| 43 | //log_printf(TRACE,Register_File,"genMealy_read","Read [%d] : No transaction",i); |
|---|
| 44 | PORT_WRITE(out_READ_DATA[i],0); |
|---|
| 45 | } |
|---|
| 46 | } |
|---|
| 47 | log_printf(FUNC,Register_File,"genMealy_read","End"); |
|---|
| 48 | |
|---|
| 49 | }; |
|---|
| 50 | |
|---|
| 51 | }; // end namespace registerfile_monolithic |
|---|
| 52 | }; // end namespace registerfile |
|---|
| 53 | }; // end namespace generic |
|---|
| 54 | }; // end namespace behavioural |
|---|
| 55 | }; // end namespace morpheo |
|---|
| 56 | #endif |
|---|