util/tlm/src/sc_slave_port.cc
/**
 * Similar to TLM's blocking transport (LT)
 */
Similar to TLM's blocking transport (LT)
Similar to TLM ' s blocking transport ( LT )
gem5::Tick
SCSlavePort::recvAtomic(gem5::PacketPtr packet)
{
    CAUGHT_UP;
    SC_REPORT_INFO("SCSlavePort", "recvAtomic hasn't been tested much");
    panic_if(packet->cacheResponding(), "Should not see packets where cache "
             "is responding");
    panic_if(!(packet->isRead() || packet->isWrite()),
             "Should only see read and writes at TLM memory\n");
    sc_core::sc_time delay = sc_core::SC_ZERO_TIME;
    tlm::tlm_generic_payload * trans = mm.allocate();
    trans->acquire();
    packet2payload(packet, *trans);
    Gem5Extension* extension = new Gem5Extension(packet);
    trans->set_auto_extension(extension);
    if (packet->cmd == gem5::MemCmd::SwapReq) {
        SC_REPORT_FATAL("SCSlavePort", "SwapReq not supported");
    } else if (packet->isRead()) {
        transactor->socket->b_transport(*trans, delay);
    } else if (packet->isInvalidate()) {
    } else if (packet->isWrite()) {
        transactor->socket->b_transport(*trans, delay);
    } else {
        SC_REPORT_FATAL("SCSlavePort", "Typo of request not supported");
    }
    if (packet->needsResponse()) {
        packet->makeResponse();
    }
    trans->release();
    return delay.value();
}
gem5 :: Tick SCSlavePort :: recvAtomic ( gem5 :: PacketPtr packet ) { CAUGHT_UP ; SC_REPORT_INFO ( " " , " " ) ; panic_if ( packet -> cacheResponding ( ) , " " " " ) ; panic_if ( ! ( packet -> isRead ( ) || packet -> isWrite ( ) ) , " \n " ) ; sc_core :: sc_time delay = sc_core :: SC_ZERO_TIME ; tlm :: tlm_generic_payload * trans = mm . allocate ( ) ; trans -> acquire ( ) ; packet2payload ( packet , * trans ) ; Gem5Extension * extension = new Gem5Extension ( packet ) ; trans -> set_auto_extension ( extension ) ; if ( packet -> cmd == gem5 :: MemCmd :: SwapReq ) { SC_REPORT_FATAL ( " " , " " ) ; } else if ( packet -> isRead ( ) ) { transactor -> socket -> b_transport ( * trans , delay ) ; } else if ( packet -> isInvalidate ( ) ) { } else if ( packet -> isWrite ( ) ) { transactor -> socket -> b_transport ( * trans , delay ) ; } else { SC_REPORT_FATAL ( " " , " " ) ; } if ( packet -> needsResponse ( ) ) { packet -> makeResponse ( ) ; } trans -> release ( ) ; return delay . value ( ) ; }
Similar to TLM's blocking transport (LT)
Similar to TLM ' s blocking transport ( LT )
/* Prepare the transaction */ /* Attach the packet pointer to the TLM transaction to keep track */ /* Execute b_transport: */ // do nothing