Changeset 3 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Timestamp:
- Mar 6, 2007, 3:34:04 PM (18 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_genMealy.cpp
r2 r3 21 21 for (uint32_t i=0; i<_param._nb_port; i++) 22 22 { 23 Tdata_t data = PORT_READ(in_COUNTER_DATA [i]); 23 Tcontrol_t addsub = PORT_READ(in_COUNTER_ADDSUB [i]); 24 Tdata_t data_in = PORT_READ(in_COUNTER_DATA [i]); 25 Tdata_t data_out= data_in; 26 log_printf(TRACE,Counter,"genMealy","before : %d %s = %d",data_in,((addsub==1)?"++":"--"),data_out); 24 27 25 28 // Staturate counter 26 if ( PORT_READ(in_COUNTER_ADDSUB [i])== 1)29 if (addsub == 1) 27 30 { 28 if (data < _param._data_max)29 data 31 if (data_out < _param._data_max) 32 data_out++; 30 33 } 31 34 else 32 35 { 33 if (data > 0)34 data 36 if (data_out > 0) 37 data_out--; 35 38 } 36 39 37 PORT_WRITE(out_COUNTER_DATA[i], data); 40 log_printf(TRACE,Counter,"genMealy","after : %d %s = %d",data_in,((addsub==1)?"++":"--"),data_out); 41 42 PORT_WRITE(out_COUNTER_DATA[i], data_out); 38 43 } 39 44 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters_print.cpp
r2 r3 7 7 8 8 #include "Behavioural/Generic/Counter/include/Parameters.h" 9 #include <sstream>9 #include "Behavioural/include/XML.h" 10 10 using namespace std; 11 11 … … 20 20 log_printf(FUNC,Counter,"print","Begin"); 21 21 22 string tab = string(depth,'\t'); 23 ostringstream msg; 24 msg << tab << "<counter>" << endl 25 << tab << "\t<size_data value=\"" << _size_data << "\" />" << endl 26 << tab << "\t<nb_port value=\"" << _nb_port << "\" />" << endl 27 << tab << "</counter>" << endl; 22 XML xml ("counter"); 23 24 xml.balise_open("counter"); 25 xml. singleton_begin("size_data"); 26 xml. attribut("value",toString(_size_data)); 27 xml. singleton_end(); 28 xml. singleton_begin("nb_port "); 29 xml. attribut("value",toString(_nb_port)); 30 xml. singleton_end(); 31 xml.balise_close(); 28 32 29 33 log_printf(FUNC,Counter,"print","End"); 30 34 31 return msg.str();35 return xml.get_body(depth); 32 36 }; 33 37 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_genMealy_read.cpp
r2 r3 27 27 if ( PORT_READ(in_READ_ENABLE[i]) == 1) 28 28 { 29 log_printf(TRACE,Register_File,"genMealy_read","Read [%d] : Have transaction, Reg[%d] -> %x",i,PORT_READ(in_READ_ADDRESS[i]),REGISTER_READ(reg_DATA[PORT_READ(in_READ_ADDRESS[i])])); 29 Taddress_t address = PORT_READ(in_READ_ADDRESS[i]); 30 Tdata_t data = REGISTER_READ(reg_DATA[address]); 31 32 log_printf(TRACE,Register_File,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 33 30 34 #ifdef STATISTICS 31 35 _stat_nb_read ++; 32 36 #endif 33 37 // Write in registerFile 34 PORT_WRITE(out_READ_DATA[i], REGISTER_READ(reg_DATA[PORT_READ(in_READ_ADDRESS[i])]));38 PORT_WRITE(out_READ_DATA[i],data); 35 39 } 36 40 else -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_transition.cpp
r2 r3 26 26 if ( PORT_READ(in_WRITE_ENABLE[i]) == true) 27 27 { 28 log_printf(TRACE,Register_File,"transition","Write [%d] : Have transaction, Reg[%d] <- %x",i,PORT_READ(in_WRITE_ADDRESS[i]),PORT_READ(in_WRITE_DATA [i]));29 30 28 #ifdef STATISTICS 31 29 _stat_nb_write ++; … … 35 33 Tdata_t data = PORT_READ(in_WRITE_DATA [i]); 36 34 35 log_printf(TRACE,Register_File,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 36 37 37 // Write in registerFile 38 38 REGISTER_WRITE(reg_DATA[address],data);
Note: See TracChangeset
for help on using the changeset viewer.