[60] | 1 | #ifdef SYSTEMC |
---|
| 2 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 3 | /* |
---|
| 4 | * $Id: Register_unit_Glue_genMealy_insert.cpp 136 2009-10-20 18:52:15Z 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_insert" |
---|
| 23 | void Register_unit_Glue::genMealy_insert (void) |
---|
| 24 | { |
---|
[88] | 25 | log_begin(Register_unit_Glue,FUNCTION); |
---|
| 26 | log_function(Register_unit_Glue,FUNCTION,_name.c_str()); |
---|
[60] | 27 | |
---|
[123] | 28 | if (PORT_READ(in_NRESET)) |
---|
| 29 | { |
---|
[136] | 30 | for (uint32_t i=0; i<_param->_nb_inst_issue; i++) |
---|
| 31 | { |
---|
| 32 | Tcontrol_t val = PORT_READ(in_ISSUE_VAL [i]); |
---|
| 33 | Tcontrol_t gpr_use = PORT_READ(in_ISSUE_RD_USE [i]); |
---|
| 34 | Tcontrol_t spr_use = PORT_READ(in_ISSUE_RE_USE [i]); |
---|
| 35 | Tcontext_t ooo_engine_id = (_param->_have_port_ooo_engine_id)?PORT_READ(in_ISSUE_VAL [i]):0; |
---|
| 36 | Tcontrol_t gpr_status_ack = PORT_READ(in_ISSUE_GPR_STATUS_ACK [ooo_engine_id][i]); |
---|
| 37 | Tcontrol_t spr_status_ack = PORT_READ(in_ISSUE_SPR_STATUS_ACK [ooo_engine_id][i]); |
---|
[60] | 38 | |
---|
[136] | 39 | Tcontrol_t ack = (gpr_status_ack and |
---|
| 40 | spr_status_ack); |
---|
| 41 | Tcontrol_t gpr_status_val = (val and |
---|
| 42 | gpr_use and |
---|
| 43 | spr_status_ack); |
---|
| 44 | Tcontrol_t spr_status_val = (val and |
---|
| 45 | spr_use and |
---|
| 46 | gpr_status_ack); |
---|
| 47 | |
---|
| 48 | log_printf(TRACE,Register_unit_Glue,FUNCTION," * issue [%d]",i); |
---|
| 49 | log_printf(TRACE,Register_unit_Glue,FUNCTION," * ooo_engine_id (w) : %d",ooo_engine_id ); |
---|
| 50 | log_printf(TRACE,Register_unit_Glue,FUNCTION," * val (r) : %d",val ); |
---|
| 51 | log_printf(TRACE,Register_unit_Glue,FUNCTION," * ack (w) : %d",ack ); |
---|
| 52 | log_printf(TRACE,Register_unit_Glue,FUNCTION," * gpr_use (rd) (r) : %d",gpr_use ); |
---|
| 53 | log_printf(TRACE,Register_unit_Glue,FUNCTION," * gpr_status_val (w) : %d",gpr_status_val); |
---|
| 54 | log_printf(TRACE,Register_unit_Glue,FUNCTION," * gpr_status_ack (r) : %d",gpr_status_ack); |
---|
| 55 | log_printf(TRACE,Register_unit_Glue,FUNCTION," * spr_use (re) (r) : %d",spr_use ); |
---|
| 56 | log_printf(TRACE,Register_unit_Glue,FUNCTION," * spr_status_val (w) : %d",spr_status_val); |
---|
| 57 | log_printf(TRACE,Register_unit_Glue,FUNCTION," * spr_status_ack (r) : %d",spr_status_ack); |
---|
| 58 | |
---|
| 59 | PORT_WRITE(out_ISSUE_ACK [i], ack ); |
---|
| 60 | PORT_WRITE(out_ISSUE_GPR_STATUS_VAL [ooo_engine_id][i], gpr_status_val); |
---|
| 61 | PORT_WRITE(out_ISSUE_SPR_STATUS_VAL [ooo_engine_id][i], spr_status_val); |
---|
[60] | 62 | |
---|
[136] | 63 | for (uint32_t j=0; j<_param->_nb_ooo_engine; ++j) |
---|
| 64 | if (j!=ooo_engine_id) |
---|
| 65 | { |
---|
| 66 | PORT_WRITE(out_ISSUE_GPR_STATUS_VAL [j][i], 0); |
---|
| 67 | PORT_WRITE(out_ISSUE_SPR_STATUS_VAL [j][i], 0); |
---|
| 68 | } |
---|
[88] | 69 | } |
---|
[123] | 70 | } |
---|
| 71 | else |
---|
| 72 | { |
---|
[136] | 73 | for (uint32_t i=0; i<_param->_nb_inst_issue; i++) |
---|
| 74 | { |
---|
| 75 | PORT_WRITE(out_ISSUE_ACK [i], 0); |
---|
| 76 | for (uint32_t j=0; j<_param->_nb_ooo_engine; j++) |
---|
| 77 | { |
---|
| 78 | PORT_WRITE(out_ISSUE_GPR_STATUS_VAL [j][i], 0); |
---|
| 79 | PORT_WRITE(out_ISSUE_SPR_STATUS_VAL [j][i], 0); |
---|
| 80 | } |
---|
| 81 | } |
---|
[123] | 82 | } |
---|
[88] | 83 | |
---|
[136] | 84 | // if (PORT_READ(in_NRESET)) |
---|
| 85 | // { |
---|
| 86 | // for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 87 | // for (uint32_t j=0; j<_param->_nb_inst_insert_rob [i]; j++) |
---|
| 88 | // { |
---|
| 89 | // Tcontrol_t val = PORT_READ(in_INSERT_ROB_VAL [i][j]); |
---|
| 90 | // Tcontrol_t gpr_use = PORT_READ(in_INSERT_ROB_RD_USE [i][j]); |
---|
| 91 | // Tcontrol_t spr_use = PORT_READ(in_INSERT_ROB_RE_USE [i][j]); |
---|
| 92 | // Tcontrol_t gpr_status_ack = PORT_READ(in_INSERT_ROB_GPR_STATUS_ACK [i][j]); |
---|
| 93 | // Tcontrol_t spr_status_ack = PORT_READ(in_INSERT_ROB_SPR_STATUS_ACK [i][j]); |
---|
| 94 | |
---|
| 95 | // Tcontrol_t ack = (gpr_status_ack and |
---|
| 96 | // spr_status_ack); |
---|
| 97 | // Tcontrol_t gpr_status_val = (val and |
---|
| 98 | // gpr_use and |
---|
| 99 | // spr_status_ack); |
---|
| 100 | // Tcontrol_t spr_status_val = (val and |
---|
| 101 | // spr_use and |
---|
| 102 | // gpr_status_ack); |
---|
| 103 | |
---|
| 104 | // log_printf(TRACE,Register_unit_Glue,FUNCTION," * insert_rob [%d][%d]",i,j); |
---|
| 105 | // log_printf(TRACE,Register_unit_Glue,FUNCTION," * val (r) : %d",val ); |
---|
| 106 | // log_printf(TRACE,Register_unit_Glue,FUNCTION," * ack (w) : %d",ack ); |
---|
| 107 | // log_printf(TRACE,Register_unit_Glue,FUNCTION," * gpr_use (rd) (r) : %d",gpr_use ); |
---|
| 108 | // log_printf(TRACE,Register_unit_Glue,FUNCTION," * gpr_status_val (w) : %d",gpr_status_val); |
---|
| 109 | // log_printf(TRACE,Register_unit_Glue,FUNCTION," * gpr_status_ack (r) : %d",gpr_status_ack); |
---|
| 110 | // log_printf(TRACE,Register_unit_Glue,FUNCTION," * spr_use (re) (r) : %d",spr_use ); |
---|
| 111 | // log_printf(TRACE,Register_unit_Glue,FUNCTION," * spr_status_val (w) : %d",spr_status_val); |
---|
| 112 | // log_printf(TRACE,Register_unit_Glue,FUNCTION," * spr_status_ack (r) : %d",spr_status_ack); |
---|
| 113 | |
---|
| 114 | // PORT_WRITE(out_INSERT_ROB_ACK [i][j], ack ); |
---|
| 115 | // PORT_WRITE(out_INSERT_ROB_GPR_STATUS_VAL [i][j], gpr_status_val); |
---|
| 116 | // PORT_WRITE(out_INSERT_ROB_SPR_STATUS_VAL [i][j], spr_status_val); |
---|
| 117 | // } |
---|
| 118 | // } |
---|
| 119 | // else |
---|
| 120 | // { |
---|
| 121 | // for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 122 | // for (uint32_t j=0; j<_param->_nb_inst_insert_rob [i]; j++) |
---|
| 123 | // { |
---|
| 124 | // PORT_WRITE(out_INSERT_ROB_ACK [i][j], 0); |
---|
| 125 | // PORT_WRITE(out_INSERT_ROB_GPR_STATUS_VAL [i][j], 0); |
---|
| 126 | // PORT_WRITE(out_INSERT_ROB_SPR_STATUS_VAL [i][j], 0); |
---|
| 127 | // } |
---|
| 128 | // } |
---|
| 129 | |
---|
[88] | 130 | log_end(Register_unit_Glue,FUNCTION); |
---|
[60] | 131 | }; |
---|
| 132 | |
---|
| 133 | }; // end namespace register_unit_glue |
---|
| 134 | }; // end namespace register_unit |
---|
| 135 | }; // end namespace execute_loop |
---|
| 136 | }; // end namespace multi_execute_loop |
---|
| 137 | }; // end namespace core |
---|
| 138 | |
---|
| 139 | }; // end namespace behavioural |
---|
| 140 | }; // end namespace morpheo |
---|
| 141 | #endif |
---|
| 142 | //#endif |
---|