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