[88] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: OOO_Engine_Glue_genMealy_insert_valack.cpp 123 2009-06-08 20:43:30Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/include/OOO_Engine_Glue.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_ooo_engine { |
---|
| 15 | namespace ooo_engine { |
---|
| 16 | namespace ooo_engine_glue { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "OOO_Engine_Glue::genMealy_insert_valack" |
---|
| 21 | void OOO_Engine_Glue::genMealy_insert_valack (void) |
---|
| 22 | { |
---|
| 23 | log_begin(OOO_Engine_Glue,FUNCTION); |
---|
| 24 | log_function(OOO_Engine_Glue,FUNCTION,_name.c_str()); |
---|
| 25 | |
---|
[123] | 26 | if (PORT_READ(in_NRESET)) |
---|
| 27 | { |
---|
[88] | 28 | uint32_t x=0; |
---|
| 29 | for (uint32_t i=0; i<_param->_nb_rename_unit; ++i) |
---|
| 30 | { |
---|
[109] | 31 | // Transaction must be in-order : make in Rename_unit |
---|
[88] | 32 | |
---|
| 33 | for (uint32_t j=0; j<_param->_nb_inst_insert[i]; ++j) |
---|
| 34 | { |
---|
| 35 | Tcontrol_t ack = PORT_READ(in_INSERT_ACK [x] ); |
---|
| 36 | Tcontrol_t rename_unit_val = PORT_READ(in_INSERT_RENAME_UNIT_VAL [i][j]); |
---|
| 37 | Tcontrol_t rename_unit_no_execute = PORT_READ(in_INSERT_RENAME_UNIT_NO_EXECUTE [i][j]); |
---|
| 38 | Tcontrol_t commit_unit_ack = PORT_READ(in_INSERT_COMMIT_UNIT_ACK [i][j]); |
---|
| 39 | Tcontrol_t issue_queue_ack = PORT_READ(in_INSERT_ISSUE_QUEUE_ACK [i][j]); |
---|
| 40 | |
---|
| 41 | // if not execute -> don't route to issue_queue |
---|
| 42 | |
---|
| 43 | Tcontrol_t val = ( |
---|
| 44 | rename_unit_val and |
---|
| 45 | commit_unit_ack and |
---|
| 46 | (rename_unit_no_execute or |
---|
| 47 | issue_queue_ack)); |
---|
| 48 | Tcontrol_t rename_unit_ack = ( |
---|
| 49 | ack and |
---|
| 50 | commit_unit_ack and |
---|
| 51 | (rename_unit_no_execute or |
---|
| 52 | issue_queue_ack)); |
---|
| 53 | Tcontrol_t commit_unit_val = ( |
---|
| 54 | ack and |
---|
| 55 | rename_unit_val and |
---|
| 56 | (rename_unit_no_execute or |
---|
| 57 | issue_queue_ack)); |
---|
| 58 | Tcontrol_t issue_queue_val = ( |
---|
| 59 | ack and |
---|
| 60 | rename_unit_val and |
---|
| 61 | commit_unit_ack and |
---|
| 62 | not rename_unit_no_execute); |
---|
[110] | 63 | |
---|
[88] | 64 | PORT_WRITE(out_INSERT_VAL [x] ,val ); |
---|
| 65 | PORT_WRITE(out_INSERT_RENAME_UNIT_ACK [i][j],rename_unit_ack); |
---|
| 66 | PORT_WRITE(out_INSERT_COMMIT_UNIT_VAL [i][j],commit_unit_val); |
---|
| 67 | PORT_WRITE(out_INSERT_ISSUE_QUEUE_VAL [i][j],issue_queue_val); |
---|
| 68 | |
---|
| 69 | log_printf(TRACE,OOO_Engine_Glue,FUNCTION," * rename_unit [%d].inst_insert[%d] -> %d",i,j,x); |
---|
[109] | 70 | log_printf(TRACE,OOO_Engine_Glue,FUNCTION," * insert_val (RegisterFile) (w) : %d",val ); |
---|
| 71 | log_printf(TRACE,OOO_Engine_Glue,FUNCTION," * insert_ack (RegisterFile) (r) : %d",ack ); |
---|
[88] | 72 | log_printf(TRACE,OOO_Engine_Glue,FUNCTION," * insert_rename_unit_val (r) : %d",rename_unit_val ); |
---|
| 73 | log_printf(TRACE,OOO_Engine_Glue,FUNCTION," * insert_rename_unit_ack (w) : %d",rename_unit_ack ); |
---|
| 74 | log_printf(TRACE,OOO_Engine_Glue,FUNCTION," * insert_rename_unit_no_execute (r) : %d",rename_unit_no_execute); |
---|
| 75 | log_printf(TRACE,OOO_Engine_Glue,FUNCTION," * insert_commit_unit_val (w) : %d",commit_unit_val ); |
---|
| 76 | log_printf(TRACE,OOO_Engine_Glue,FUNCTION," * insert_commit_unit_ack (r) : %d",commit_unit_ack ); |
---|
| 77 | log_printf(TRACE,OOO_Engine_Glue,FUNCTION," * insert_issue_queue_val (w) : %d",issue_queue_val ); |
---|
| 78 | log_printf(TRACE,OOO_Engine_Glue,FUNCTION," * insert_issue_queue_ack (r) : %d",issue_queue_ack ); |
---|
| 79 | |
---|
| 80 | x ++; |
---|
| 81 | } |
---|
| 82 | } |
---|
[123] | 83 | } |
---|
| 84 | else |
---|
| 85 | { |
---|
| 86 | uint32_t x=0; |
---|
| 87 | for (uint32_t i=0; i<_param->_nb_rename_unit; ++i) |
---|
| 88 | for (uint32_t j=0; j<_param->_nb_inst_insert[i]; ++j) |
---|
| 89 | { |
---|
| 90 | PORT_WRITE(out_INSERT_VAL [x] ,0); |
---|
| 91 | PORT_WRITE(out_INSERT_RENAME_UNIT_ACK [i][j],0); |
---|
| 92 | PORT_WRITE(out_INSERT_COMMIT_UNIT_VAL [i][j],0); |
---|
| 93 | PORT_WRITE(out_INSERT_ISSUE_QUEUE_VAL [i][j],0); |
---|
| 94 | x ++; |
---|
| 95 | } |
---|
| 96 | } |
---|
[88] | 97 | |
---|
| 98 | log_end(OOO_Engine_Glue,FUNCTION); |
---|
| 99 | }; |
---|
| 100 | |
---|
| 101 | }; // end namespace ooo_engine_glue |
---|
| 102 | }; // end namespace ooo_engine |
---|
| 103 | }; // end namespace multi_ooo_engine |
---|
| 104 | }; // end namespace core |
---|
| 105 | |
---|
| 106 | }; // end namespace behavioural |
---|
| 107 | }; // end namespace morpheo |
---|
| 108 | #endif |
---|