build/X86_MESI_Two_Level/mem/protocol/L2Cache_Controller.cc
/** \brief Write data from response queue to cache */
\brief Write data from response queue to cache
\ brief Write data from response queue to cache
void
L2Cache_Controller::m_writeDataToCache(L2Cache_TBE*& m_tbe_ptr, L2Cache_Entry*& m_cache_entry_ptr, Addr addr, int core_id)
{
    DPRINTF(RubyGenerated, "executing m_writeDataToCache\n");
    try {
       {
    const ResponseMsg* in_msg_ptr M5_VAR_USED;
    in_msg_ptr = dynamic_cast<const ResponseMsg *>(((*m_responseToL2Cache_ptr)).peek());
    if (in_msg_ptr == NULL) {
        throw RejectException();
    }
#ifndef NDEBUG
if (!((m_cache_entry_ptr != NULL))) {
    panic("Runtime Error at MESI_Two_Level-L2cache.sm:691: %s.\n", "assert failure");
}
#endif
;
(*m_cache_entry_ptr).m_DataBlk = ((*in_msg_ptr)).m_DataBlk;
    if (((*in_msg_ptr)).m_Dirty) {
        (*m_cache_entry_ptr).m_Dirty = ((*in_msg_ptr)).m_Dirty;
    }
    }
    } catch (const RejectException & e) {
       fatal("Error in action L2Cache:m_writeDataToCache: "
             "executed a peek statement with the wrong message "
             "type specified. ");
    }
}
void L2Cache_Controller :: m_writeDataToCache ( L2Cache_TBE * & m_tbe_ptr , L2Cache_Entry * & m_cache_entry_ptr , Addr addr , int core_id ) { DPRINTF ( RubyGenerated , " \n " ) ; try { { const ResponseMsg * in_msg_ptr M5_VAR_USED ; in_msg_ptr = dynamic_cast < const ResponseMsg * > ( ( ( * m_responseToL2Cache_ptr ) ) . peek ( ) ) ; if ( in_msg_ptr == NULL ) { throw RejectException ( ) ; } #ifndef NDEBUG if ( ! ( ( m_cache_entry_ptr != NULL ) ) ) { panic ( " \n " , " " ) ; } #endif ; ( * m_cache_entry_ptr ) . m_DataBlk = ( ( * in_msg_ptr ) ) . m_DataBlk ; if ( ( ( * in_msg_ptr ) ) . m_Dirty ) { ( * m_cache_entry_ptr ) . m_Dirty = ( ( * in_msg_ptr ) ) . m_Dirty ; } } } catch ( const RejectException & e ) { fatal ( " " " " " " ) ; } }
\brief Write data from response queue to cache
\ brief Write data from response queue to cache
//fanyao added core_id // Declare message // If the cast fails, this is the wrong inport (wrong message type). // Throw an exception, and the caller will decide to either try a // different inport or punt.