[61] | 1 | #ifdef SYSTEMC |
---|
| 2 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 3 | /* |
---|
| 4 | * $Id: Register_unit_Glue_genMealy_gpr_read_registerfile.cpp 123 2009-06-08 20:43:30Z rosiere $ |
---|
| 5 | * |
---|
| 6 | * [ Description ] |
---|
| 7 | * |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/include/Register_unit_Glue.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace core { |
---|
| 15 | namespace multi_execute_loop { |
---|
| 16 | namespace execute_loop { |
---|
| 17 | namespace register_unit { |
---|
| 18 | namespace register_unit_glue { |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | #undef FUNCTION |
---|
| 22 | #define FUNCTION "Register_unit_Glue::genMealy_gpr_read_registerfile" |
---|
| 23 | void Register_unit_Glue::genMealy_gpr_read_registerfile (void) |
---|
| 24 | { |
---|
[88] | 25 | log_begin(Register_unit_Glue,FUNCTION); |
---|
| 26 | log_function(Register_unit_Glue,FUNCTION,_name.c_str()); |
---|
[61] | 27 | |
---|
[123] | 28 | if (PORT_READ(in_NRESET)) |
---|
[61] | 29 | { |
---|
[88] | 30 | for (uint32_t j=0; j<_param->_nb_gpr_read; j++) |
---|
[61] | 31 | { |
---|
[88] | 32 | Tcontext_t ooo_engine_id = (_param->_have_port_ooo_engine_id == true)?PORT_READ(in_GPR_READ_OOO_ENGINE_ID[j]):0; |
---|
| 33 | Tcontrol_t val = PORT_READ(in_GPR_READ_VAL [j]); |
---|
| 34 | Tcontrol_t status_ack = PORT_READ(in_GPR_READ_STATUS_ACK [ooo_engine_id][j]); |
---|
| 35 | |
---|
| 36 | Tcontrol_t registerfile_val = val and status_ack; |
---|
| 37 | |
---|
| 38 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 39 | { |
---|
| 40 | Tcontrol_t id = (i == ooo_engine_id)?1:0; |
---|
| 41 | PORT_WRITE(out_GPR_READ_REGISTERFILE_VAL [i][j], (id and registerfile_val)); |
---|
| 42 | } |
---|
[61] | 43 | } |
---|
| 44 | } |
---|
[123] | 45 | else |
---|
| 46 | { |
---|
| 47 | for (uint32_t j=0; j<_param->_nb_gpr_read; j++) |
---|
| 48 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 49 | PORT_WRITE(out_GPR_READ_REGISTERFILE_VAL [i][j],0); |
---|
| 50 | } |
---|
[61] | 51 | |
---|
[88] | 52 | log_end(Register_unit_Glue,FUNCTION); |
---|
[61] | 53 | }; |
---|
| 54 | |
---|
| 55 | }; // end namespace register_unit_glue |
---|
| 56 | }; // end namespace register_unit |
---|
| 57 | }; // end namespace execute_loop |
---|
| 58 | }; // end namespace multi_execute_loop |
---|
| 59 | }; // end namespace core |
---|
| 60 | |
---|
| 61 | }; // end namespace behavioural |
---|
| 62 | }; // end namespace morpheo |
---|
| 63 | #endif |
---|
| 64 | //#endif |
---|