build/X86_MESI_Two_Level/mem/protocol/L1Cache_Controller.cc
void
L1Cache_Controller::fi_sendInvAck(L1Cache_TBE*& m_tbe_ptr, L1Cache_Entry*& m_cache_entry_ptr, Addr addr, int core_id)//fanyao added core_id
{
    DPRINTF(RubyGenerated, "executing fi_sendInvAck\n");
    try {
       {
    // Declare message
    const RequestMsg* in_msg_ptr M5_VAR_USED;
    in_msg_ptr = dynamic_cast<const RequestMsg *>(((*m_requestToL1Cache_ptr)).peek());
    if (in_msg_ptr == NULL) {
        // 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.
        throw RejectException();
    }
{
    std::shared_ptr<ResponseMsg> out_msg = std::make_shared<ResponseMsg>(clockEdge());
    (*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 = (1);
    ((*m_responseFromL1Cache_ptr)).enqueue(out_msg, clockEdge(), cyclesToTicks(Cycles(m_l1_response_latency)));
}
}

    } catch (const RejectException & e) {
       fatal("Error in action L1Cache:fi_sendInvAck: "
             "executed a peek statement with the wrong message "
             "type specified. ");
    }
}
/** \brief send data to the L2 cache */
\brief send data to the L2 cache
\ brief send data to the L2 cache
void
L1Cache_Controller::fi_sendInvAck(L1Cache_TBE*& m_tbe_ptr, L1Cache_Entry*& m_cache_entry_ptr, Addr addr, int core_id)
{
    DPRINTF(RubyGenerated, "executing fi_sendInvAck\n");
    try {
       {
    const RequestMsg* in_msg_ptr M5_VAR_USED;
    in_msg_ptr = dynamic_cast<const RequestMsg *>(((*m_requestToL1Cache_ptr)).peek());
    if (in_msg_ptr == NULL) {
        throw RejectException();
    }
{
    std::shared_ptr<ResponseMsg> out_msg = std::make_shared<ResponseMsg>(clockEdge());
    (*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 = (1);
    ((*m_responseFromL1Cache_ptr)).enqueue(out_msg, clockEdge(), cyclesToTicks(Cycles(m_l1_response_latency)));
}
}
    } catch (const RejectException & e) {
       fatal("Error in action L1Cache:fi_sendInvAck: "
             "executed a peek statement with the wrong message "
             "type specified. ");
    }
}
void L1Cache_Controller :: fi_sendInvAck ( L1Cache_TBE * & m_tbe_ptr , L1Cache_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_requestToL1Cache_ptr ) ) . peek ( ) ) ; if ( in_msg_ptr == NULL ) { throw RejectException ( ) ; } { std :: shared_ptr < ResponseMsg > out_msg = std :: make_shared < ResponseMsg > ( clockEdge ( ) ) ; ( * 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 = ( 1 ) ; ( ( * m_responseFromL1Cache_ptr ) ) . enqueue ( out_msg , clockEdge ( ) , cyclesToTicks ( Cycles ( m_l1_response_latency ) ) ) ; } } } catch ( const RejectException & e ) { fatal ( " " " " " " ) ; } }
\brief send data to the L2 cache
\ brief send data to the L2 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.