[88] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Reexecute_unit_must_reexecute.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/include/Reexecute_unit.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_ooo_engine { |
---|
| 15 | namespace ooo_engine { |
---|
| 16 | namespace reexecute_unit { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Reexecute_unit::must_reexecute" |
---|
| 21 | bool Reexecute_unit::must_reexecute (Tspr_address_t address, info_t & info) |
---|
| 22 | { |
---|
| 23 | log_begin(Reexecute_unit,FUNCTION); |
---|
| 24 | |
---|
| 25 | // Test if need reexecute |
---|
| 26 | if (info.spr_wen) |
---|
| 27 | { |
---|
| 28 | // ***** SPR WRITE ***** |
---|
| 29 | |
---|
| 30 | Tspr_address_t num_group = (address >> _param->_shift_spr_num_group) & _param->_mask_spr_num_group; |
---|
| 31 | Tspr_address_t num_reg = (address ) & _param->_mask_spr_num_reg ; |
---|
| 32 | |
---|
| 33 | switch (num_group) |
---|
| 34 | { |
---|
| 35 | case GROUP_DCACHE : |
---|
| 36 | { |
---|
| 37 | info.type = TYPE_MEMORY; |
---|
| 38 | info.write_rd = 0; |
---|
| 39 | |
---|
| 40 | switch (num_reg) |
---|
| 41 | { |
---|
| 42 | case SPR_DCBPR : {info.reexecute = true; info.operation = OPERATION_MEMORY_PREFETCH ; break;} |
---|
| 43 | case SPR_DCBFR : {info.reexecute = true; info.operation = OPERATION_MEMORY_FLUSH ; break;} |
---|
| 44 | case SPR_DCBIR : {info.reexecute = true; info.operation = OPERATION_MEMORY_INVALIDATE; break;} |
---|
| 45 | // case SPR_DCBWR : {info.reexecute = true; info.operation = OPERATION_MEMORY_FLUSH ; break;} |
---|
| 46 | case SPR_DCBLR : {info.reexecute = true; info.operation = OPERATION_MEMORY_LOCK ; break;} |
---|
| 47 | default : |
---|
| 48 | { |
---|
| 49 | info.reexecute = false; |
---|
| 50 | break; |
---|
| 51 | } |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | break; |
---|
| 55 | } |
---|
| 56 | default : |
---|
| 57 | { |
---|
| 58 | info.reexecute = false; |
---|
| 59 | break; |
---|
| 60 | } |
---|
| 61 | } |
---|
| 62 | } |
---|
| 63 | else |
---|
| 64 | { |
---|
| 65 | // ***** SPR READ ***** |
---|
| 66 | info.reexecute = true; |
---|
| 67 | info.type = TYPE_ALU; |
---|
| 68 | info.operation = OPERATION_ALU_L_OR; |
---|
| 69 | info.write_rd = 1; |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | log_end(Reexecute_unit,FUNCTION); |
---|
| 73 | |
---|
| 74 | return info.reexecute; |
---|
| 75 | } |
---|
| 76 | |
---|
| 77 | }; // end namespace reexecute_unit |
---|
| 78 | }; // end namespace ooo_engine |
---|
| 79 | }; // end namespace multi_ooo_engine |
---|
| 80 | }; // end namespace core |
---|
| 81 | |
---|
| 82 | }; // end namespace behavioural |
---|
| 83 | }; // end namespace morpheo |
---|
| 84 | #endif |
---|
| 85 | |
---|
| 86 | |
---|