Changeset 101 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Timestamp:
- Jan 15, 2009, 6:19:08 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_min.cfg
r100 r101 3 3 1 1 *2 #_size_data 4 4 0 1 +1 #_nb_port_slot 5 0 0 +1 #_have_port_write 6 0 0 +1 #_have_port_read -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_size_queue_log2.cfg
r100 r101 3 3 32 32 *2 #_size_data 4 4 0 0 *2 #_nb_port_slot 5 1 1 +1 #_have_port_write 6 1 1 +1 #_have_port_read -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_size_queue_no_log2.cfg
r100 r101 3 3 32 32 *2 #_size_data 4 4 0 0 *2 #_nb_port_slot 5 1 1 +1 #_have_port_write 6 1 1 +1 #_have_port_read -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_slot_out_size_queue_log2.cfg
r100 r101 3 3 32 32 *2 #_size_data 4 4 1 8 *2 #_nb_port_slot 5 1 1 +1 #_have_port_write 6 1 1 +1 #_have_port_read -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/config_slot_out_size_queue_no_log2.cfg
r100 r101 3 3 32 32 *2 #_size_data 4 4 1 8 *2 #_nb_port_slot 5 1 1 +1 #_have_port_write 6 1 1 +1 #_have_port_read -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/main.cpp
r100 r101 8 8 #include "Behavioural/Generic/Queue/SelfTest/include/test.h" 9 9 10 #define NB_PARAMS 310 #define NB_PARAMS 5 11 11 12 12 void usage (int argc, char * argv[]) … … 14 14 cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl 15 15 << "list_params is :" << endl 16 << " - size_queue (uint32_t)" << endl 17 << " - size_data (uint32_t)" << endl 18 << " - nb_port_slot (uint32_t)" << endl 16 << " - size_queue (uint32_t)" << endl 17 << " - size_data (uint32_t)" << endl 18 << " - nb_port_slot (uint32_t)" << endl 19 << " - have_port_write (bool )" << endl 20 << " - have_port_read (bool )" << endl 19 21 << "" << endl; 20 22 … … 37 39 uint32_t x = 1; 38 40 39 const string name = argv[x++]; 40 const uint32_t size_queue = atoi(argv[x++]); 41 const uint32_t size_data = atoi(argv[x++]); 42 const uint32_t nb_port_slot = atoi(argv[x++]); 43 41 const string name = argv[x++]; 42 const uint32_t size_queue = fromString<uint32_t>(argv[x++]); 43 const uint32_t size_data = fromString<uint32_t>(argv[x++]); 44 const uint32_t nb_port_slot = fromString<uint32_t>(argv[x++]); 45 const bool have_port_write = fromString<bool>(argv[x++]); 46 const bool have_port_read = fromString<bool>(argv[x++]); 44 47 try 45 48 { … … 47 50 (size_queue, 48 51 size_data , 49 nb_port_slot 52 nb_port_slot, 53 have_port_write, 54 have_port_read 50 55 ); 51 56 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/test.cpp
r100 r101 58 58 ALLOC1_SC_SIGNAL(out_SLOT_VAL ,"out_SLOT_VAL" ,Tcontrol_t,_param->_nb_port_slot); 59 59 ALLOC1_SC_SIGNAL(out_SLOT_DATA ,"out_SLOT_DATA" ,Tdata_t ,_param->_nb_port_slot); 60 ALLOC0_SC_SIGNAL(out_PTR_WRITE ,"out_PTR_WRITE" ,Tptr_t ); 61 ALLOC0_SC_SIGNAL(out_PTR_READ ,"out_PTR_READ" ,Tptr_t ); 60 62 61 63 /******************************************************** … … 76 78 INSTANCE1_SC_SIGNAL(_Queue,out_SLOT_VAL ,_param->_nb_port_slot); 77 79 INSTANCE1_SC_SIGNAL(_Queue,out_SLOT_DATA ,_param->_nb_port_slot); 80 if (_param->_have_port_ptr_write) 81 INSTANCE0_SC_SIGNAL(_Queue,out_PTR_WRITE ); 82 if (_param->_have_port_ptr_read ) 83 INSTANCE0_SC_SIGNAL(_Queue,out_PTR_READ ); 78 84 79 85 cout << "<" << name << "> Start Simulation ............" << endl; … … 168 174 DELETE1_SC_SIGNAL(out_SLOT_VAL ,_param->_nb_port_slot); 169 175 DELETE1_SC_SIGNAL(out_SLOT_DATA ,_param->_nb_port_slot); 170 176 DELETE0_SC_SIGNAL(out_PTR_WRITE ); 177 DELETE0_SC_SIGNAL(out_PTR_READ ); 171 178 #endif 172 179 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Parameters.h
r100 r101 22 22 { 23 23 //-----[ fields ]------------------------------------------------------------ 24 public : const uint32_t _size_queue ; 25 public : const uint32_t _size_data ; 26 public : const uint32_t _nb_port_slot; 24 public : const uint32_t _size_queue ; 25 public : const uint32_t _size_data ; 26 public : const uint32_t _nb_port_slot ; 27 public : const bool _have_port_ptr_write; 28 public : const bool _have_port_ptr_read ; 29 30 public : const uint32_t _size_ptr ; 31 public : const bool _have_port_ptr ; 27 32 28 33 //-----[ methods ]----------------------------------------------------------- 29 public : Parameters (uint32_t size_queue, 30 uint32_t size_data , 31 uint32_t nb_port_slot); 34 public : Parameters (uint32_t size_queue , 35 uint32_t size_data , 36 uint32_t nb_port_slot , 37 bool have_port_ptr_write, 38 bool have_port_ptr_read ); 32 39 33 40 // public : Parameters (Parameters & param) ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/include/Queue.h
r100 r101 78 78 public : SC_OUT(Tdata_t ) ** out_SLOT_DATA; 79 79 80 // ~~~~~[ Interface "ptr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 public : SC_OUT(Tptr_t ) * out_PTR_WRITE; 82 public : SC_OUT(Tptr_t ) * out_PTR_READ ; 83 80 84 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 81 85 protected : morpheo::behavioural::generic::queue_control::Queue_Control * _queue_control; … … 87 91 protected : Tcontrol_t internal_INSERT_ACK; 88 92 protected : Tcontrol_t internal_RETIRE_VAL; 89 90 93 #endif 91 94 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Parameters.cpp
r100 r101 7 7 8 8 #include "Behavioural/Generic/Queue/include/Parameters.h" 9 9 #include "Common/include/Log2.h" 10 10 namespace morpheo { 11 11 namespace behavioural { … … 16 16 #undef FUNCTION 17 17 #define FUNCTION "Queue::Parameters" 18 Parameters::Parameters (uint32_t size_queue, 19 uint32_t size_data , 20 uint32_t nb_port_slot): 21 _size_queue (size_queue), 22 _size_data (size_data ), 23 _nb_port_slot (nb_port_slot) 18 Parameters::Parameters (uint32_t size_queue , 19 uint32_t size_data , 20 uint32_t nb_port_slot , 21 bool have_port_ptr_write, 22 bool have_port_ptr_read ): 23 _size_queue (size_queue), 24 _size_data (size_data ), 25 _nb_port_slot (nb_port_slot), 26 _have_port_ptr_write (have_port_ptr_write and (log2(size_queue)>0)), 27 _have_port_ptr_read (have_port_ptr_read and (log2(size_queue)>0)), 28 _size_ptr (log2(size_queue)), 29 _have_port_ptr (have_port_ptr_write or have_port_ptr_read) 24 30 { 25 31 log_printf(FUNC,Queue,FUNCTION,"Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_allocation.cpp
r100 r101 72 72 ALLOC1_SIGNAL_OUT(out_SLOT_DATA ,"data",Tdata_t,_param->_size_data); 73 73 } 74 75 // ~~~~~[ Interface "ptr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 if (_param->_have_port_ptr) 77 { 78 ALLOC0_INTERFACE("ptr", OUT, EAST, _("Internal pointer.")); 79 80 if (_param->_have_port_ptr_write) 81 ALLOC0_SIGNAL_OUT(out_PTR_WRITE ,"write",Tptr_t,_param->_size_ptr); 82 if (_param->_have_port_ptr_read ) 83 ALLOC0_SIGNAL_OUT(out_PTR_READ ,"read" ,Tptr_t,_param->_size_ptr); 84 } 74 85 75 86 if (usage_is_set(_usage,USE_SYSTEMC)) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_deallocation.cpp
r100 r101 36 36 DELETE1_SIGNAL(out_SLOT_VAL ,_param->_nb_port_slot,1); 37 37 DELETE1_SIGNAL(out_SLOT_DATA ,_param->_nb_port_slot,_param->_size_data); 38 39 if (_param->_have_port_ptr_write) 40 DELETE0_SIGNAL(out_PTR_WRITE ,_param->_size_ptr); 41 if (_param->_have_port_ptr_read ) 42 DELETE0_SIGNAL(out_PTR_READ ,_param->_size_ptr); 38 43 39 44 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_genMoore.cpp
r100 r101 20 20 log_printf(FUNC,Queue,FUNCTION,"Begin"); 21 21 22 //--------------------------------------------- 22 23 // Output 24 //--------------------------------------------- 23 25 internal_INSERT_ACK = not _queue_control->full(); 24 26 internal_RETIRE_VAL = not _queue_control->empty(); … … 28 30 PORT_WRITE(out_RETIRE_DATA,_queue_data[(*_queue_control)[0]]); 29 31 32 //--------------------------------------------- 30 33 // Slot 34 //--------------------------------------------- 31 35 // Note : Slot 0 is the same slot as retire interface. 32 36 uint32_t nb_elt = _queue_control->nb_elt(); … … 37 41 PORT_WRITE(out_SLOT_DATA [i],_queue_data[(*_queue_control)[i]]); 38 42 } 43 44 //--------------------------------------------- 45 // Pointer 46 //--------------------------------------------- 47 if (_param->_have_port_ptr_write) 48 PORT_WRITE(out_PTR_WRITE, _queue_control->ptr_push()); 49 if (_param->_have_port_ptr_read ) 50 PORT_WRITE(out_PTR_READ , _queue_control->ptr_pop ()); 39 51 40 52 log_printf(FUNC,Queue,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue_vhdl_body.cpp
r100 r101 62 62 else 63 63 vhdl->set_body (0,"out_SLOT_"+toString(i)+"_DATA <= reg_DATA(conv_integer(0));"); 64 } 65 66 if (_param->_have_port_ptr) 67 { 68 vhdl->set_body (0,""); 69 vhdl->set_comment(0,"---------------------------------------------------------------------------"); 70 vhdl->set_comment(0," Slot"); 71 vhdl->set_comment(0,"---------------------------------------------------------------------------"); 72 vhdl->set_body (0,""); 73 if (_param->_have_port_ptr_write) 74 vhdl->set_body (0,"out_PTR_WRITE <= signal_PTR_WRITE;"); 75 if (_param->_have_port_ptr_read) 76 vhdl->set_body (0,"out_PTR_READ <= signal_PTR_READ;"); 64 77 } 65 78 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue_Control/include/Queue_Control.h
r81 r101 35 35 public : void clear (void); 36 36 37 public : uint32_t ptr_pop (uint32_t index=0); 38 public : uint32_t ptr_push (void); 39 40 37 41 public : uint32_t push (void); 38 42 public : uint32_t push_ovf (void); 39 public : void pop (uint32_t );43 public : void pop (uint32_t index); 40 44 public : void pop (void); 41 public : void pop_ovf (uint32_t );45 public : void pop_ovf (uint32_t index); 42 46 public : void pop_ovf (void); 43 47 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h
r88 r101 21 21 class Parameters : public morpheo::behavioural::Parameters 22 22 { 23 public : const uint32_t _nb_port_read ; 24 public : const uint32_t _nb_port_write; 25 public : const uint32_t _nb_port_read_write; 26 public : const uint32_t _nb_word ; 27 public : const uint32_t _size_word ; 28 public : const uint32_t _size_address ; 29 public : const bool _have_port_address; 23 public : const uint32_t _nb_port_read ; 24 public : const uint32_t _nb_port_write; 25 public : const uint32_t _nb_port_read_write; 26 public : const uint32_t _nb_word ; 27 public : const uint32_t _size_word ; 28 public : const uint32_t _size_address ; 29 public : const bool _have_port_address; 30 public : const bool _have_init_value; 31 public : const std::string _init_value; 30 32 31 public : Parameters (uint32_t nb_port_read , 32 uint32_t nb_port_write, 33 uint32_t nb_port_read_write, 34 uint32_t nb_word , 35 uint32_t size_word ); 33 public : Parameters (uint32_t nb_port_read , 34 uint32_t nb_port_write, 35 uint32_t nb_port_read_write, 36 uint32_t nb_word , 37 uint32_t size_word , 38 std::string init_value=""); 36 39 // public : Parameters (Parameters & param) ; 37 40 public : ~Parameters () ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters.cpp
r88 r101 14 14 namespace registerfile_monolithic { 15 15 16 Parameters::Parameters (uint32_t nb_port_read , 17 uint32_t nb_port_write, 18 uint32_t nb_port_read_write , 19 uint32_t nb_word , 20 uint32_t size_word 16 Parameters::Parameters (uint32_t nb_port_read , 17 uint32_t nb_port_write, 18 uint32_t nb_port_read_write , 19 uint32_t nb_word , 20 uint32_t size_word , 21 std::string init_value 21 22 ) : 22 23 _nb_port_read (nb_port_read ), … … 26 27 _size_word (size_word ), 27 28 _size_address (static_cast<uint32_t>(log2(_nb_word))), 28 _have_port_address (_size_address != 0) 29 29 _have_port_address (_size_address != 0), 30 _have_init_value (init_value != ""), 31 _init_value (init_value) 30 32 { 31 33 test(); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Parameters_msg_error.cpp
r81 r101 33 33 test.error("you need a write port"); 34 34 35 // Need test init_value 36 35 37 return test; 36 38 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp
r88 r101 18 18 log_printf(FUNC,RegisterFile,"transition","Begin"); 19 19 20 for (uint32_t i=0; i<_param->_nb_port_write; i++)20 if (_param->_have_init_value and (PORT_READ(in_NRESET) == 0)) 21 21 { 22 // Have a write? 23 if ( PORT_READ(in_WRITE_VAL[i]) == true) 24 { 22 for (uint32_t i=0; i<_param->_nb_word; ++i) 23 reg_DATA[i] = fromString<Tdata_t>(_param->_init_value); 24 } 25 else 26 { 27 for (uint32_t i=0; i<_param->_nb_port_write; i++) 28 { 29 // Have a write? 30 if ( PORT_READ(in_WRITE_VAL[i]) == true) 31 { 25 32 #ifdef STATISTICS 26 if (usage_is_set(_usage,USE_STATISTICS)) 27 (*_stat_nb_write) ++; 28 #endif 29 30 Taddress_t address; 31 if (_param->_have_port_address) 32 address = PORT_READ(in_WRITE_ADDRESS[i]); 33 else 34 address = 0; 35 36 Tdata_t data = PORT_READ(in_WRITE_DATA [i]); 37 38 log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 39 40 // Write in registerFile 41 reg_DATA[address] = data; 42 } 43 } 44 for (uint32_t i=0; i<_param->_nb_port_read_write; i++) 45 { 46 // Have a read_write? 47 if (PORT_READ(in_READ_WRITE_VAL[i]) == true) 48 { 49 if (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE) 50 { 51 #ifdef STATISTICS 52 if (usage_is_set(_usage,USE_STATISTICS)) 33 if (usage_is_set(_usage,USE_STATISTICS)) 53 34 (*_stat_nb_write) ++; 54 35 #endif 55 56 Taddress_t address; 57 if (_param->_have_port_address) 58 address = PORT_READ(in_READ_WRITE_ADDRESS[i]); 59 else 60 address = 0; 61 Tdata_t data = PORT_READ(in_READ_WRITE_WDATA [i]); 62 63 log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 64 65 // Write in registerFile 66 reg_DATA[address] = data; 67 } 36 37 Taddress_t address = (_param->_have_port_address)?PORT_READ(in_WRITE_ADDRESS[i]):0; 38 Tdata_t data = PORT_READ(in_WRITE_DATA [i]); 39 40 log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 41 42 // Write in registerFile 43 reg_DATA[address] = data; 44 } 45 } 46 for (uint32_t i=0; i<_param->_nb_port_read_write; i++) 47 { 48 // Have a read_write? 49 if (PORT_READ(in_READ_WRITE_VAL[i]) == true) 50 { 51 if (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE) 52 { 68 53 #ifdef STATISTICS 69 else 70 { 71 if (usage_is_set(_usage,USE_STATISTICS)) 72 (*_stat_nb_read) ++; 73 } 54 if (usage_is_set(_usage,USE_STATISTICS)) 55 (*_stat_nb_write) ++; 74 56 #endif 75 } 57 58 Taddress_t address = (_param->_have_port_address)?PORT_READ(in_READ_WRITE_ADDRESS[i]):0; 59 Tdata_t data = PORT_READ(in_READ_WRITE_WDATA [i]); 60 61 log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data)); 62 63 // Write in registerFile 64 reg_DATA[address] = data; 65 } 66 #ifdef STATISTICS 67 else 68 { 69 if (usage_is_set(_usage,USE_STATISTICS)) 70 (*_stat_nb_read) ++; 71 } 72 #endif 73 } 74 } 76 75 } 77 76 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp
r94 r101 65 65 vhdl->set_body (0,"begin -- process RegisterFile_write"); 66 66 vhdl->set_body (1,"if in_CLOCK'event and in_CLOCK = '1' then"); 67 68 if (_param->_have_init_value) 69 { 70 vhdl->set_body (2,"if in_NRESET = '0' then"); 71 72 std::string init_value = ((_param->_size_word>1)?"\"":"'")+_param->_init_value+((_param->_size_word>1)?"\"":"'"); 73 74 for (uint32_t i=0; i<_param->_nb_word; ++i) 75 vhdl->set_body (3,"reg_DATA("+toString(i)+") <= "+init_value+";"); 76 77 vhdl->set_body (2,"else"); 78 } 67 79 68 80 for (uint32_t i = 0; i < _param->_nb_port_write; i++) … … 92 104 93 105 vhdl->set_body (1,"end if;"); 106 107 if (_param->_have_init_value) 108 vhdl->set_body (1,"end if;"); 109 94 110 vhdl->set_body (0,"end process RegisterFile_write;"); 95 111 };
Note: See TracChangeset
for help on using the changeset viewer.