build/X86_MESI_Two_Level/mem/protocol/L2Cache_Controller.cc
/** \brief Send ACK to upgrader */
\brief Send ACK to upgrader
\ brief Send ACK to upgrader
void
L2Cache_Controller::ts_sendInvAckToUpgrader(L2Cache_TBE*& m_tbe_ptr, L2Cache_Entry*& m_cache_entry_ptr, Addr addr, int core_id)
{
    DPRINTF(RubyGenerated, "executing ts_sendInvAckToUpgrader\n");
    try {
       {
    const RequestMsg* in_msg_ptr M5_VAR_USED;
    in_msg_ptr = dynamic_cast<const RequestMsg *>(((*m_L1RequestToL2Cache_ptr)).peek());
    if (in_msg_ptr == NULL) {
        throw RejectException();
    }
{
    std::shared_ptr<ResponseMsg> out_msg = std::make_shared<ResponseMsg>(clockEdge());
    #ifndef NDEBUG
    if (!((m_cache_entry_ptr != NULL))) {
        panic("Runtime Error at MESI_Two_Level-L2cache.sm:784: %s.\n", "assert failure");
    }
    #endif
    ;
    (*out_msg).m_addr = addr;
    (*out_msg).m_Type = CoherenceResponseType_ACK;
    (*out_msg).m_Sender = m_machineID;
    (((*out_msg).m_Destination).add(((*in_msg_ptr)).m_Requestor));
    (*out_msg).m_MessageSize = MessageSizeType_Response_Control;
    (*out_msg).m_AckCount = (((0) - (((*m_cache_entry_ptr).m_Sharers).count())) + (1));
    ((*m_responseFromL2Cache_ptr)).enqueue(out_msg, clockEdge(), cyclesToTicks(Cycles(m_to_l1_latency)));
}
}
    } catch (const RejectException & e) {
       fatal("Error in action L2Cache:ts_sendInvAckToUpgrader: "
             "executed a peek statement with the wrong message "
             "type specified. ");
    }
}
void L2Cache_Controller :: ts_sendInvAckToUpgrader ( L2Cache_TBE * & m_tbe_ptr , L2Cache_Entry * & m_cache_entry_ptr , Addr addr , int core_id ) { DPRINTF ( RubyGenerated , " \n " ) ; try { { const RequestMsg * in_msg_ptr M5_VAR_USED ; in_msg_ptr = dynamic_cast < const RequestMsg * > ( ( ( * m_L1RequestToL2Cache_ptr ) ) . peek ( ) ) ; if ( in_msg_ptr == NULL ) { throw RejectException ( ) ; } { std :: shared_ptr < ResponseMsg > out_msg = std :: make_shared < ResponseMsg > ( clockEdge ( ) ) ; #ifndef NDEBUG if ( ! ( ( m_cache_entry_ptr != NULL ) ) ) { panic ( " \n " , " " ) ; } #endif ; ( * out_msg ) . m_addr = addr ; ( * out_msg ) . m_Type = CoherenceResponseType_ACK ; ( * out_msg ) . m_Sender = m_machineID ; ( ( ( * out_msg ) . m_Destination ) . add ( ( ( * in_msg_ptr ) ) . m_Requestor ) ) ; ( * out_msg ) . m_MessageSize = MessageSizeType_Response_Control ; ( * out_msg ) . m_AckCount = ( ( ( 0 ) - ( ( ( * m_cache_entry_ptr ) . m_Sharers ) . count ( ) ) ) + ( 1 ) ) ; ( ( * m_responseFromL2Cache_ptr ) ) . enqueue ( out_msg , clockEdge ( ) , cyclesToTicks ( Cycles ( m_to_l1_latency ) ) ) ; } } } catch ( const RejectException & e ) { fatal ( " " " " " " ) ; } }
\brief Send ACK to upgrader
\ brief Send ACK to upgrader
//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.