本文整理汇总了C++中PacketPtr::isLLSC方法的典型用法代码示例。如果您正苦于以下问题:C++ PacketPtr::isLLSC方法的具体用法?C++ PacketPtr::isLLSC怎么用?C++ PacketPtr::isLLSC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketPtr
的用法示例。
在下文中一共展示了PacketPtr::isLLSC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Tick BridgeClassicToAMBATLM2<BUSWIDTH>::recvAtomic(PacketPtr pkt)
{
tlm::tlm_generic_payload trans;
// std::cout << "In " << sc_core::sc_object::name() << " at time " << sc_time_stamp() << " request from GEM5 with address=0x" << hex << pkt->getAddr() << dec << " size=" << pkt->getSize() << std::endl;
if (pkt->memInhibitAsserted()) {
return 0;
}
if (pkt->cmd == MemCmd::SwapReq)
{
panic("SwapReq not supported\n");
}
else if (pkt->isRead())
{
assert(!pkt->isWrite());
if (pkt->isLLSC()) {
trackLoadLocked(pkt);
}
// if (pkt->isLLSC())
// {
// panic("isLLSC not yet supported for atomic\n");
// }
trans.set_read();
trans.set_address(pkt->getAddr());
trans.set_data_length(pkt->getSize());
trans.set_data_ptr(pkt->getPtr<unsigned char>());
debug_port->transport_dbg(static_cast<tlm::tlm_generic_payload &>(trans));
unsigned char * data = pkt->getPtr<unsigned char>();
// std::cout << "In " << sc_core::sc_object::name() << " at time " << sc_time_stamp() << " sending a READ response to GEM5 with address=0x" << hex << pkt->getAddr() << dec << " size=" << pkt->getSize();
// std::cout << hex << " and data= [";
// for(unsigned j=0;j<pkt->getSize(); j++)
// std::cout << "0x" << uint32_t(data[j]) << ",";
// std::cout << "]" << dec << std::endl;
}
else if (pkt->isWrite())
{
// std::cout << "isWrite " << std::endl;
if (writeOK(pkt))
{
trans.set_write();
/*if (writeOK(pkt)) {
if (pmemAddr)
memcpy(hostAddr, pkt->getPtr<uint8_t>(), pkt->getSize());
assert(!pkt->req->isInstFetch());
}*/
trans.set_address(pkt->getAddr());
trans.set_data_length(pkt->getSize());
trans.set_data_ptr(pkt->getPtr<unsigned char>());
debug_port->transport_dbg(static_cast<tlm::tlm_generic_payload &>(trans));
}
else
std::cout << "recvAtomic !writeOK " << hex << pkt->getAddr() << dec << std::endl;
}
else if (pkt->isInvalidate())
{
//upgrade or invalidate
if (pkt->needsResponse())
{
pkt->makeAtomicResponse();
}
}
else
{
panic("unimplemented");
}
if (pkt->needsResponse())
{
pkt->makeAtomicResponse();
}
return 1000;
}