Changeset 57 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src
- Timestamp:
- Sep 28, 2007, 2:58:08 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp
r42 r57 15 15 16 16 17 Select_Priority_Fixed::Select_Priority_Fixed 18 ( 17 19 #ifdef SYSTEMC 18 Select_Priority_Fixed::Select_Priority_Fixed (sc_module_name name,20 sc_module_name name, 19 21 #else 20 Select_Priority_Fixed::Select_Priority_Fixed (string name,22 string name, 21 23 #endif 22 24 #ifdef STATISTICS 23 morpheo::behavioural::Parameters_Statisticsparam_statistics,25 morpheo::behavioural::Parameters_Statistics * param_statistics, 24 26 #endif 25 morpheo::behavioural::generic::select::select_priority_fixed::Parameters param ): 26 _name (name) 27 ,_param (param) 27 morpheo::behavioural::generic::select::select_priority_fixed::Parameters * param, 28 morpheo::behavioural::Tusage_t usage ): 29 _name (name), 30 _param (param), 31 _usage (usage) 28 32 // #ifdef STATISTICS 29 33 // ,_param_statistics (param_statistics) … … 32 36 log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin"); 33 37 34 #ifdef SYSTEMC35 38 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation"); 36 37 39 allocation (); 38 #endif39 40 40 41 #ifdef STATISTICS … … 55 56 56 57 #ifdef SYSTEMC 57 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 58 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition"); 59 60 SC_METHOD (transition); 61 dont_initialize (); 62 sensitive_pos << *(in_CLOCK); 63 #endif 64 65 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity"); 66 67 SC_METHOD (genMealy_entity); 68 dont_initialize (); 69 //sensitive_pos << *(in_CLOCK); 70 for (uint32_t i=0; i<_param._nb_entity; i++) 71 sensitive << *(in_VAL [i]); 72 58 if (_usage & USE_SYSTEMC) 59 { 60 # if defined(STATISTICS) or defined(VHDL_TESTBENCH) 61 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition"); 62 63 SC_METHOD (transition); 64 dont_initialize (); 65 sensitive_pos << *(in_CLOCK); 66 # endif 67 68 log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity"); 69 70 SC_METHOD (genMealy_entity); 71 dont_initialize (); 72 //sensitive_pos << *(in_CLOCK); 73 for (uint32_t i=0; i<_param->_nb_entity; i++) 74 sensitive << *(in_VAL [i]); 75 73 76 # ifdef SYSTEMCASS_SPECIFIC 74 // List dependency information 75 76 for (uint32_t i=0; i<_param._nb_entity; i++) 77 { 78 if (_param._encoding_one_hot) 79 (*(out_ACK [i])) (*(in_VAL [i])); 80 if (_param._encoding_compact) 77 // List dependency information 78 79 for (uint32_t i=0; i<_param->_nb_entity; i++) 81 80 { 82 (*(out_ENTITY )) (*(in_VAL [i])); 83 (*(out_ENTITY_ACK)) (*(in_VAL [i])); 81 if (_param->_encoding_one_hot) 82 (*(out_ACK [i])) (*(in_VAL [i])); 83 if (_param->_encoding_compact) 84 { 85 (*(out_ENTITY )) (*(in_VAL [i])); 86 (*(out_ENTITY_ACK)) (*(in_VAL [i])); 87 } 84 88 } 89 90 # endif 85 91 } 86 87 # endif88 92 #endif 89 93 log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp
r42 r57 19 19 log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin"); 20 20 21 _component = new Component ( );21 _component = new Component (_usage); 22 22 23 23 Entity * entity = _component->set_entity (_name 24 ,"Select_Priority_Fixed" 24 25 #ifdef POSITION 25 ,"Select_Priority_Fixed"26 26 ,COMBINATORY 27 27 #endif … … 41 41 42 42 in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_NO); 43 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1); 44 in_VAL = new SC_IN (Tcontrol_t) * [_param._nb_entity]; 45 if (_param._encoding_one_hot) 46 out_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_entity]; 43 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_NO); 47 44 48 for (uint32_t i=0; i<_param._nb_entity; i++) 45 in_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_entity]; 46 if (_param->_encoding_one_hot) 47 out_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_entity]; 48 49 for (uint32_t i=0; i<_param->_nb_entity; i++) 49 50 { 50 51 in_VAL [i] = interface->set_signal_in <Tcontrol_t> ("val_"+toString(i),1); 51 if (_param ._encoding_one_hot)52 if (_param->_encoding_one_hot) 52 53 out_ACK [i] = interface->set_signal_out <Tcontrol_t> ("ack_"+toString(i),1); 53 54 } 54 55 55 if (_param ._encoding_compact)56 if (_param->_encoding_compact) 56 57 { 57 out_ENTITY = interface->set_signal_out <Tentity_t > ("entity" , _param ._size_entity);58 out_ENTITY = interface->set_signal_out <Tentity_t > ("entity" , _param->_size_entity); 58 59 out_ENTITY_ACK = interface->set_signal_out <Tcontrol_t> ("entity_ack", 1); 59 60 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_deallocation.cpp
r42 r57 20 20 log_printf(FUNC,Select_Priority_Fixed,"deallocation","Begin"); 21 21 22 delete in_CLOCK; 23 delete in_NRESET; 24 25 delete [] in_VAL; 26 if (_param._encoding_one_hot) 27 delete [] out_ACK; 28 29 if (_param._encoding_compact) 22 if (_usage & USE_SYSTEMC) 30 23 { 31 delete out_ENTITY; 32 delete out_ENTITY_ACK; 24 delete in_CLOCK; 25 delete in_NRESET; 26 27 delete [] in_VAL; 28 if (_param->_encoding_one_hot) 29 delete [] out_ACK; 30 31 if (_param->_encoding_compact) 32 { 33 delete out_ENTITY; 34 delete out_ENTITY_ACK; 35 } 33 36 } 34 37 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 35 38 36 39 delete _component; 37 40 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_genMealy_entity.cpp
r40 r57 22 22 // init 23 23 24 Tcontrol_t ack [_param ._nb_entity];24 Tcontrol_t ack [_param->_nb_entity]; 25 25 bool find = false; 26 26 Tentity_t entity; 27 27 28 if (_param ._encoding_one_hot)29 for (uint32_t i=0; i<_param ._nb_entity; i++)28 if (_param->_encoding_one_hot) 29 for (uint32_t i=0; i<_param->_nb_entity; i++) 30 30 ack [i] = 0; 31 31 32 32 log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Scearch..."); 33 for (entity=0; entity<_param ._nb_entity; entity++)33 for (entity=0; entity<_param->_nb_entity; entity++) 34 34 { 35 35 if (PORT_READ(in_VAL [entity]) == 1) 36 36 { 37 37 log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Find! entity %d",entity); 38 if (_param ._encoding_one_hot)38 if (_param->_encoding_one_hot) 39 39 ack [entity] = 1; 40 40 find = true; … … 44 44 45 45 // Write port 46 if (_param ._encoding_one_hot)47 for (uint32_t i=0; i<_param ._nb_entity; i++)46 if (_param->_encoding_one_hot) 47 for (uint32_t i=0; i<_param->_nb_entity; i++) 48 48 PORT_WRITE(out_ACK [i], ack [i]); 49 49 50 if (_param ._encoding_compact)50 if (_param->_encoding_compact) 51 51 { 52 52 PORT_WRITE(out_ENTITY , (find==true)?entity:0); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_body.cpp
r29 r57 22 22 23 23 vhdl->set_body("internal_entity <="); 24 for (uint32_t i=0; i<_param ._nb_entity; i++)24 for (uint32_t i=0; i<_param->_nb_entity; i++) 25 25 { 26 vhdl->set_body("\t"+std_logic_conv(_param ._size_entity+1,i)+" when in_VAL_"+toString(i)+"='1' else");26 vhdl->set_body("\t"+std_logic_conv(_param->_size_entity+1,i)+" when in_VAL_"+toString(i)+"='1' else"); 27 27 } 28 vhdl->set_body("\t"+std_logic_conv(_param ._size_entity+1,1<<_param._size_entity)+";");28 vhdl->set_body("\t"+std_logic_conv(_param->_size_entity+1,1<<_param->_size_entity)+";"); 29 29 vhdl->set_body (""); 30 30 31 if (_param ._encoding_one_hot)31 if (_param->_encoding_one_hot) 32 32 { 33 for (uint32_t i=0; i<_param ._nb_entity; i++)34 vhdl->set_body("out_ACK_"+toString(i)+" <= '1' when internal_entity"+std_logic_range(_param ._size_entity+1)+" = "+std_logic_conv(_param._size_entity+1,i)+" else '0';");33 for (uint32_t i=0; i<_param->_nb_entity; i++) 34 vhdl->set_body("out_ACK_"+toString(i)+" <= '1' when internal_entity"+std_logic_range(_param->_size_entity+1)+" = "+std_logic_conv(_param->_size_entity+1,i)+" else '0';"); 35 35 vhdl->set_body (""); 36 36 } 37 37 38 if (_param ._encoding_compact)38 if (_param->_encoding_compact) 39 39 { 40 vhdl->set_body ("out_ENTITY <= internal_entity"+std_logic_range(_param ._size_entity-1, 0)+";");41 vhdl->set_body ("out_ENTITY_ACK <= not internal_entity"+std_logic_range(_param ._size_entity ,_param._size_entity)+";");40 vhdl->set_body ("out_ENTITY <= internal_entity"+std_logic_range(_param->_size_entity-1, 0)+";"); 41 vhdl->set_body ("out_ENTITY_ACK <= not internal_entity"+std_logic_range(_param->_size_entity ,_param->_size_entity)+";"); 42 42 } 43 43 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_declaration.cpp
r29 r57 20 20 log_printf(FUNC,Select_Priority_Fixed,"vhdl_declaration","Begin"); 21 21 22 vhdl->set_signal("internal_entity",_param ._size_entity+1);22 vhdl->set_signal("internal_entity",_param->_size_entity+1); 23 23 24 24 log_printf(FUNC,Select_Priority_Fixed,"vhdl_declaration","End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Statistics.cpp
r15 r57 17 17 18 18 Statistics::Statistics (string name , 19 morpheo::behavioural::Parameters_Statistics parameters_statistics ,20 Parameters parameters19 morpheo::behavioural::Parameters_Statistics * parameters_statistics , 20 Parameters * parameters 21 21 ) : 22 22 morpheo::behavioural::Statistics(name ,
Note: See TracChangeset
for help on using the changeset viewer.