build/X86_MESI_Two_Level/mem/protocol/L1Cache_Controller.cc
/** \brief Issue GETINSTR for prefetch request */
\brief Issue GETINSTR for prefetch request
\ brief Issue GETINSTR for prefetch request
void
L1Cache_Controller::pai_issuePfGETINSTR(L1Cache_TBE*& m_tbe_ptr, L1Cache_Entry*& m_cache_entry_ptr, Addr addr, int core_id)
{
    DPRINTF(RubyGenerated, "executing pai_issuePfGETINSTR\n");
    try {
       {
    const RubyRequest* in_msg_ptr M5_VAR_USED;
    in_msg_ptr = dynamic_cast<const RubyRequest *>(((*m_optionalQueue_ptr)).peek());
    if (in_msg_ptr == NULL) {
        throw RejectException();
    }
{
    std::shared_ptr<RequestMsg> out_msg = std::make_shared<RequestMsg>(clockEdge());
    (*out_msg).m_addr = addr;
    (*out_msg).m_Type = CoherenceRequestType_GET_INSTR;
    (*out_msg).m_Requestor = m_machineID;
    (((*out_msg).m_Destination).add((mapAddressToRange(addr, MachineType_L2Cache, (*m_l2_select_low_bit_ptr), m_l2_select_num_bits, (intToID((0)))))));
    (*out_msg).m_MessageSize = MessageSizeType_Control;
    (*out_msg).m_Prefetch = ((*in_msg_ptr)).m_Prefetch;
    (*out_msg).m_AccessMode = ((*in_msg_ptr)).m_AccessMode;
    DPRINTF(RubySlicc, "MESI_Two_Level-L1cache.sm:626: address: %#x, destination: %s\n", addr, (*out_msg).m_Destination);
    ((*m_requestFromL1Cache_ptr)).enqueue(out_msg, clockEdge(), cyclesToTicks(Cycles(m_l1_request_latency)));
}
}
    } catch (const RejectException & e) {
       fatal("Error in action L1Cache:pai_issuePfGETINSTR: "
             "executed a peek statement with the wrong message "
             "type specified. ");
    }
}
void L1Cache_Controller :: pai_issuePfGETINSTR ( L1Cache_TBE * & m_tbe_ptr , L1Cache_Entry * & m_cache_entry_ptr , Addr addr , int core_id ) { DPRINTF ( RubyGenerated , " \n " ) ; try { { const RubyRequest * in_msg_ptr M5_VAR_USED ; in_msg_ptr = dynamic_cast < const RubyRequest * > ( ( ( * m_optionalQueue_ptr ) ) . peek ( ) ) ; if ( in_msg_ptr == NULL ) { throw RejectException ( ) ; } { std :: shared_ptr < RequestMsg > out_msg = std :: make_shared < RequestMsg > ( clockEdge ( ) ) ; ( * out_msg ) . m_addr = addr ; ( * out_msg ) . m_Type = CoherenceRequestType_GET_INSTR ; ( * out_msg ) . m_Requestor = m_machineID ; ( ( ( * out_msg ) . m_Destination ) . add ( ( mapAddressToRange ( addr , MachineType_L2Cache , ( * m_l2_select_low_bit_ptr ) , m_l2_select_num_bits , ( intToID ( ( 0 ) ) ) ) ) ) ) ; ( * out_msg ) . m_MessageSize = MessageSizeType_Control ; ( * out_msg ) . m_Prefetch = ( ( * in_msg_ptr ) ) . m_Prefetch ; ( * out_msg ) . m_AccessMode = ( ( * in_msg_ptr ) ) . m_AccessMode ; DPRINTF ( RubySlicc , " \n " , addr , ( * out_msg ) . m_Destination ) ; ( ( * m_requestFromL1Cache_ptr ) ) . enqueue ( out_msg , clockEdge ( ) , cyclesToTicks ( Cycles ( m_l1_request_latency ) ) ) ; } } } catch ( const RejectException & e ) { fatal ( " " " " " " ) ; } }
\brief Issue GETINSTR for prefetch request
\ brief Issue GETINSTR for prefetch request
//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.