- Timestamp:
- Nov 10, 2010, 6:53:40 PM (14 years ago)
- Location:
- trunk/modules/vci_synthetic_initator/caba/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/vci_synthetic_initator/caba/sources/include/vci_synthetic_initiator.h
r111 r115 104 104 void genMoore(); 105 105 106 size_t destAdress(); 106 uint32_t destAdress(); 107 108 uint32_t destAdress(uint32_t *rand_seed); 107 109 108 110 void printStats(); … … 133 135 size_t m_bc_nrsp; // Expected number of responses for a broadcast command 134 136 addr_t m_address_to_send; // Address to send the write command 137 uint32_t m_local_seed; 135 138 136 139 // Fifo transmitting date to the VCI FSM -
trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp
r111 r115 32 32 33 33 34 //#define DETERMINISM 34 35 35 36 namespace soclib { namespace caba { … … 80 81 m_ymax(ymax), 81 82 m_date_fifo("m_date_fifo", depth), 83 m_local_seed(m_srcid), 82 84 r_vci_fsm("r_vci_fsm") 83 85 { … … 102 104 103 105 /////////////////////////////////// 104 tmpl( size_t)::destAdress()106 tmpl(uint32_t)::destAdress() 105 107 /////////////////////////////////// 106 108 { 107 return ( size_t) (rand() % (m_xmesh * m_ymesh)) ;109 return (uint32_t) (rand() % (m_xmesh * m_ymesh)) ; 108 110 } 109 111 110 112 111 113 /////////////////////////////////// 112 // tmpl(void)::destAdress(/*size_t X_local, size_t Y_local,*/ size_t &X_dest, size_t &Y_dest)114 tmpl(uint32_t)::destAdress(uint32_t *rand_seed) 113 115 /////////////////////////////////// 114 // { 115 // size_t x_dest_calc, y_dest_calc; 116 // do{ 117 // x_dest_calc = (rand()%m_xmesh); 118 // y_dest_calc = (rand()%m_ymesh); 119 // } while((x_dest_calc = m_x) && (y_dest_calc == m_y)); 120 // } 116 { 117 return (uint32_t) (rand_r(rand_seed) % (m_xmesh * m_ymesh)) ; 118 } 121 119 122 120 … … 132 130 133 131 std::cout << "Vci_Synthetic_Initiator " << name() 134 << " : " << m_cpt_cycles << " cycles "132 << " : " << std::dec << m_cpt_cycles << " cycles " 135 133 << " : state = " << state_str[r_vci_fsm] 136 << " Adresse to send : " << m_address_to_send137 << " Number of broadcast to receive : " << m_bc_nrsp << std::endl;134 << " Adresse to send : " << std::hex << m_address_to_send 135 << " Number of broadcast to receive : " << std::dec << m_bc_nrsp << std::endl; 138 136 } 139 137 … … 152 150 if ( ! p_resetn.read() ) { 153 151 // Initializing seed for random numbers generation 152 #ifndef DETERMINISM 154 153 srand(time(NULL)); 154 #endif 155 155 156 156 // Initializing FSMs … … 193 193 } else { 194 194 r_vci_fsm = VCI_SINGLE_SEND ; 195 #ifdef DETERMINISM 196 m_address_to_send = destAdress(&m_local_seed) << (vci_param::N)-(soclib::common::uint32_log2((uint32_t)m_xmesh)+soclib::common::uint32_log2((uint32_t)m_ymesh)); 197 #else 195 198 m_address_to_send = destAdress() << (vci_param::N)-(soclib::common::uint32_log2((uint32_t)m_xmesh)+soclib::common::uint32_log2((uint32_t)m_ymesh)); 199 #endif 196 200 m_count = 0; 197 201 }
Note: See TracChangeset
for help on using the changeset viewer.