Changes between Version 15 and Version 16 of Writing Rules/RISC


Ignore:
Timestamp:
Jan 9, 2008, 8:52:45 PM (16 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing Rules/RISC

    v15 v16  
    6767    RB  ,  // Read Byte Cached
    6868    RZ ,   // Cache Line Invalidate
    69     RWU ,  // Read Word Uncached
    70     RHU ,  // Read Half Uncached
    71     RBU ,  // Read Byte Uncached
    7269    WW ,  // Write Word
    7370    WH ,  // Write Half
     
    8178This 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.
    8279
    83  * '''inline void setRdata (bool error, uint32_t rdata)'''
    84 This function is used by the wrapper to transmit to the ISS, the read data ('''rdata''' parameter). In case of exception (bus error), the '''error''' parameter is set.
     80 * '''inline void setDataResponse (bool error, uint32_t rdata)'''
     81This 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.
    8582
    8683 * '''inline void setWriteBerr ()'''
     
    180177private :
    181178
    182 ///////// Variables /////////
     179///////////
    183180iss_t  m_iss ;
    184 bool  m_ins_asked ;
    185 bool  m_data_asked ;
    186181
    187182/////////////////////////
    188183void transition()
    189184    {
     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
    190193    if ( ! p_resetn.read() ) {
    191194        m_iss.reset();   
     
    193196    }
    194197
    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())
    200200    }
    201201
    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
    208209        m_iss.nullStep();
    209     } else {                    // Execute one instruction:
     210    } else {                        // Execute one instruction:
    210211        m_iss.step();
    211212    }
     
    215216    for ( size_t i=0; i<(size_t)iss_t::n_irq; i++ )  { if (p_irq[i].read()) irqword |= (1<<i); }
    216217    m_iss.setIrq(irqword);
    217 
    218     // report asynchronous bus error
    219     if ( p_dcache.berr.read() ) m_iss.setWriteBerr() ;
    220218
    221219    } // end transition()