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


Ignore:
Timestamp:
Jan 10, 2008, 6:37:58 PM (16 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing Rules/RISC

    v16 v17  
    333333///////  member variables
    334334tlmt_time  m_time ;
     335sc_event m_rsp_received ;
    335336iss_t  m_iss ;
     337uint32_t  m_rsp_error ;
    336338uint32_t  m_dcache_nlines ;
    337339uint32_t  m_dcache_nwords ;
     
    356358            m_iss.nullStep() ;
    357359        } else {
     360            /////////// cache access
    358361            m_iss.getInstructionRequest(icache_req.valid,
    359362                          icache_req.type,
    360                           icache_req.mode,
    361363                          icache_req.address) ;
    362364            m_iss.getDataRequest(dcache_req.valid,
    363                           dcache_req.type,
    364                           dcache_req.mode,
     365                          dcache_req.type,
    365366                          dcache_req.address,
    366367                          dcache_req.wdata)
    367368            xcacheAccess(&icache_req, &dcache_req, &xcache_rsp) ;
    368             m_iss.setInstruction(xcache_rsp.iber, xcache_rsp.instruction) ;
    369             if(dcache_req.isRead()) m_iss.setRdata(xcache_rsp.dber, xcache_rsp.rdata) ;
     369            if ( icache_req.valid ) m_iss.setInstruction(xcache_rsp.iber, xcache_rsp.instruction) ;
     370            if ( dcache_req.valid ) m_iss.setDataResponse(xcache_rsp.dber, xcache_rsp.rdata) ;
     371            //////// handling interrupts
    370372            irqword = 0 ;
    371373            for ( size_t i = 0 ; i < iss_t ::n_irq ; i++) {
    372374                if( m_irqpending[i] && m_irqtime[i] <= get_time()) irqword  |= (1<<i);
    373375               }
    374             m_iss.setIrq(irqword) ;     
     376            m_iss.setIrq(irqword) ;
     377            ///////// handling asynchronous bus error
     378            if ( m_write_error ) {
     379                setWriteBerr() ;
     380                m_write_error = false ;
     381            }   
    375382            m_iss.step() ;
    376383        } // end cycle
     
    392399    } // end cacheAccess()
    393400
    394 
    395401////////////////////////////
    396402void  rspReceived(vci_rsp_t rsp,
    397403              uint32_t  time)
    398404    {
    399     ...
     405    if ( rsp.cmd == VCI_CMD_write ) {  // asynchronous bus error signaling
     406        m_write_error = ( rsp.error != 0 ) ;
     407    }
     408    if ( rsp.cmd == VCI_CMD_READ ) {  // time update & cache activation
     409        m_time.updateTime( time + rsp.length ) ;
     410        notify( m_rsp_received ) ;
     411    }
    400412    } // end rspReceived()
    401413