Changeset 81
- Timestamp:
- Aug 31, 2010, 2:18:16 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_initator.h
r78 r81 61 61 }; 62 62 63 uint32_t m_cpt_cycles; // Counter of cycles 63 uint64_t m_cpt_cycles; // Counter of cycles 64 64 65 65 66 protected: … … 77 78 float rho, // Packets ratio on the network 78 79 size_t depth, // Fifo depth 79 size_t x, //80 size_t y, //80 size_t x, // X location of the synthetic initiator 81 size_t y, // Y location of the synthetic initiator 81 82 size_t xmesh, 82 83 size_t ymesh, … … 85 86 size_t xmax, 86 87 size_t ymin, 87 size_t ymax 88 const soclib::common::IntTab &vci_index ,88 size_t ymax, 89 const soclib::common::IntTab &vci_index 89 90 ); 90 91 … … 95 96 void genMoore(); 96 97 97 void print_stats();98 void destAdress(size_t X_local, size_t Y_local, size_t &X_dest, size_t &Y_dest); 98 99 99 100 private: … … 102 103 const size_t m_length; // Number of flits of a packet 103 104 const size_t m_rho; // Rate of packets in the network wanted 104 const size_t m_depth, // Fifo depth 105 const size_t m_x, // 106 const size_t m_y, // 107 const size_t m_xmesh, 108 const size_t m_ymesh, 109 const size_t m_bc_period, // Broadcast period, if no broadcast => 0 110 const size_t m_xmin, 111 const size_t m_xmax, 112 const size_t m_ymin, 113 const size_t m_ymax 105 const size_t m_depth; // Fifo depth 106 const size_t m_x; // X location 107 const size_t m_y; // Y location 108 const size_t m_xmesh; 109 const size_t m_ymesh; 110 const size_t m_bc_period; // Broadcast period, if no broadcast => 0 111 const size_t m_xmin; 112 const size_t m_xmax; 113 const size_t m_ymin; 114 const size_t m_ymax; 115 116 size_t m_count; 117 size_t m_npackets; // Total number of packets already sent 114 118 115 119 // Fifo transmitting date to the VCI FSM … … 120 124 sc_signal<size_t> r_index; 121 125 126 sc_signal<bool> r_broadcast_req; 127 122 128 }; // end class VciSyntheticInitiator 123 129 -
trunk/modules/vci_synthetic_initator/caba/sources/src/vci_synthetic_initator.cpp
r78 r81 67 67 m_srcid_ini( mtc.indexForId(vci_ini_index) ), 68 68 // FIFOs 69 m_length(length), 70 m_rho(rho), 71 m_depth(depth), 72 m_x(x), 73 m_y(y), 74 m_xmesh(xmesh), 75 m_ymesh(ymesh), 76 m_bc_period(bc_period), 77 m_xmin(xmin), 78 m_xmax(xmax), 79 m_ymin(ymin), 80 m_ymax(ymax), 69 81 m_date_fifo("m_date_fifo", depth), 70 71 82 r_tgt_cmd_fsm("r_tgt_cmd_fsm"), 72 83 { 73 84 74 // Memory cache allocation & initialisation75 m_cache_data = new data_t**[nways];76 for ( size_t i=0 ; i<nways ; ++i ) {77 m_cache_data[i] = new data_t*[nsets];78 }79 for ( size_t i=0; i<nways; ++i ) {80 for ( size_t j=0; j<nsets; ++j ) {81 m_cache_data[i][j] = new data_t[nwords];82 for ( size_t k=0; k<nwords; k++){83 m_cache_data[i][j][k]=0;84 }85 }86 }87 85 88 86 SC_METHOD(transition); … … 101 99 ///////////////////////////////// 102 100 { 103 delete [] r_write_to_init_cmd_data; 101 } 102 103 /////////////////////////////////// 104 tmpl(void)::destAdress(size_t X_local, size_t Y_local, size_t &X_dest, size_t &Y_dest) 105 /////////////////////////////////// 106 { 107 X_dest = (size_t) ((rand())%m_xmesh); 108 Y_dest = (size_t) ((rand())%m_ymesh); 104 109 } 105 110 … … 111 116 // RESET 112 117 if ( ! p_resetn.read() ) { 113 118 //srand(time(NULL)); 114 119 // Initializing FSMs 115 120 r_tgt_cmd_fsm = TGT_CMD_IDLE; … … 119 124 m_date_fifo.init(); 120 125 121 r_read_to_tgt_rsp_req = false;122 r_read_to_xram_cmd_req = false;123 124 r_write_to_tgt_rsp_req = false;125 r_write_to_xram_cmd_req = false;126 r_write_to_init_cmd_req = false;127 128 129 126 // Activity counters 130 127 m_cpt_cycles = 0; 128 m_npackets = 0; 131 129 132 130 return; 133 131 } 134 132 135 bool cmd_read_fifo_put = false;136 bool cmd_read_fifo_get = false;133 bool date_fifo_put = false; 134 bool date_fifo_get = false; 137 135 138 136 switch ( r_vci_fsm.read() ) { … … 151 149 case VCI_SINGLE_RECEIVE: 152 150 { 151 if (p_vci.cmdack.read()) { 152 // LATENCY 153 r_vci_fsm = VCI_IDLE ; 154 } 153 155 break; 154 156 } … … 161 163 case VCI_BC_RECEIVE: 162 164 { 165 r_broadcast_req = false; 163 166 break; 164 167 } … … 166 169 167 170 168 if ( cmd_cleanup_fifo_put ) { 169 if ( cmd_cleanup_fifo_get ) { 170 m_cmd_cleanup_srcid_fifo.put_and_get(p_vci_tgt.srcid.read()); 171 m_cmd_cleanup_trdid_fifo.put_and_get(p_vci_tgt.trdid.read()); 172 m_cmd_cleanup_pktid_fifo.put_and_get(p_vci_tgt.pktid.read()); 173 m_cmd_cleanup_nline_fifo.put_and_get(p_vci_tgt.wdata.read()); 171 /////////////////// Filling fifo 172 if(){ 173 if (m_date_fifo.wok()){ 174 date_fifo_put = true ; 175 } 176 if (!r_broadcast_req.read() && (m_cpt_cycles % bc_period)){ 177 r_broadcast_req = true; 178 } 179 } 180 181 if (date_fifo_put){ 182 if (date_fifo_get){ 183 m_date_fifo.put_and_get(m_cpt_cycles); 174 184 } else { 175 m_cmd_cleanup_srcid_fifo.simple_put(p_vci_tgt.srcid.read()); 176 m_cmd_cleanup_trdid_fifo.simple_put(p_vci_tgt.trdid.read()); 177 m_cmd_cleanup_pktid_fifo.simple_put(p_vci_tgt.pktid.read()); 178 m_cmd_cleanup_nline_fifo.simple_put(p_vci_tgt.wdata.read()); 185 m_date_fifo.simple_put(m_cpt_cycles); 179 186 } 180 187 } else { 181 if ( cmd_cleanup_fifo_get ) { 182 m_cmd_cleanup_srcid_fifo.simple_get(); 183 m_cmd_cleanup_trdid_fifo.simple_get(); 184 m_cmd_cleanup_pktid_fifo.simple_get(); 185 m_cmd_cleanup_nline_fifo.simple_get(); 188 if (date_fifo_get){ 189 m_date_fifo.simple_get(); 186 190 } 187 191 } 188 192 193 189 194 m_cpt_cycles++; 195 196 return; 190 197 191 198 } // end transition() … … 198 205 // Command signals on the p_vci_ixr port 199 206 //////////////////////////////////////////////////////////// 207 p_vci.cmd = vci_param::CMD_READ; 208 p_vci.be = 0xF; 209 p_vci.pktid = 0; 210 p_vci.srcid = m_srcid_ixr; 211 p_vci.cons = false; 212 p_vci.wrap = false; 213 p_vci.contig = true; 214 p_vci.clen = 0; 215 p_vci.cfixed = false; 200 216 201 217 … … 205 221 case VCI_IDLE: 206 222 { 223 p_vci.cmdval = false; 224 p_vci.address = 0; 225 p_vci.plen = 0; 226 p_vci.wdata = 0; 227 p_vci.trdid = 0; 228 p_vci.eop = false; 207 229 break; 208 230 } … … 210 232 case VCI_SINGLE_SEND: 211 233 { 234 p_vci.cmdval = true ; 212 235 break; 213 236 }
Note: See TracChangeset
for help on using the changeset viewer.