Changeset 128 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Timestamp:
- Jun 26, 2009, 10:43:23 AM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Comparator/SelfTest/src/main.cpp
r113 r128 56 56 57 57 test (name,param); 58 59 delete param; 58 60 } 59 61 catch (morpheo::ErrorMorpheo & error) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h
r82 r128 5 5 * $Id$ 6 6 * 7 * [ 7 * [ Description ] 8 8 * 9 9 */ … … 18 18 19 19 // typedef uint32_t Taddress_t; 20 typedef uint32_t Tdata_t;20 typedef Tgeneral_data_t Tdata_t; 21 21 22 22 }; // end namespace registerfile_monolithic -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp
r111 r128 22 22 log_function(RegisterFile_Monolithic,FUNCTION,_name.c_str()); 23 23 24 if ( _param->_have_init_value and (PORT_READ(in_NRESET) == 0))24 if (PORT_READ(in_NRESET) == 0) 25 25 { 26 for (uint32_t i=0; i<_param->_nb_word; ++i) 27 reg_DATA[i] = fromString<Tdata_t>(_param->_init_value); 26 if (_param->_have_init_value) 27 { 28 for (uint32_t i=0; i<_param->_nb_word; ++i) 29 reg_DATA[i] = fromString<Tdata_t>(_param->_init_value); 30 } 31 else 32 { 33 for (uint32_t i=0; i<_param->_nb_word; ++i) 34 reg_DATA[i] = 0; 35 } 28 36 } 29 37 else … … 31 39 for (uint32_t i=0; i<_param->_nb_port_write; i++) 32 40 { 41 log_printf(TRACE,RegisterFile,FUNCTION," * WRITE [%d] : %d",i,PORT_READ(in_WRITE_VAL[i])); 42 33 43 // Have a write? 34 44 if ( PORT_READ(in_WRITE_VAL[i]) == true) … … 38 48 (*_stat_nb_write) ++; 39 49 #endif 40 50 41 51 Taddress_t address = (_param->_have_port_address)?PORT_READ(in_WRITE_ADDRESS[i]):0; 42 52 Tdata_t data = PORT_READ(in_WRITE_DATA [i]); 53 54 log_printf(TRACE,RegisterFile,FUNCTION," * address : %d",address); 55 log_printf(TRACE,RegisterFile,FUNCTION," * gloup"); 56 log_printf(TRACE,RegisterFile,FUNCTION," * data : %d",data); 43 57 44 58 log_printf(TRACE,RegisterFile,FUNCTION," * [%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 59 60 #ifdef DEBUG_TEST 61 if (address >= _param->_nb_word) 62 throw ERRORMORPHEO(FUNCTION,toString(_("Address (%d) is invalid (size : %d).\n"),address,_param->_nb_word)); 63 #endif 45 64 46 65 // Write in registerFile … … 50 69 for (uint32_t i=0; i<_param->_nb_port_read_write; i++) 51 70 { 71 log_printf(TRACE,RegisterFile,FUNCTION," * READ_WRITE [%d] : %d",i,PORT_READ(in_READ_WRITE_VAL[i])); 72 52 73 // Have a read_write? 53 74 if (PORT_READ(in_READ_WRITE_VAL[i]) == true) … … 65 86 log_printf(TRACE,RegisterFile,FUNCTION," * [%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 66 87 88 89 #ifdef DEBUG_TEST 90 if (address >= _param->_nb_word) 91 throw ERRORMORPHEO(FUNCTION,toString(_("Address (%d) is invalid (size : %d).\n"),address,_param->_nb_word)); 92 #endif 93 67 94 // Write in registerFile 68 95 reg_DATA[address] = data; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/Types.h
r82 r128 5 5 * $Id$ 6 6 * 7 * [ 7 * [ Description ] 8 8 * 9 9 */ … … 19 19 20 20 //typedef uint32_t Taddress_t; 21 typedef uint32_t Tdata_t;21 typedef Tgeneral_data_t Tdata_t; 22 22 23 23 }; // end namespace registerfile_multi_banked -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_transition.cpp
r124 r128 25 25 // call function pointer 26 26 // (this->*function_transition) (); 27 if ( _param->_have_init_value and (PORT_READ(in_NRESET) == 0))27 if (PORT_READ(in_NRESET) == 0) 28 28 { 29 for (uint32_t i=0; i<_param->_nb_bank; ++i) 30 for (uint32_t j=0; j<_param->_nb_word; ++j) 31 reg_DATA[i][j] = fromString<Tdata_t>(_param->_init_value); 29 if (_param->_have_init_value) 30 { 31 for (uint32_t i=0; i<_param->_nb_bank; ++i) 32 for (uint32_t j=0; j<_param->_nb_word; ++j) 33 reg_DATA[i][j] = fromString<Tdata_t>(_param->_init_value); 34 } 35 else 36 { 37 for (uint32_t i=0; i<_param->_nb_bank; ++i) 38 for (uint32_t j=0; j<_param->_nb_word; ++j) 39 reg_DATA[i][j] = 0; 40 } 32 41 } 33 42 else -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_deallocation.cpp
r81 r128 22 22 delete in_NRESET; 23 23 // ----- Interface Read 24 for (uint32_t i=0; i<_param->_nb_port_read; i++) 25 { 26 delete in_READ_VAL [i]; 27 delete out_READ_ACK [i]; 28 if (_param->_have_port_address == true) 29 delete in_READ_ADDRESS[i]; 30 delete out_READ_DATA [i]; 31 } 32 24 33 delete [] in_READ_VAL ; 25 34 delete [] out_READ_ACK ; … … 29 38 30 39 // ----- Interface Write 40 for (uint32_t i=0; i<_param->_nb_port_write; i++) 41 { 42 delete in_WRITE_VAL [i]; 43 delete out_WRITE_ACK [i]; 44 if (_param->_have_port_address == true) 45 delete in_WRITE_ADDRESS[i]; 46 delete in_WRITE_DATA [i]; 47 } 48 31 49 delete [] in_WRITE_VAL ; 32 50 delete [] out_WRITE_ACK ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Sort/src/Sort.cpp
r123 r128 71 71 if (usage_is_set(_usage,USE_SYSTEMC)) 72 72 { 73 # if defined(STATISTICS) or defined(VHDL_TESTBENCH) 73 74 log_printf(INFO,Sort,FUNCTION,"Method - transition"); 74 75 … … 77 78 sensitive << (*(in_CLOCK)).pos(); 78 79 79 # ifdef SYSTEMCASS_SPECIFIC80 # ifdef SYSTEMCASS_SPECIFIC 80 81 // List dependency information 81 # endif 82 # endif 83 # endif 82 84 83 85 log_printf(INFO,Sort,FUNCTION,"Method - genMealy"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Sort/src/Sort_transition.cpp
r81 r128 14 14 namespace generic { 15 15 namespace sort { 16 17 16 18 17 #undef FUNCTION -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h
r81 r128 47 47 public : entry_t () 48 48 { 49 _entry = NULL; 49 50 }; 50 51 public : entry_t (uint32_t size) : _size (size) … … 53 54 54 55 // initialisation 55 for (uint32_t i=0; i<size; i++) 56 _entry [i] = false; 56 reset (); 57 57 } 58 58 59 59 public : ~entry_t () 60 60 { 61 delete _entry; 61 if (_entry != NULL) 62 delete [] _entry; 63 } 64 65 public : void reset () 66 { 67 // initialisation 68 for (uint32_t i=0; i<_size; i++) 69 _entry [i] = false; 62 70 } 63 71 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_deallocation.cpp
r112 r128 29 29 DELETE1_SIGNAL(out_ACCESS_VICTIM ,_param->_nb_access,log2(_param->_nb_entity )); 30 30 31 DELETE1(reg_TABLE ,_param->_size_table); 31 for (uint32_t i=0; i<_param->_size_table; i++) 32 delete reg_TABLE [i]; 33 delete [] reg_TABLE; 34 32 35 DELETE1(internal_ACCESS_ACK ,_param->_nb_access); 33 36 DELETE1(internal_ACCESS_VICTIM,_param->_nb_access); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_genMealy.cpp
r123 r128 22 22 Taddress_t address = (_param->_size_table>1)?PORT_READ(in_ACCESS_ADDRESS[i]):0; 23 23 24 #ifdef DEBUG_TEST 25 if (address >= _param->_size_table) 26 throw ERRORMORPHEO(FUNCTION,toString(_("Address (%d) is invalid (size : %d).\n"),address,_param->_size_table)); 27 #endif 28 24 29 internal_ACCESS_VICTIM[i] = reg_TABLE[address]->access(); 25 30 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_transition.cpp
r123 r128 17 17 void Victim_Pseudo_LRU::transition (void) 18 18 { 19 for (uint32_t i=0; i<_param->_nb_access; i++) 19 20 if (PORT_READ(in_NRESET) == 0) 20 21 { 21 if (PORT_READ (in_ACCESS_VAL[i]) and internal_ACCESS_ACK) 22 { 23 Taddress_t address = (_param->_size_table>1)?PORT_READ(in_ACCESS_ADDRESS[i]):0; 24 Tentity_t entity = 0; 22 for (uint32_t i=0; i<_param->_size_table; ++i) 23 reg_TABLE[i]->reset(); 24 } 25 else 26 { 27 for (uint32_t i=0; i<_param->_nb_access; i++) 28 { 29 if (PORT_READ (in_ACCESS_VAL[i]) and internal_ACCESS_ACK) 30 { 31 Taddress_t address = (_param->_size_table>1)?PORT_READ(in_ACCESS_ADDRESS[i]):0; 32 Tentity_t entity = 0; 33 34 if (PORT_READ(in_ACCESS_HIT [i])) 35 { 36 // Hit : don't need a victim 37 // #ifdef STATISTICS 38 // _stat_nb_update ++; 39 // #endif 40 entity = PORT_READ(in_ACCESS_ENTITY[i]); 41 } 42 else 43 { 44 // Miss : need victim 45 // #ifdef STATISTICS 46 // _stat_nb_access ++; 47 // #endif 48 entity = internal_ACCESS_VICTIM[i]; 49 } 50 51 #ifdef DEBUG_TEST 52 if (address >= _param->_size_table) 53 throw ERRORMORPHEO(FUNCTION,toString(_("Address (%d) is invalid (size : %d).\n"),address, _param->_size_table)); 54 #endif 55 reg_TABLE[address]->update(entity); 56 } 57 }//end for i 58 } 25 59 26 if (PORT_READ(in_ACCESS_HIT [i]))27 {28 // Hit : don't need a victim29 // #ifdef STATISTICS30 // _stat_nb_update ++;31 // #endif32 entity = PORT_READ(in_ACCESS_ENTITY[i]);33 }34 else35 {36 // Miss : need victim37 // #ifdef STATISTICS38 // _stat_nb_access ++;39 // #endif40 entity = internal_ACCESS_VICTIM[i];41 }42 43 reg_TABLE[address]->update(entity);44 }45 }//end for i46 47 60 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) 48 61 end_cycle (); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/src/Victim_deallocation.cpp
r112 r128 38 38 delete in_NRESET; 39 39 40 for (uint32_t i=0; i<_param->_nb_access; ++i) 41 { 42 delete in_ACCESS_VAL [i]; 43 delete out_ACCESS_ACK [i]; 44 if (_param->_have_port_address) 45 delete in_ACCESS_ADDRESS[i]; 46 delete in_ACCESS_HIT [i]; 47 delete in_ACCESS_ENTITY [i]; 48 delete out_ACCESS_VICTIM [i]; 49 } 50 40 51 delete [] in_ACCESS_VAL ; 41 52 delete [] out_ACCESS_ACK ; … … 47 58 } 48 59 49 50 60 log_printf(FUNC,Victim,FUNCTION,"End"); 51 61 };
Note: See TracChangeset
for help on using the changeset viewer.