[88] | 1 | #ifdef SYSTEMC |
---|
| 2 | /* |
---|
| 3 | * $Id: Special_Register_unit_genMealy_spr_access.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/include/Special_Register_unit.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_ooo_engine { |
---|
| 15 | namespace ooo_engine { |
---|
| 16 | namespace special_register_unit { |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | #undef FUNCTION |
---|
| 20 | #define FUNCTION "Special_Register_unit::genMealy_spr_access" |
---|
| 21 | void Special_Register_unit::genMealy_spr_access (void) |
---|
| 22 | { |
---|
| 23 | log_begin(Special_Register_unit,FUNCTION); |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | // =================================================================== |
---|
| 27 | // =====[ SPR_ACCESS ]================================================ |
---|
| 28 | // =================================================================== |
---|
| 29 | for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++) |
---|
| 30 | // if (PORT_READ(in_SPR_ACCESS_VAL [i]) and not PORT_READ(in_SPR_ACCESS_WEN [i])) |
---|
| 31 | { |
---|
| 32 | Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_SPR_ACCESS_FRONT_END_ID [i]):0; |
---|
| 33 | Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_SPR_ACCESS_CONTEXT_ID [i]):0; |
---|
| 34 | Tspr_address_t num_group = PORT_READ(in_SPR_ACCESS_NUM_GROUP [i]); |
---|
| 35 | Tspr_address_t num_reg = PORT_READ(in_SPR_ACCESS_NUM_REG [i]); |
---|
| 36 | |
---|
| 37 | SR * sr = static_cast<SR*>(_spr [front_end_id][context_id][GROUP_SYSTEM_AND_CONTROL][SPR_SR]); |
---|
| 38 | |
---|
| 39 | Tcontrol_t sm = sr->sm ; |
---|
| 40 | Tcontrol_t sumra = sr->sumra; |
---|
| 41 | |
---|
| 42 | Tcontrol_t valid = _spr_access_mode [front_end_id][context_id]->read(spr_address_t(num_group,num_reg), |
---|
| 43 | sm, |
---|
| 44 | sumra); |
---|
| 45 | |
---|
| 46 | PORT_WRITE(out_SPR_ACCESS_RDATA [i], (valid)?_spr[front_end_id][context_id][num_group][num_reg]->read():0); |
---|
| 47 | PORT_WRITE(out_SPR_ACCESS_INVALID [i], not valid); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 51 | end_cycle (); |
---|
| 52 | #endif |
---|
| 53 | |
---|
| 54 | log_end(Special_Register_unit,FUNCTION); |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | }; // end namespace special_register_unit |
---|
| 58 | }; // end namespace ooo_engine |
---|
| 59 | }; // end namespace multi_ooo_engine |
---|
| 60 | }; // end namespace core |
---|
| 61 | |
---|
| 62 | }; // end namespace behavioural |
---|
| 63 | }; // end namespace morpheo |
---|
| 64 | #endif |
---|