Changes between Version 15 and Version 16 of Writing Rules/RISC
- Timestamp:
- Jan 9, 2008, 8:52:45 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/RISC
v15 v16 67 67 RB , // Read Byte Cached 68 68 RZ , // Cache Line Invalidate 69 RWU , // Read Word Uncached70 RHU , // Read Half Uncached71 RBU , // Read Byte Uncached72 69 WW , // Write Word 73 70 WH , // Write Half … … 81 78 This function is used by the wrapper to transmit to the ISS, the instruction to be executed ('''ins''' parameter). In case of exception (bus error), the '''error''' parameter is set. 82 79 83 * '''inline void set Rdata(bool error, uint32_t rdata)'''84 This function is used by the wrapper to transmit to the ISS, the re ad data ('''rdata''' parameter). In case of exception (bus error), the '''error''' parameter is set.80 * '''inline void setDataResponse (bool error, uint32_t rdata)''' 81 This function is used by the wrapper to transmit to the ISS, the response to the data request. In case of a read request, the '''rdata''' parameter contains the read value. In case of exception (bus error), the '''error''' parameter is set. In any case, this function must reset the ISS data request. 85 82 86 83 * '''inline void setWriteBerr ()''' … … 180 177 private : 181 178 182 ///////// Variables /////////179 /////////// 183 180 iss_t m_iss ; 184 bool m_ins_asked ;185 bool m_data_asked ;186 181 187 182 ///////////////////////// 188 183 void transition() 189 184 { 185 bool ifrz = p_icache.frz.read() ; 186 bool ireq = p_icache.req.read() ; 187 bool iberr = p_icache.berr.read() ; 188 189 bool dfrz = p_dcache.frz.read() ; 190 bool dberr = p_dcache.berr.read() ; 191 bool dreq = p_dcache.req.read() ; 192 190 193 if ( ! p_resetn.read() ) { 191 194 m_iss.reset(); … … 193 196 } 194 197 195 bool frozen = m_iss.isBusy(); 196 197 if ( m_ins_asked ) { 198 if ( p_icache.frz.read() ) frozen = true; 199 m_iss.setInstruction(p_icache.berr.read(), p_icache.ins.read()) 198 if ( ireq ) { 199 m_iss.setInstruction( iberr, p_icache.ins.read()) 200 200 } 201 201 202 if ( m_data_asked ) { 203 if ( p_dcache.frz.read() ) frozen = true; 204 m_iss.setRdata(p_dcache.berr.read(), p_dcache.rdata.read()); 205 } 206 207 if ( frozen ) { // Processor frozen or busy 202 if ( dberr && ( !dreq || dfrz ) ) { 203 m_iss.setWriteBerr() ; 204 } else if ( dreq ) { 205 m_iss.setDataResponse( dberr, p_dcache.rdata.read() ) ; 206 } 207 208 if ( m_iss.isBusy() || ifrz || dfrz ) { // Processor frozen or busy 208 209 m_iss.nullStep(); 209 } else { // Execute one instruction:210 } else { // Execute one instruction: 210 211 m_iss.step(); 211 212 } … … 215 216 for ( size_t i=0; i<(size_t)iss_t::n_irq; i++ ) { if (p_irq[i].read()) irqword |= (1<<i); } 216 217 m_iss.setIrq(irqword); 217 218 // report asynchronous bus error219 if ( p_dcache.berr.read() ) m_iss.setWriteBerr() ;220 218 221 219 } // end transition()