Changeset 112 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_allocation.cpp
- Timestamp:
- Mar 18, 2009, 11:36:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_allocation.cpp
r88 r112 7 7 8 8 #include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h" 9 #include "Behavioural/include/Allocation.h" 9 10 10 11 namespace morpheo { … … 36 37 ,IN 37 38 ,SOUTH, 38 "Generalist interface"39 _("Generalist interface") 39 40 #endif 40 41 ); … … 43 44 in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); 44 45 45 // ~~~~~[ Interface : "read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 46 // ~~~~~[ Interface : "read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 47 { 48 ALLOC1_INTERFACE_BEGIN("read",IN,WEST,_("Interface Read"),_param->_nb_port_read); 46 49 47 in_READ_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_port_read]; 48 out_READ_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read]; 49 if (_param->_have_port_address == true) 50 in_READ_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_read]; 51 out_READ_DATA = new SC_OUT(Tdata_t ) * [_param->_nb_port_read]; 50 ALLOC1_VALACK_IN ( in_READ_VAL ,VAL); 51 ALLOC1_VALACK_OUT(out_READ_ACK ,ACK); 52 ALLOC1_SIGNAL_IN ( in_READ_ADDRESS,"address",Taddress_t, _param->_size_address); 53 ALLOC1_SIGNAL_OUT(out_READ_DATA ,"data" ,Tdata_t , _param->_size_word); 52 54 53 for (uint32_t i=0; i<_param->_nb_port_read; i++) 54 { 55 Interface_fifo * interface = _interfaces->set_interface("read_"+toString(i) 56 #ifdef POSITION 57 , IN 58 ,WEST 59 , "Interface Read" 60 #endif 61 ); 55 ALLOC1_INTERFACE_END(_param->_nb_port_read); 56 } 57 58 // ~~~~~[ Interface : "write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 { 60 ALLOC1_INTERFACE_BEGIN("write",IN,EAST,_("Interface Write"),_param->_nb_port_write); 62 61 63 in_READ_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 64 out_READ_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 65 if (_param->_have_port_address == true) 66 in_READ_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(log2(_param->_nb_word))); 67 out_READ_DATA [i] = interface->set_signal_out <Tdata_t > ("data" , _param->_size_word); 68 } 62 ALLOC1_VALACK_IN ( in_WRITE_VAL ,VAL); 63 ALLOC1_VALACK_OUT(out_WRITE_ACK ,ACK); 64 ALLOC1_SIGNAL_IN ( in_WRITE_ADDRESS,"address",Taddress_t,_param->_size_address); 65 ALLOC1_SIGNAL_IN ( in_WRITE_DATA ,"data" ,Tdata_t ,_param->_size_word); 69 66 70 // ~~~~~[ Interface : "write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 72 in_WRITE_VAL = new SC_IN (Tcontrol_t) * [_param->_nb_port_write]; 73 out_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param->_nb_port_write]; 74 if (_param->_have_port_address == true) 75 in_WRITE_ADDRESS = new SC_IN (Taddress_t) * [_param->_nb_port_write]; 76 in_WRITE_DATA = new SC_IN (Tdata_t ) * [_param->_nb_port_write]; 77 78 for (uint32_t i=0; i<_param->_nb_port_write; i++) 79 { 80 Interface_fifo * interface = _interfaces->set_interface("write_"+toString(i) 81 #ifdef POSITION 82 , IN 83 ,EAST 84 , "Interface Write" 85 #endif 86 ); 87 88 in_WRITE_VAL [i] = interface->set_signal_valack_in ("val" , VAL); 89 out_WRITE_ACK [i] = interface->set_signal_valack_out ("ack" , ACK); 90 if (_param->_have_port_address == true) 91 in_WRITE_ADDRESS [i] = interface->set_signal_in <Taddress_t> ("address", static_cast<uint32_t>(log2(_param->_nb_word))); 92 in_WRITE_DATA [i] = interface->set_signal_in <Tdata_t > ("data" , _param->_size_word); 67 ALLOC1_INTERFACE_END(_param->_nb_port_write); 93 68 } 94 69 95 70 if (usage_is_set(_usage,USE_SYSTEMC)) 96 71 { 97 // ~~~~~[ Registers ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 // ~~~~~[ Registers ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 ALLOC2(reg_DATA,Tdata_t,_param->_nb_bank,_param->_nb_word); 98 74 99 reg_DATA = new Tdata_t * [_param->_nb_bank]; 100 101 for (uint32_t i=0; i<_param->_nb_bank; i++) 102 { 103 reg_DATA [i] = new Tdata_t [_param->_nb_word]; 104 } 105 106 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 107 internal_WRITE_VAL = new bool [_param->_nb_port_write]; 108 internal_WRITE_BANK = new Taddress_t [_param->_nb_port_write]; 109 internal_WRITE_NUM_REG = new Taddress_t [_param->_nb_port_write]; 75 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 ALLOC1(internal_WRITE_VAL ,bool ,_param->_nb_port_write); 77 ALLOC1(internal_WRITE_BANK ,Taddress_t,_param->_nb_port_write); 78 ALLOC1(internal_WRITE_NUM_REG,Taddress_t,_param->_nb_port_write); 110 79 } 111 80 112 81 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 113 114 82 #ifdef POSITION 115 83 if (usage_is_set(_usage,USE_POSITION)) 116 84 _component->generate_file(); 117 85 #endif 118 86 119 87 log_printf(FUNC,RegisterFile_Multi_Banked,"allocation","End"); 120 88 };
Note: See TracChangeset
for help on using the changeset viewer.