[59] | 1 | #ifdef SYSTEMC |
---|
| 2 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 3 | /* |
---|
| 4 | * $Id: Load_store_unit_function_speculative_load_access_genMealy_insert.cpp 138 2010-05-12 17:34:01Z rosiere $ |
---|
| 5 | * |
---|
| 6 | * [ Description ] |
---|
| 7 | * |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace core { |
---|
| 15 | namespace multi_execute_loop { |
---|
| 16 | namespace execute_loop { |
---|
| 17 | namespace multi_execute_unit { |
---|
| 18 | namespace execute_unit { |
---|
| 19 | namespace load_store_unit { |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | #undef FUNCTION |
---|
[138] | 23 | #define FUNCTION "Load_store_unit::function_speculative_load_access_genMealy_insert" |
---|
| 24 | void Load_store_unit::function_speculative_load_access_genMealy_insert (void) |
---|
[59] | 25 | { |
---|
[101] | 26 | log_begin(Load_store_unit,FUNCTION); |
---|
| 27 | log_function(Load_store_unit,FUNCTION,_name.c_str()); |
---|
[59] | 28 | |
---|
[71] | 29 | // ~~~~~[ Output "memory_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[88] | 30 | |
---|
| 31 | // Initialisation |
---|
| 32 | internal_MEMORY_IN_PORT = 0; |
---|
| 33 | Tcontrol_t ack [_param->_nb_inst_memory]; |
---|
| 34 | for (uint32_t i=0; i<_param->_nb_inst_memory; i++) |
---|
| 35 | ack [i] = 0; |
---|
[59] | 36 | |
---|
[123] | 37 | if (PORT_READ(in_NRESET)) |
---|
| 38 | { |
---|
[88] | 39 | // find first valid entry |
---|
[71] | 40 | // store queue is never full (pointer is manage by rename stage) |
---|
[88] | 41 | for (uint32_t i=0; i<_param->_nb_inst_memory; i++) |
---|
| 42 | if (PORT_READ(in_MEMORY_IN_VAL [i])) |
---|
| 43 | { |
---|
| 44 | internal_MEMORY_IN_ACK = is_operation_memory_store(PORT_READ(in_MEMORY_IN_OPERATION [i])) or not _speculative_access_queue_control->full(); |
---|
[71] | 45 | |
---|
[88] | 46 | if (internal_MEMORY_IN_ACK) |
---|
| 47 | { |
---|
| 48 | ack [i] = 1; |
---|
| 49 | internal_MEMORY_IN_PORT = i; |
---|
| 50 | break; // end |
---|
| 51 | } |
---|
| 52 | } |
---|
[123] | 53 | } |
---|
| 54 | else |
---|
| 55 | { |
---|
| 56 | internal_MEMORY_IN_ACK = 0; |
---|
| 57 | // internal_MEMORY_IN_PORT = i; |
---|
| 58 | } |
---|
[59] | 59 | |
---|
[88] | 60 | for (uint32_t i=0; i<_param->_nb_inst_memory; i++) |
---|
| 61 | PORT_WRITE(out_MEMORY_IN_ACK [i], ack [i]); |
---|
| 62 | |
---|
[101] | 63 | log_end(Load_store_unit,FUNCTION); |
---|
[59] | 64 | }; |
---|
| 65 | |
---|
| 66 | }; // end namespace load_store_unit |
---|
| 67 | }; // end namespace execute_unit |
---|
| 68 | }; // end namespace multi_execute_unit |
---|
| 69 | }; // end namespace execute_loop |
---|
| 70 | }; // end namespace multi_execute_loop |
---|
| 71 | }; // end namespace core |
---|
| 72 | |
---|
| 73 | }; // end namespace behavioural |
---|
| 74 | }; // end namespace morpheo |
---|
| 75 | #endif |
---|
| 76 | //#endif |
---|