Changeset 102
- Timestamp:
- Oct 4, 2010, 5:22:53 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
r98 r102 47 47 : public soclib::caba::BaseModule 48 48 { 49 //typedef sc_dt::sc_uint<40> addr_t;49 typedef sc_dt::sc_uint<40> addr_t; 50 50 typedef typename vci_param::fast_addr_t vci_addr_t; 51 51 typedef uint32_t data_t; … … 56 56 57 57 // Type of the addr_t and access of the fields 58 typedef union{59 PACKED_BITFIELD(60 61 62 63 64 65 66 67 68 69 70 71 } addr_t;58 //typedef union{ 59 // PACKED_BITFIELD( 60 // vci_addr_t srcid:vci_param::S, 61 // vci_addr_t null:(8*sizeof(vci_addr_t)-(2*vci_param::S)), 62 // ) normal_address; 63 // PACKED_BITFIELD( 64 // vci_addr_t xmin:vci_param::S, 65 // vci_addr_t xmax:vci_param::S, 66 // vci_addr_t ymin:vci_param::S, 67 // vci_addr_t ymax:vci_param::S, 68 // vci_addr_t null_:(8*sizeof(vci_addr_t)-(4*vci_param::S)), 69 // vci_addr_t bc:2, 70 // ) broadcast_address; 71 //} addr_t; 72 72 73 73 … … 99 99 VciSyntheticInitiator( 100 100 sc_module_name name, 101 const 102 const 103 size_t length, // Packet length (flit numbers)104 float rho, // Packets ratio on the network105 size_t depth, // Fifo depth106 size_t xmesh,107 size_t ymesh,108 size_t bc_period = 0, // Broadcast period, if no broadcast => 0109 size_t xmin = 0,110 size_t xmax = 0,111 size_t ymin = 0,112 size_t ymax = 0,101 const soclib::common::MappingTable &mt, 102 const soclib::common::IntTab &vci_index, 103 const uint32_t length, // Packet length (flit numbers) 104 const float rho, // Packets ratio on the network 105 const uint32_t depth, // Fifo depth 106 const uint32_t xmesh, 107 const uint32_t ymesh, 108 const uint32_t bc_period = 0, // Broadcast period, if no broadcast => 0 109 const uint32_t xmin = 0, 110 const uint32_t xmax = 0, 111 const uint32_t ymin = 0, 112 const uint32_t ymax = 0 113 113 ); 114 114 … … 119 119 void genMoore(); 120 120 121 void destAdress(size_t X_local, size_t Y_local, size_t &X_dest, size_t &Y_dest);121 size_t destAdress(); 122 122 123 123 private: … … 125 125 // Component attributes 126 126 const size_t m_length; // Number of words to write 127 const size_t m_rho; // Rate of packets in the network wanted127 const float m_rho; // Rate of packets in the network wanted 128 128 const size_t m_depth; // Fifo depth 129 129 const size_t m_xmesh; … … 141 141 uint64_t m_start_latency1; // Start time of sending packet wanted 142 142 uint64_t m_start_latency2; // Start time of sending packet 143 addr_t m_address_to_send; // Address to send the write command144 143 float m_rhos; // Effective Rho during the simulation 145 144 size_t m_bc_nrsp; // Expected number of responses for a broadcast command … … 154 153 sc_signal<bool> r_broadcast_req; 155 154 155 sc_signal<addr_t> r_address_to_send; // Address to send the write command 156 156 157 }; // end class VciSyntheticInitiator 157 158 -
trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initiator.cpp
r98 r102 45 45 tmpl(/**/)::VciSyntheticInitiator( 46 46 sc_module_name name, 47 const 48 const 49 size_t length, // Packet length (flit numbers)50 float rho, // Packets ratio on the network51 size_t depth, // Fifo depth52 size_t xmesh,53 size_t ymesh,54 size_t bc_period = 0, // Broadcast period, if no broadcast => 055 size_t xmin = 0,56 size_t xmax = 0,57 size_t ymin = 0,58 size_t ymax = 047 const soclib::common::MappingTable &mt, 48 const soclib::common::IntTab &vci_index, 49 const uint32_t length, // Packet length (flit numbers) 50 const float rho, // Packets ratio on the network 51 const uint32_t depth, // Fifo depth 52 const uint32_t xmesh, 53 const uint32_t ymesh, 54 const uint32_t bc_period, // Broadcast period, if no broadcast => 0 55 const uint32_t xmin, 56 const uint32_t xmax, 57 const uint32_t ymin, 58 const uint32_t ymax 59 59 ) 60 60 … … 71 71 m_rho(rho), 72 72 m_depth(depth), 73 m_x(x),74 m_y(y),75 73 m_xmesh(xmesh), 76 74 m_ymesh(ymesh), … … 81 79 m_ymax(ymax), 82 80 m_date_fifo("m_date_fifo", depth), 83 r_vci_fsm("r_vci_fsm") ,81 r_vci_fsm("r_vci_fsm") 84 82 { 85 83 … … 160 158 } else { 161 159 r_vci_fsm = VCI_SINGLE_SEND ; 162 destAdress();160 r_address_to_send = destAdress(); 163 161 m_count = 0; 164 162 } … … 196 194 case VCI_BC_SEND: 197 195 { 198 m_address_to_send.broadcast_address.xmin = m_xmin; 199 m_address_to_send.broadcast_address.xmax = m_xmax; 200 m_address_to_send.broadcast_address.ymin = m_ymin; 201 m_address_to_send.broadcast_address.ymax = m_ymax; 202 m_address_to_send.broadcast_address.bc = 0x3; 196 r_address_to_send = (((((((((m_xmin << 5) & m_xmax ) << 5 ) & m_ymin ) << 5 ) & m_ymax ) << 5 ) << 17 ) & 0x3) | 0 ; 197 //m_address_to_send.broadcast_address.xmin = m_xmin; 198 //m_address_to_send.broadcast_address.xmax = m_xmax; 199 //m_address_to_send.broadcast_address.ymin = m_ymin; 200 //m_address_to_send.broadcast_address.ymax = m_ymax; 201 //m_address_to_send.broadcast_address.bc = 0x3; 203 202 m_bc_nrsp = (m_xmax - m_xmin) * (m_ymax - m_ymin); 204 203 r_vci_fsm = VCI_BC_SEND; … … 223 222 224 223 /////////////////// Filling fifo 225 if( ( rhos < m_rho) && (rand()/RAND_MAX) ){224 if( (m_rhos < m_rho) && (rand()/RAND_MAX) ){ 226 225 if (m_date_fifo.wok()){ 227 226 date_fifo_put = true ; 228 227 } 229 if (!r_broadcast_req.read() && (m_cpt_cycles % bc_period)){228 if (!r_broadcast_req.read() && (m_cpt_cycles % m_bc_period)){ 230 229 r_broadcast_req = true; 231 230 } … … 288 287 { 289 288 p_vci.cmdval = true; 290 p_vci.address = ( typename vci_param::addr_t)(m_address_to_send+(m_count*4));289 p_vci.address = (vci_addr_t)(r_address_to_send.read() + (m_count*4)); 291 290 p_vci.plen = m_length*4; 292 291 p_vci.wdata = 0; … … 316 315 { 317 316 p_vci.cmdval = true; 318 p_vci.address = ( typename vci_param::addr_t) m_address_to_send;317 p_vci.address = (vci_addr_t) r_address_to_send.read(); 319 318 p_vci.plen = 4; 320 319 p_vci.wdata = 0;
Note: See TracChangeset
for help on using the changeset viewer.