- Timestamp:
- Mar 21, 2007, 5:00:06 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/Parameters_msg_error.cpp
r2 r6 39 39 { 40 40 msg += " - nb_word must be >= 2\n"; 41 msg += 41 msg += " * nb_word : " + toString(_nb_word) + "\n"; 42 42 } 43 43 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile.cpp
r2 r6 53 53 sensitive_neg << *(in_CLOCK); 54 54 for (uint32_t i=0; i<_param._nb_port_read; i++) 55 sensitive << *(in_READ_ ENABLE[i])55 sensitive << *(in_READ_VAL [i]) 56 56 << *(in_READ_ADDRESS [i]); 57 57 … … 60 60 for (uint32_t i=0; i<_param._nb_port_read; i++) 61 61 { 62 (*(out_READ_DATA [i])) (*( in_READ_ ENABLE[i]));62 (*(out_READ_DATA [i])) (*( in_READ_VAL [i])); 63 63 (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i])); 64 64 } 65 65 #endif 66 67 for (uint32_t i=0; i<_param._nb_port_read ; i++) 68 PORT_WRITE(out_READ_ACK [i], 1); 69 for (uint32_t i=0; i<_param._nb_port_write; i++) 70 PORT_WRITE(out_WRITE_ACK [i], 1); 66 71 #endif 67 72 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_allocation.cpp
r2 r6 16 16 void RegisterFile::allocation (void) 17 17 { 18 in_CLOCK = new SC_CLOCK ("in_CLOCK"); 18 in_CLOCK = new SC_CLOCK ("in_CLOCK"); 19 in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET"); 19 20 20 21 // ----- Interface Read 21 in_READ_ENABLE = new SC_IN (Tcontrol_t) * [_param._nb_port_read]; 22 in_READ_VAL = new SC_IN (Tcontrol_t) * [_param._nb_port_read]; 23 out_READ_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_port_read]; 22 24 in_READ_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_port_read]; 23 25 out_READ_DATA = new SC_OUT(Tdata_t ) * [_param._nb_port_read]; … … 27 29 string rename; 28 30 29 rename = "in_READ_ENABLE[" + toString(i) + "]"; 30 in_READ_ENABLE [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 31 rename = "in_READ_VAL[" + toString(i) + "]"; 32 in_READ_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 33 34 rename = "out_READ_ACK[" + toString(i) + "]"; 35 out_READ_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 31 36 32 37 rename = "in_READ_ADDRESS[" + toString(i) + "]"; … … 38 43 39 44 // ----- Interface Write 40 in_WRITE_ENABLE = new SC_IN (Tcontrol_t) * [_param._nb_port_write]; 45 in_WRITE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_port_write]; 46 out_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_port_write]; 41 47 in_WRITE_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_port_write]; 42 48 in_WRITE_DATA = new SC_IN (Tdata_t ) * [_param._nb_port_write]; … … 46 52 string rename; 47 53 48 rename = "in_WRITE_ENABLE[" + toString(i) + "]"; 49 in_WRITE_ENABLE [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 54 rename = "in_WRITE_VAL[" + toString(i) + "]"; 55 in_WRITE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); 56 57 rename = "out_WRITE_VAL[" + toString(i) + "]"; 58 out_WRITE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); 50 59 51 60 rename = "in_WRITE_ADDRESS[" + toString(i) + "]"; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_deallocation.cpp
r2 r6 17 17 { 18 18 delete in_CLOCK; 19 19 delete in_NRESET; 20 20 // ----- Interface Read 21 21 for (uint32_t i=0; i<_param._nb_port_read; i++) 22 22 { 23 delete in_READ_ENABLE [i]; 24 delete in_READ_ADDRESS [i]; 25 delete out_READ_DATA [i]; 23 delete in_READ_VAL [i]; 24 delete out_READ_ACK [i]; 25 delete in_READ_ADDRESS [i]; 26 delete out_READ_DATA [i]; 26 27 } 27 28 28 delete in_READ_ENABLE ; 29 delete in_READ_VAL ; 30 delete out_READ_ACK ; 29 31 delete in_READ_ADDRESS; 30 32 delete out_READ_DATA ; … … 33 35 for (uint32_t i=0; i<_param._nb_port_write; i++) 34 36 { 35 delete in_WRITE_ENABLE [i]; 36 delete in_WRITE_ADDRESS [i]; 37 delete in_WRITE_DATA [i]; 37 delete in_WRITE_VAL [i]; 38 delete out_WRITE_ACK [i]; 39 delete in_WRITE_ADDRESS [i]; 40 delete in_WRITE_DATA [i]; 38 41 } 39 42 40 delete in_WRITE_ENABLE ; 41 delete in_WRITE_ADDRESS; 42 delete in_WRITE_DATA ; 43 delete in_WRITE_VAL ; 44 delete out_WRITE_ACK ; 45 delete in_WRITE_ADDRESS; 46 delete in_WRITE_DATA ; 43 47 44 48 // ----- Register -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_genMealy_read.cpp
r3 r6 25 25 { 26 26 // Have a write? 27 if ( PORT_READ(in_READ_ ENABLE[i]) == 1)27 if ( PORT_READ(in_READ_VAL [i]) == 1) 28 28 { 29 29 Taddress_t address = PORT_READ(in_READ_ADDRESS[i]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_transition.cpp
r3 r6 24 24 { 25 25 // Have a write? 26 if ( PORT_READ(in_WRITE_ ENABLE[i]) == true)26 if ( PORT_READ(in_WRITE_VAL[i]) == true) 27 27 { 28 28 #ifdef STATISTICS -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_vhdl_body.cpp
r2 r6 23 23 24 24 for (uint32_t i = 0; i < _param._nb_port_read; i++) 25 vhdl.set_body ("out_READ_DATA_"+toString(i)+" <= reg_DATA (conv_integer(in_READ_ADDRESS_"+toString(i)+")) when in_READ_ENABLE_"+toString(i)+" = '1' else "+std_logic_others(_param._size_word,0)+";"); 26 25 { 26 vhdl.set_body ("out_READ_ACK_"+toString(i)+" <= '1';"); 27 vhdl.set_body ("out_READ_DATA_"+toString(i)+" <= reg_DATA (conv_integer(in_READ_ADDRESS_"+toString(i)+")) when in_READ_VAL_"+toString(i)+" = '1' else "+std_logic_others(_param._size_word,0)+";"); 28 } 27 29 vhdl.set_body (""); 28 30 vhdl.set_body ("-----------------------------------------------------------------------------"); … … 37 39 for (uint32_t i = 0; i < _param._nb_port_write; i++) 38 40 { 39 vhdl.set_body ("\t\tif (in_WRITE_ ENABLE_"+toString(i)+" = '1') then");41 vhdl.set_body ("\t\tif (in_WRITE_VAL_"+toString(i)+" = '1') then"); 40 42 vhdl.set_body ("\t\t\treg_DATA(conv_integer(in_WRITE_ADDRESS_"+toString(i)+")) <= in_WRITE_DATA_"+toString(i)+";"); 41 43 vhdl.set_body ("\t\tend if;"); … … 44 46 vhdl.set_body ("\tend if;"); 45 47 vhdl.set_body ("end process RegisterFile_write;"); 48 49 for (uint32_t i = 0; i < _param._nb_port_write; i++) 50 vhdl.set_body ("out_WRITE_ACK_"+toString(i)+"<= '1';"); 46 51 }; 47 52 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_vhdl_port.cpp
r2 r6 16 16 void RegisterFile::vhdl_port (Vhdl & vhdl) 17 17 { 18 vhdl.set_port ("in_CLOCK", IN, "std_logic"); 18 vhdl.set_port ("in_CLOCK" , IN, 1); 19 vhdl.set_port ("in_NRESET", IN, 1); 19 20 20 21 for (uint32_t i = 0; i < _param._nb_port_read; i ++) 21 22 { 22 vhdl.set_port (" in_READ_ENABLE_"+toString(i)+" ",IN ,std_logic(1) ); 23 vhdl.set_port (" in_READ_VAL_"+toString(i)+" ",IN ,std_logic(1) ); 24 vhdl.set_port ("out_READ_ACK_"+toString(i)+" ",OUT,std_logic(1) ); 23 25 vhdl.set_port (" in_READ_ADDRESS_"+toString(i)+"",IN ,std_logic(static_cast<uint32_t>(log2(_param._nb_word)))); 24 26 vhdl.set_port ("out_READ_DATA_"+toString(i)+" ",OUT,std_logic(_param._size_word )); … … 27 29 for (uint32_t i = 0; i < _param._nb_port_write; i ++) 28 30 { 29 vhdl.set_port (" in_WRITE_ENABLE_"+toString(i)+" ",IN ,std_logic(1) ); 31 vhdl.set_port (" in_WRITE_VAL_"+toString(i)+" ",IN ,std_logic(1) ); 32 vhdl.set_port ("out_WRITE_ACK_"+toString(i)+" ",OUT,std_logic(1) ); 30 33 vhdl.set_port (" in_WRITE_ADDRESS_"+toString(i)+"",IN ,std_logic(static_cast<uint32_t>(log2(_param._nb_word)))); 31 34 vhdl.set_port (" in_WRITE_DATA_"+toString(i)+" ",IN ,std_logic(_param._size_word )); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_vhdl_testbench_port.cpp
r2 r6 16 16 void RegisterFile::vhdl_testbench_port (Vhdl_Testbench & vhdl_testbench) 17 17 { 18 vhdl_testbench.set_port (" in_NRESET",IN ,1); 19 18 20 for (uint32_t i = 0; i < _param._nb_port_read; i ++) 19 21 { 20 vhdl_testbench.set_port (" in_READ_ENABLE_"+toString(i)+" ",IN ,1); 22 vhdl_testbench.set_port (" in_READ_VAL_"+toString(i)+" ",IN ,1); 23 vhdl_testbench.set_port ("out_READ_ACK_"+toString(i)+" ",OUT,1); 21 24 vhdl_testbench.set_port (" in_READ_ADDRESS_"+toString(i)+"",IN ,static_cast<uint32_t>(log2(_param._nb_word))); 22 25 vhdl_testbench.set_port ("out_READ_DATA_"+toString(i)+" ",OUT,_param._size_word); … … 25 28 for (uint32_t i = 0; i < _param._nb_port_write; i ++) 26 29 { 27 vhdl_testbench.set_port (" in_WRITE_ENABLE_"+toString(i)+" ",IN ,1); 30 vhdl_testbench.set_port (" in_WRITE_VAL_"+toString(i)+" ",IN ,1); 31 vhdl_testbench.set_port ("out_WRITE_ACK_"+toString(i)+" ",OUT,1); 28 32 vhdl_testbench.set_port (" in_WRITE_ADDRESS_"+toString(i)+"",IN ,static_cast<uint32_t>(log2(_param._nb_word))); 29 33 vhdl_testbench.set_port (" in_WRITE_DATA_"+toString(i)+" ",IN ,_param._size_word ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_vhdl_testbench_transition.cpp
r2 r6 19 19 sc_cycle(0); 20 20 #endif 21 vhdl_testbench.add_input (PORT_READ( in_NRESET)); 21 22 22 23 for (uint32_t i = 0; i < _param._nb_port_read ; i ++) 23 24 { 24 vhdl_testbench.add_input (PORT_READ( in_READ_ENABLE [i])); 25 vhdl_testbench.add_input (PORT_READ( in_READ_VAL [i])); 26 vhdl_testbench.add_output(PORT_READ(out_READ_ACK [i])); 25 27 vhdl_testbench.add_input (PORT_READ( in_READ_ADDRESS [i])); 28 vhdl_testbench.add_output(PORT_READ(out_READ_DATA [i])); 26 29 } 27 30 for (uint32_t i = 0; i < _param._nb_port_write; i ++) 28 31 { 29 vhdl_testbench.add_input (PORT_READ( in_WRITE_ENABLE [i])); 32 vhdl_testbench.add_input (PORT_READ( in_WRITE_VAL [i])); 33 vhdl_testbench.add_output(PORT_READ(out_WRITE_ACK [i])); 30 34 vhdl_testbench.add_input (PORT_READ( in_WRITE_ADDRESS[i])); 31 35 vhdl_testbench.add_input (PORT_READ( in_WRITE_DATA [i])); 32 }33 for (uint32_t i = 0; i < _param._nb_port_read ; i ++)34 {35 vhdl_testbench.add_output(PORT_READ(out_READ_DATA [i]));36 36 } 37 37
Note: See TracChangeset
for help on using the changeset viewer.