[78] | 1 | /* |
---|
| 2 | * $Id: Load_Store_pointer_unit_allocation.cpp 97 2008-12-19 15:34:00Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Load_Store_pointer_unit.h" |
---|
| 9 | #include "Behavioural/include/Allocation.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_ooo_engine { |
---|
| 15 | namespace ooo_engine { |
---|
| 16 | namespace rename_unit { |
---|
| 17 | namespace load_store_pointer_unit { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | #undef FUNCTION |
---|
| 22 | #define FUNCTION "Load_Store_pointer_unit::allocation" |
---|
| 23 | void Load_Store_pointer_unit::allocation ( |
---|
| 24 | #ifdef STATISTICS |
---|
| 25 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 26 | #else |
---|
| 27 | void |
---|
| 28 | #endif |
---|
| 29 | ) |
---|
| 30 | { |
---|
| 31 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"Begin"); |
---|
| 32 | |
---|
| 33 | _component = new Component (_usage); |
---|
| 34 | |
---|
| 35 | Entity * entity = _component->set_entity (_name |
---|
| 36 | ,"Load_Store_pointer_unit" |
---|
| 37 | #ifdef POSITION |
---|
| 38 | ,COMBINATORY |
---|
| 39 | #endif |
---|
| 40 | ); |
---|
| 41 | |
---|
| 42 | _interfaces = entity->set_interfaces(); |
---|
| 43 | |
---|
| 44 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 45 | { |
---|
| 46 | Interface * interface = _interfaces->set_interface("" |
---|
| 47 | #ifdef POSITION |
---|
| 48 | ,IN |
---|
| 49 | ,SOUTH, |
---|
| 50 | "Generalist interface" |
---|
| 51 | #endif |
---|
| 52 | ); |
---|
| 53 | |
---|
| 54 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
| 55 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | // ~~~~~[ Interface : "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 59 | { |
---|
| 60 | ALLOC1_INTERFACE("insert", IN, EAST, "insert to the re order buffer an instruction", _param->_nb_inst_insert); |
---|
| 61 | |
---|
| 62 | ALLOC1_VALACK_IN ( in_INSERT_VAL ,VAL); |
---|
| 63 | ALLOC1_VALACK_OUT(out_INSERT_ACK ,ACK); |
---|
| 64 | ALLOC1_SIGNAL_IN ( in_INSERT_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id ); |
---|
| 65 | ALLOC1_SIGNAL_IN ( in_INSERT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); |
---|
| 66 | ALLOC1_SIGNAL_IN ( in_INSERT_TYPE ,"type" ,Ttype_t ,_param->_size_type ); |
---|
| 67 | ALLOC1_SIGNAL_IN ( in_INSERT_OPERATION ,"operation" ,Toperation_t,_param->_size_operation ); |
---|
| 68 | ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); |
---|
| 69 | ALLOC1_SIGNAL_OUT(out_INSERT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | // ~~~~~[ Interface : "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 73 | { |
---|
| 74 | ALLOC1_INTERFACE("retire", IN, EAST, "retire from the re order buffer an instruction", _param->_nb_inst_retire); |
---|
| 75 | |
---|
| 76 | ALLOC1_VALACK_IN ( in_RETIRE_VAL ,VAL); |
---|
| 77 | ALLOC1_VALACK_OUT(out_RETIRE_ACK ,ACK); |
---|
| 78 | ALLOC1_SIGNAL_IN ( in_RETIRE_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id ); |
---|
| 79 | ALLOC1_SIGNAL_IN ( in_RETIRE_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); |
---|
[88] | 80 | // ALLOC1_SIGNAL_IN ( in_RETIRE_TYPE ,"type" ,Ttype_t ,_param->_size_type ); |
---|
| 81 | // ALLOC1_SIGNAL_IN ( in_RETIRE_OPERATION ,"operation" ,Toperation_t,_param->_size_operation ); |
---|
[97] | 82 | ALLOC1_SIGNAL_IN ( in_RETIRE_USE_STORE_QUEUE ,"use_store_queue" ,Tcontrol_t ,1); |
---|
| 83 | ALLOC1_SIGNAL_IN ( in_RETIRE_USE_LOAD_QUEUE ,"use_load_queue" ,Tcontrol_t ,1); |
---|
[78] | 84 | ALLOC1_SIGNAL_IN ( in_RETIRE_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); |
---|
| 85 | ALLOC1_SIGNAL_IN ( in_RETIRE_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); |
---|
| 86 | } |
---|
| 87 | |
---|
[88] | 88 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 89 | { |
---|
[78] | 90 | reg_STORE_QUEUE_PTR_WRITE = new Tlsq_ptr_t [_param->_nb_load_store_queue]; |
---|
| 91 | reg_STORE_QUEUE_USE = new bool * [_param->_nb_load_store_queue]; |
---|
| 92 | reg_STORE_QUEUE_NB_USE = new Tlsq_ptr_t [_param->_nb_load_store_queue]; |
---|
| 93 | reg_LOAD_QUEUE_PTR_WRITE = new Tlsq_ptr_t [_param->_nb_load_store_queue]; |
---|
| 94 | reg_LOAD_QUEUE_USE = new bool * [_param->_nb_load_store_queue]; |
---|
| 95 | |
---|
| 96 | for (uint32_t i=0; i<_param->_nb_load_store_queue; i++) |
---|
| 97 | { |
---|
| 98 | reg_STORE_QUEUE_USE [i] = new bool [_param->_size_store_queue [i]]; |
---|
| 99 | reg_LOAD_QUEUE_USE [i] = new bool [_param->_size_load_queue [i]]; |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | internal_INSERT_ACK = new Tcontrol_t [_param->_nb_inst_insert]; |
---|
| 103 | internal_INSERT_OPERATION_USE = new operation_use_t [_param->_nb_inst_insert]; |
---|
| 104 | internal_INSERT_LSQ = new uint32_t [_param->_nb_inst_insert]; |
---|
| 105 | internal_INSERT_PTR = new Tlsq_ptr_t [_param->_nb_inst_insert]; |
---|
| 106 | |
---|
| 107 | internal_RETIRE_ACK = new Tcontrol_t [_param->_nb_inst_retire]; |
---|
| 108 | internal_RETIRE_OPERATION_USE = new operation_use_t [_param->_nb_inst_retire]; |
---|
| 109 | internal_RETIRE_LSQ = new uint32_t [_param->_nb_inst_retire]; |
---|
| 110 | internal_RETIRE_PTR = new Tlsq_ptr_t [_param->_nb_inst_retire]; |
---|
[88] | 111 | } |
---|
| 112 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[78] | 113 | |
---|
| 114 | #ifdef POSITION |
---|
[88] | 115 | if (usage_is_set(_usage,USE_POSITION)) |
---|
| 116 | _component->generate_file(); |
---|
[78] | 117 | #endif |
---|
| 118 | |
---|
| 119 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End"); |
---|
| 120 | }; |
---|
| 121 | |
---|
| 122 | }; // end namespace load_store_pointer_unit |
---|
| 123 | }; // end namespace rename_unit |
---|
| 124 | }; // end namespace ooo_engine |
---|
| 125 | }; // end namespace multi_ooo_engine |
---|
| 126 | }; // end namespace core |
---|
| 127 | |
---|
| 128 | }; // end namespace behavioural |
---|
| 129 | }; // end namespace morpheo |
---|