45 #include "arch/locked_mem.hh"
46 #include "arch/mmapped_ipr.hh"
51 #include "debug/Activity.hh"
52 #include "debug/MinorMem.hh"
61 return addr & (block_size - 1);
84 issuedToMemory(false),
90 Addr req1_addr,
unsigned int req1_size,
91 Addr req2_addr,
unsigned int req2_size)
95 Addr req2_end_addr = req2_addr + req2_size;
96 Addr req1_end_addr = req1_addr + req1_size;
100 if (req1_addr > req2_end_addr || req1_end_addr < req2_addr)
102 else if (req1_addr <= req2_addr && req1_end_addr >= req2_end_addr)
113 return containsAddrRangeOf(request.getPaddr(), request.getSize(),
120 return inst->isInst() && inst->staticInst->isMemBarrier();
126 return state == StoreToStoreBuffer;
132 DPRINTFS(MinorMem, (&port),
"Setting state from %d to %d for request:"
133 " %s\n",
state, new_state, *inst);
142 return state == Complete;
148 os << (isLoad ?
'R' :
'W') <<
';';
149 inst->reportData(os);
158 os <<
"PartialAddrRangeCoverage";
161 os <<
"FullAddrRangeCoverage";
164 os <<
"NoAddrRangeCoverage";
167 os <<
"AddrRangeCoverage-" <<
static_cast<int>(coverage);
181 os <<
"InTranslation";
190 os <<
"RequestIssuing";
193 os <<
"StoreToStoreBuffer";
196 os <<
"StoreInStoreBuffer";
199 os <<
"StoreBufferIssuing";
202 os <<
"RequestNeedsRetry";
205 os <<
"StoreBufferNeedsRetry";
211 os <<
"LSQRequestState-" <<
static_cast<int>(
state);
220 bool is_last_barrier =
223 DPRINTF(MinorMem,
"Moving %s barrier out of store buffer inst: %s\n",
224 (is_last_barrier ?
"last" :
"a"), *inst);
236 port.numAccessesInDTLB--;
238 DPRINTFS(MinorMem, (&port),
"Received translation response for"
239 " request: %s\n", *inst);
243 setState(Translated);
244 port.tryToSendToTransfers(
this);
256 port.numAccessesInDTLB++;
260 DPRINTFS(MinorMem, (&port),
"Submitting DTLB request\n");
271 DPRINTFS(MinorMem, (&port),
"Retiring packet\n");
273 packetInFlight =
false;
283 port.numAccessesInDTLB--;
286 numTranslatedFragments;
288 numInTranslationFragments--;
289 numTranslatedFragments++;
291 DPRINTFS(MinorMem, (&port),
"Received translation response for fragment"
292 " %d of request: %s\n", expected_fragment_index, *inst);
294 assert(request_ == fragmentRequests[expected_fragment_index]);
303 DPRINTFS(MinorMem, (&port),
"Faulting translation for fragment:"
304 " %d of request: %s\n",
305 expected_fragment_index, *inst);
307 setState(Translated);
308 port.tryToSendToTransfers(
this);
309 }
else if (numTranslatedFragments == numFragments) {
310 makeFragmentPackets();
312 setState(Translated);
313 port.tryToSendToTransfers(
this);
316 assert(!translationEvent.scheduled());
317 port.cpu.schedule(translationEvent,
curTick());
323 LSQRequest(port_, inst_, isLoad_, data_, res_),
324 translationEvent(*this),
326 numInTranslationFragments(0),
327 numTranslatedFragments(0),
328 numIssuedFragments(0),
329 numRetiredFragments(0),
339 for (
auto i = fragmentRequests.begin();
340 i != fragmentRequests.end();
i++)
345 for (
auto i = fragmentPackets.begin();
346 i != fragmentPackets.end();
i++)
355 Addr base_addr = request.getVaddr();
356 unsigned int whole_size = request.getSize();
357 unsigned int line_width = port.lineWidth;
359 unsigned int fragment_size;
374 unsigned int first_fragment_offset =
376 unsigned int last_fragment_size =
378 unsigned int first_fragment_size =
379 line_width - first_fragment_offset;
381 unsigned int middle_fragments_total_size =
382 whole_size - (first_fragment_size + last_fragment_size);
386 unsigned int middle_fragment_count =
387 middle_fragments_total_size / line_width;
389 numFragments = 1 + middle_fragment_count +
390 (last_fragment_size == 0 ? 0 : 1);
392 DPRINTFS(MinorMem, (&port),
"Dividing transfer into %d fragmentRequests."
393 " First fragment size: %d Last fragment size: %d\n",
394 numFragments, first_fragment_size,
395 (last_fragment_size == 0 ? line_width : last_fragment_size));
397 assert(((middle_fragment_count * line_width) +
398 first_fragment_size + last_fragment_size) == whole_size);
400 fragment_addr = base_addr;
401 fragment_size = first_fragment_size;
404 Addr end_addr = base_addr + whole_size;
406 for (
unsigned int fragment_index = 0; fragment_index < numFragments;
411 if (fragment_addr == base_addr) {
413 fragment_size = first_fragment_size;
415 if ((fragment_addr + line_width) > end_addr) {
417 fragment_size = end_addr - fragment_addr;
418 is_last_fragment =
true;
421 fragment_size = line_width;
429 fragment_addr, fragment_size, request.getFlags(),
433 DPRINTFS(MinorMem, (&port),
"Generating fragment addr: 0x%x size: %d"
434 " (whole request addr: 0x%x size: %d) %s\n",
435 fragment_addr, fragment_size, base_addr, whole_size,
436 (is_last_fragment ?
"last fragment" :
""));
438 fragment_addr += fragment_size;
440 fragmentRequests.push_back(fragment);
447 Addr base_addr = request.getVaddr();
449 DPRINTFS(MinorMem, (&port),
"Making packets for request: %s\n", *inst);
451 for (
unsigned int fragment_index = 0; fragment_index < numFragments;
456 DPRINTFS(MinorMem, (&port),
"Making packet %d for request: %s"
458 fragment_index, *inst,
459 (fragment->
hasPaddr() ?
"has paddr" :
"no paddr"),
463 unsigned int fragment_size = fragment->
getSize();
465 uint8_t *request_data = NULL;
470 request_data =
new uint8_t[fragment_size];
471 std::memcpy(request_data,
data + (fragment_addr - base_addr),
480 fragmentPackets.push_back(fragment_packet);
482 request.setFlags(fragment->
getFlags());
488 request.setPaddr(fragmentRequests[0]->getPaddr());
497 makeFragmentRequests();
499 numInTranslationFragments = 0;
500 numTranslatedFragments = 0;
510 sendNextFragmentToTranslation();
516 assert(numIssuedFragments < numFragments);
518 return fragmentPackets[numIssuedFragments];
524 assert(numIssuedFragments < numFragments);
526 numIssuedFragments++;
532 assert(numRetiredFragments < numFragments);
534 DPRINTFS(MinorMem, (&port),
"Retiring fragment addr: 0x%x size: %d"
535 " offset: 0x%x (retired fragment num: %d) %s\n",
539 (fault ==
NoFault ?
"" : fault->name()));
541 numRetiredFragments++;
546 DPRINTFS(MinorMem, (&port),
"Skipping this fragment\n");
547 }
else if (response->
isError()) {
549 DPRINTFS(MinorMem, (&port),
"Fragment has an error, skipping\n");
551 packet->copyError(response);
558 data =
new uint8_t[request.getSize()];
571 if (skipped && !hasPacketsInMemSystem()) {
572 DPRINTFS(MinorMem, (&port),
"Completed skipped burst\n");
574 if (packet->needsResponse())
575 packet->makeResponse();
578 if (numRetiredFragments == numFragments)
581 if (!skipped && isComplete()) {
582 DPRINTFS(MinorMem, (&port),
"Completed burst %d\n", packet != NULL);
584 DPRINTFS(MinorMem, (&port),
"Retired packet isRead: %d isWrite: %d"
585 " needsResponse: %d packetSize: %s requestSize: %s responseSize:"
586 " %s\n", packet->isRead(), packet->isWrite(),
587 packet->needsResponse(), packet->getSize(), request.getSize(),
593 data =
new uint8_t[request.getSize()];
597 DPRINTFS(MinorMem, (&port),
"Copying read data\n");
598 std::memcpy(packet->getPtr<uint8_t>(),
data, request.getSize());
600 packet->makeResponse();
609 unsigned int fragment_index = numTranslatedFragments;
614 DPRINTFS(MinorMem, (&port),
"Submitting DTLB request for fragment: %d\n",
617 port.numAccessesInDTLB++;
618 numInTranslationFragments++;
621 fragmentRequests[fragment_index], thread,
this, (isLoad ?
629 return slots.size() < numSlots;
635 auto found = std::find(slots.begin(), slots.end(), request);
637 if (found != slots.end()) {
638 DPRINTF(MinorMem,
"Deleting request: %s %s %s from StoreBuffer\n",
639 request, *found, *(request->
inst));
650 warn(
"%s: store buffer insertion without space to insert from"
651 " inst: %s\n",
name(), *(request->
inst));
654 DPRINTF(MinorMem,
"Pushing store: %s into store buffer\n", request);
656 numUnissuedAccesses++;
661 slots.push_back(request);
670 unsigned int &found_slot)
672 unsigned int slot_index = slots.size() - 1;
673 auto i = slots.rbegin();
682 slot->
inst->id.threadId == request->
inst->id.threadId) {
686 DPRINTF(MinorMem,
"Forwarding: slot: %d result: %s thisAddr:"
687 " 0x%x thisSize: %d slotAddr: 0x%x slotSize: %d\n",
688 slot_index, coverage,
692 found_slot = slot_index;
707 unsigned int slot_number)
709 assert(slot_number < slots.size());
720 Addr addr_offset = load_addr - store_addr;
724 DPRINTF(MinorMem,
"Forwarding %d bytes for addr: 0x%x from store buffer"
725 " slot: %d addr: 0x%x addressOffset: 0x%x\n",
726 load_size, load_addr, slot_number,
727 store_addr, addr_offset);
730 void *store_packet_data = store->
packet->
getPtr<uint8_t>() + addr_offset;
732 std::memcpy(load_packet_data, store_packet_data, load_size);
741 numUnissuedAccesses--;
747 DPRINTF(MinorMem,
"StoreBuffer step numUnissuedAccesses: %d\n",
748 numUnissuedAccesses);
752 while (!slots.empty() &&
753 slots.front()->isComplete() && slots.front()->isBarrier())
757 DPRINTF(MinorMem,
"Clearing barrier for inst: %s\n",
760 numUnissuedAccesses--;
761 lsq.clearMemBarrier(barrier->
inst);
767 auto i = slots.begin();
769 unsigned int issue_count = 0;
779 issue_count < storeLimitPerCycle &&
780 lsq.canSendToMemorySystem() &&
785 DPRINTF(MinorMem,
"Considering request: %s, sentAllPackets: %d"
796 DPRINTF(MinorMem,
"Trying to send request: %s to memory"
797 " system\n", *(request->
inst));
799 if (lsq.tryToSend(request)) {
800 countIssuedStore(request);
820 if (!inst->inStoreBuffer) {
834 unsigned int size = slots.size();
836 std::ostringstream
os;
848 while (i < numSlots) {
856 MINORTRACE(
"addr=%s num_unissued_stores=%d\n", os.str(),
857 numUnissuedAccesses);
864 DPRINTF(MinorMem,
"Request needs retry, not issuing to"
865 " memory until retry arrives\n");
870 DPRINTF(MinorMem,
"Request still in translation, not issuing to"
881 DPRINTF(MinorMem,
"Request not at front of requests queue, can't"
882 " issue to memory\n");
887 DPRINTF(MinorMem,
"No space to insert request into transfers"
893 DPRINTF(MinorMem,
"Passing a %s transfer on to transfers"
894 " queue\n", (request->
isComplete() ?
"completed" :
"failed"));
905 DPRINTF(MinorMem,
"Request's inst. is from the wrong stream,"
906 " waiting for responses before aborting request\n");
908 DPRINTF(MinorMem,
"Request's inst. is from the wrong stream,"
909 " aborting request\n");
918 if (request->
inst->staticInst->isPrefetch()) {
919 DPRINTF(MinorMem,
"Not signalling fault for faulting prefetch\n");
921 DPRINTF(MinorMem,
"Moving faulting request into the transfers"
929 bool is_load = request->
isLoad;
937 DPRINTF(MinorMem,
"Load request with stores still in transfers"
938 " queue, stalling\n");
946 DPRINTF(MinorMem,
"Moving store into transfers queue\n");
956 DPRINTF(MinorMem,
"Memory access not the head inst., can't be"
957 " sure it can be performed, not issuing\n");
961 unsigned int forwarding_slot = 0;
966 DPRINTF(MinorMem,
"Memory access can receive forwarded data"
967 " from the store buffer, need to wait for store buffer to"
977 bool do_access =
true;
982 unsigned int forwarding_slot = 0;
987 switch (forwarding_result) {
998 DPRINTF(MinorMem,
"Load partly satisfied by store buffer"
999 " data. Must wait for the store to complete\n");
1003 DPRINTF(MinorMem,
"No forwardable data from store buffer\n");
1010 DPRINTF(MinorMem,
"Can't send request to memory system yet\n");
1027 DPRINTF(MinorMem,
"Not perfoming a memory "
1028 "access for store conditional\n");
1037 DPRINTF(MinorMem,
"Can't send request to memory system yet\n");
1063 DPRINTF(MinorMem,
"Can't send request: %s yet, no space in memory\n",
1068 DPRINTF(MinorMem,
"Trying to send request: %s addr: 0x%x\n",
1077 cpu.getContext(
cpu.contextToThread(
1081 DPRINTF(MinorMem,
"IPR read inst: %s\n", *(request->
inst));
1084 DPRINTF(MinorMem,
"IPR write inst: %s\n", *(request->
inst));
1092 DPRINTF(MinorMem,
"IPR access has another packet: %s\n",
1101 DPRINTF(MinorMem,
"Sent data memory request\n");
1109 switch (request->
state) {
1130 "Sending data memory request - needs retry\n");
1136 switch (request->
state) {
1188 DPRINTF(MinorMem,
"Received response packet inst: %s"
1189 " addr: 0x%x cmd: %s\n",
1196 DPRINTF(MinorMem,
"Received error response packet: %s\n",
1200 switch (request->
state) {
1206 DPRINTF(MinorMem,
"Has outstanding packets?: %d %d\n",
1221 DPRINTF(MinorMem,
"Completed transfer for barrier: %s"
1222 " leaving the request as it is also a barrier\n",
1248 DPRINTF(MinorMem,
"Received retry request\n");
1293 LSQ::LSQ(std::string name_, std::string dcache_port_name_,
1295 unsigned int in_memory_system_limit,
unsigned int line_width,
1296 unsigned int requests_queue_size,
unsigned int transfers_queue_size,
1297 unsigned int store_buffer_size,
1298 unsigned int store_buffer_cycle_store_limit) :
1306 lineWidth((line_width == 0 ?
cpu.cacheLineSize() : line_width)),
1307 requests(name_ +
".requests",
"addr", requests_queue_size),
1308 transfers(name_ +
".transfers",
"addr", transfers_queue_size),
1310 *this, store_buffer_size, store_buffer_cycle_store_limit),
1318 if (in_memory_system_limit < 1) {
1319 fatal(
"%s: executeMaxAccessesInMemory must be >= 1 (%d)\n", name_,
1320 in_memory_system_limit);
1323 if (store_buffer_cycle_store_limit < 1) {
1324 fatal(
"%s: executeLSQMaxStoreBufferStoresPerCycle must be"
1325 " >= 1 (%d)\n", name_, store_buffer_cycle_store_limit);
1328 if (requests_queue_size < 1) {
1329 fatal(
"%s: executeLSQRequestsQueueSize must be"
1330 " >= 1 (%d)\n", name_, requests_queue_size);
1333 if (transfers_queue_size < 1) {
1334 fatal(
"%s: executeLSQTransfersQueueSize must be"
1335 " >= 1 (%d)\n", name_, transfers_queue_size);
1338 if (store_buffer_size < 1) {
1339 fatal(
"%s: executeLSQStoreBufferSize must be"
1340 " >= 1 (%d)\n", name_, store_buffer_size);
1386 if (request->
inst->id == inst->id) {
1389 bool to_store_buffer = request->
state ==
1392 if ((complete && !(request->
isBarrier() && !can_store)) ||
1393 (to_store_buffer && can_store))
1401 DPRINTF(MinorMem,
"Found matching memory response for inst: %s\n",
1404 DPRINTF(MinorMem,
"No matching memory response for inst: %s\n",
1425 DPRINTF(MinorMem,
"Deleting %s request: %s\n",
1426 (response->
isLoad ?
"load" :
"store"),
1438 DPRINTF(MinorMem,
"Sending store: %s to store buffer\n",
1441 request->
inst->inStoreBuffer =
true;
1463 ret = have_translated_requests ||
1468 DPRINTF(Activity,
"Need to tick\n");
1483 uint8_t *request_data = NULL;
1485 DPRINTF(MinorMem,
"Pushing request (%s) addr: 0x%x size: %d flags:"
1486 " 0x%x%s lineWidth : 0x%x\n",
1487 (isLoad ?
"load" :
"store"), addr, size, flags,
1488 (needs_burst ?
" (needs burst)" :
""),
lineWidth);
1493 request_data =
new uint8_t[
size];
1496 std::memset(request_data, 0, size);
1498 std::memcpy(request_data, data, size);
1504 *
this, inst, isLoad, request_data, res);
1507 *
this, inst, isLoad, request_data, res);
1510 if (inst->traceData)
1511 inst->traceData->setMem(addr, size, flags);
1513 int cid =
cpu.
threads[inst->id.threadId]->getTC()->contextId();
1516 addr, size, flags,
cpu.dataMasterId(),
1518 inst->pc.instAddr());
1534 MINORTRACE(
"state=%s in_tlb_mem=%d/%d stores_in_transfers=%d"
1535 " lastMemBarrier=%d\n",
1544 unsigned int store_buffer_size,
1545 unsigned int store_limit_per_cycle) :
1546 Named(name_), lsq(lsq_),
1547 numSlots(store_buffer_size),
1548 storeLimitPerCycle(store_limit_per_cycle),
1550 numUnissuedAccesses(0)
1575 assert(inst->isInst() && inst->staticInst->isMemBarrier());
1593 assert(packet == NULL);
1609 os <<
"MemoryRunning";
1612 os <<
"MemoryNeedsRetry";
1615 os <<
"MemoryState-" <<
static_cast<int>(
state);
1627 for (
ThreadID tid = 0; tid <
cpu.numThreads; tid++) {
1628 if (
cpu.getCpuAddrMonitor(tid)->doMonitor(pkt)) {
1634 for (
ThreadID tid = 0; tid <
cpu.numThreads; tid++) {
1650 for (
ThreadID tid = 0; tid <
cpu.numThreads; tid++) {
1651 if (tid != req_tid) {
1652 if (
cpu.getCpuAddrMonitor(tid)->doMonitor(pkt)) {
MemoryState
State of memory access for head access.
void makeFragmentPackets()
Make the packets to go with the requests so they can be sent to the memory system.
virtual bool sentAllPackets()=0
Have all packets been sent?
void setState(LSQRequestState new_state)
Set state and output trace output.
MinorDynInstPtr inst
Instruction which made this request.
SingleDataRequest is used for requests that don't fragment.
const std::string & name() const
unsigned int numAccessesIssuedToMemory
The number of accesses which have been issued to the memory system but have not been committed/discar...
decltype(nullptr) constexpr NoFault
void pop()
Pop the head item.
LSQQueue transfers
Once issued to memory (or, for stores, just had their state changed to StoreToStoreBuffer) LSQRequest...
Top level definition of the Minor in-order CPU model.
PacketDataPtr data
Dynamically allocated and populated data carried for building write packets.
void makeFragmentRequests()
Make all the Requests for this transfer's fragments so that those requests can be sent for address tr...
StoreBuffer(std::string name_, LSQ &lsq_, unsigned int store_buffer_size, unsigned int store_limit_per_cycle)
LSQQueue requests
requests contains LSQRequests which have been issued to the TLB by calling ExecContext::readMem/write...
friend std::ostream & operator<<(std::ostream &os, MemoryState state)
Print MemoryState values as shown in the enum definition.
void finish(const Fault &fault_, RequestPtr request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB interace.
ContextID contextId() const
Accessor function for context ID.
void step()
Try to issue more stores to memory.
bool isStrictlyOrdered() const
void popResponse(LSQRequestPtr response)
Sanity check and pop the head response.
void issuedMemBarrierInst(MinorDynInstPtr inst)
A memory barrier instruction has been issued, remember its execSeqNum that we can avoid issuing memor...
void makePacket()
Make a packet to use with the memory transaction.
bool instIsHeadInst(MinorDynInstPtr inst)
Returns true if the given instruction is at the head of the inFlightInsts instruction queue...
void finish(const Fault &fault_, RequestPtr request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB response interface.
void pushFailedRequest(MinorDynInstPtr inst)
Push a predicate failed-representing request into the queues just to maintain commit order...
All the fun of executing instructions from Decode and sending branch/new instruction stream info...
void wakeupOnEvent(unsigned int stage_id)
Interface for stages to signal that they have become active after a callback or eventq event where th...
unsigned int numStoresInTransfers
The number of stores in the transfers queue.
Fault fault
Fault generated performing this request.
PacketPtr makePacketForRequest(Request &request, bool isLoad, Packet::SenderState *sender_state, PacketDataPtr data)
Make a suitable packet for the given request.
virtual bool isBarrier()
Is this a request a barrier?
bool isMmappedIpr() const
void minorTrace() const
Report queue contents for MinorTrace.
bool handleLockedWrite(XC *xc, Request *req, Addr cacheBlockMask)
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
void setContext(ContextID context_id)
Set up Context numbers.
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
void retireResponse(PacketPtr packet_)
For loads, paste the response data into the main response packet.
This is a write that is targeted and zeroing an entire cache block.
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the slave port by calling its corresponding receive function...
unsigned int numAccessesInMemorySystem
Count of the number of mem.
unsigned int unreservedRemainingSpace() const
Like remainingSpace but does not count reserved spaces.
void reportData(std::ostream &os) const
MinorTrace report interface.
LSQRequestPtr findResponse(MinorDynInstPtr inst)
Returns a response if it's at the head of the transfers queue and it's either complete or can be sent...
void sendNextFragmentToTranslation()
Part of the address translation loop, see startAddTranslation.
Cycles handleIprRead(ThreadContext *xc, Packet *pkt)
Helper function to handle IPRs when the target architecture doesn't need its own IPR handling...
Cycles handleIprWrite(ThreadContext *xc, Packet *pkt)
Helper function to handle IPRs when the target architecture doesn't need its own IPR handling...
ThreadContext is the external interface to all thread state for anything outside of the CPU...
T * getPtr()
get a pointer to the data ptr.
ExecContext bears the exec_context interface for Minor.
struct ip6_opt_fragment fragment
ExecContext bears the exec_context interface for Minor.
Derived SenderState to carry data access info.
bool canInsert() const
Can a new request be inserted into the queue?
static AddrRangeCoverage containsAddrRangeOf(Addr req1_addr, unsigned int req1_size, Addr req2_addr, unsigned int req2_size)
Does address range req1 (req1_addr to req1_addr + req1_size - 1) fully cover, partially cover or not ...
void handleLockedSnoop(XC *xc, PacketPtr pkt, Addr cacheBlockMask)
std::vector< InstSeqNum > lastMemBarrier
Most recent execSeqNum of a memory barrier instruction or 0 if there are no in-flight barriers...
void pushRequest(MinorDynInstPtr inst, bool isLoad, uint8_t *data, unsigned int size, Addr addr, Request::Flags flags, uint64_t *res)
Single interface for readMem/writeMem to issue requests into the LSQ.
static Addr addrBlockOffset(Addr addr, unsigned int block_size)
Returns the offset of addr into an aligned a block of size block_size.
Request for doing barrier accounting in the store buffer.
void completeMemBarrierInst(MinorDynInstPtr inst, bool committed)
Complete a barrier instruction.
Request request
The underlying request of this LSQRequest.
Tick curTick()
The current simulated tick.
bool empty() const
Is the queue empty?
MemoryState state
Retry state of last issued memory transfer.
ElemType & front()
Head value.
virtual TheISA::TLB * getDTBPtr()=0
void startAddrTranslation()
Start a loop of do { sendNextFragmentToTranslation ; translateTiming ; finish } while (numTranslatedF...
bool issuedToMemory
This in an access other than a normal cacheable load that's visited the memory system.
virtual void retireResponse(PacketPtr packet_)=0
Retire a response packet into the LSQRequest packet possibly completing this transfer.
bool tryToSend(LSQRequestPtr request)
Try to send (or resend) a memory request's next/only packet to the memory system. ...
bool isLoad
Load/store indication used for building packet.
virtual void stepToNextPacket()=0
Step to the next packet for the next call to getHeadPacket.
const RequestPtr req
A pointer to the original request.
static bool transferNeedsBurst(Addr addr, unsigned int size, unsigned int block_size)
Returns true if the given [addr .
bool canSendToMemorySystem()
Can a request be sent to the memory system.
virtual void startAddrTranslation()=0
Start the address translation process for this request.
bool isDrained() const
Drained if there is absolutely nothing left in the buffer.
FailedDataRequest represents requests from instructions that failed their predicates but need to ride...
AddrRangeCoverage canForwardDataToLoad(LSQRequestPtr request, unsigned int &found_slot)
Look for a store which satisfies the given load.
bool needsToBeSentToStoreBuffer()
This request, once processed by the requests/transfers queues, will need to go to the store buffer...
void clearMemBarrier(MinorDynInstPtr inst)
Clear a barrier (if it's the last one marked up in lastMemBarrier)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
MinorCPU & cpu
My owner(s)
bool isDrained()
Is there nothing left in the LSQ.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
unsigned int numUnissuedStores()
Number of stores in the store buffer which have not been completely issued to the memory system...
void tryToSendToTransfers(LSQRequestPtr request)
Try and issue a memory access for a translated request at the head of the requests queue...
A virtual base opaque structure used to hold state associated with the packet (e.g., an MSHR), specific to a MemObject that sees the packet.
LSQRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
AddrRangeCoverage
Coverage of one address range with another.
void step()
Step checks the queues to see if their are issuable transfers which were not otherwise picked up by t...
A load/store queue that allows outstanding reads and writes.
unsigned int numAccessesInDTLB
Number of requests in the DTLB in the requests queue.
TheISA::PCState pcState()
static const int NumArgumentRegs M5_VAR_USED
Flags getFlags()
Accessor for flags.
int16_t ThreadID
Thread index/ID type.
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
void sendStoreToStoreBuffer(LSQRequestPtr request)
A store has been committed, please move it to the store buffer.
LSQRequestPtr retryRequest
The request (from either requests or the store buffer) which is currently waiting have its memory acc...
bool recvTimingResp(PacketPtr pkt)
Memory interface.
void insert(LSQRequestPtr request)
Insert a request at the back of the queue.
bool instIsRightStream(MinorDynInstPtr inst)
Does the given instruction have the right stream sequence number to be committed? ...
GenericISA::SimplePCState< MachInst > PCState
MemCmd cmd
The command field of the packet.
Addr cacheBlockMask
Address Mask for a cache block (e.g.
void wakeup(ThreadID tid) override
void setVirt(int asid, Addr vaddr, unsigned size, Flags flags, MasterID mid, Addr pc)
Set up a virtual (e.g., CPU) request in a previously allocated Request object.
std::vector< Minor::MinorThread * > threads
These are thread state-representing objects for this CPU.
LSQ(std::string name_, std::string dcache_port_name_, MinorCPU &cpu_, Execute &execute_, unsigned int max_accesses_in_memory_system, unsigned int line_width, unsigned int requests_queue_size, unsigned int transfers_queue_size, unsigned int store_buffer_size, unsigned int store_buffer_cycle_store_limit)
void push(ElemType &data)
Push an element into the buffer if it isn't a bubble.
#define MINORTRACE(...)
DPRINTFN for MinorTrace reporting.
const std::string & toString() const
Return the string to a cmd given by idx.
static PacketPtr createRead(const RequestPtr req)
Constructor-like methods that return Packets based on Request objects.
The constructed pipeline.
virtual PacketPtr getHeadPacket()=0
Get the next packet to issue for this request.
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
void pushSenderState(SenderState *sender_state)
Push a new sender state to the packet and make the current sender state the predecessor of the new on...
T * findNextSenderState() const
Go through the sender state stack and return the first instance that is of type T (as determined by a...
SenderState * popSenderState()
Pop the top of the state stack and return a pointer to it.
const T * getConstPtr() const
const unsigned int inMemorySystemLimit
Maximum number of in-flight accesses issued to the memory system.
const unsigned int lineWidth
Memory system access width (and snap) in bytes.
MinorCPU is an in-order CPU model with four fixed pipeline stages:
bool isInvalidate() const
static PacketPtr createWrite(const RequestPtr req)
bool isComplete() const
Has this request been completed.
void threadSnoop(LSQRequestPtr request)
Snoop other threads monitors on memory system accesses.
void setSkipped()
Set this request as having been skipped before a memory transfer was attempt.
void stepToNextPacket()
Step on numIssuedFragments.
std::shared_ptr< FaultBase > Fault
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
void startAddrTranslation()
Send single translation request.
void allocate()
Allocate memory for the packet.
void deleteRequest(LSQRequestPtr request)
Delete the given request and free the slot it occupied.
void recvTimingSnoopReq(PacketPtr pkt)
bool hasPaddr() const
Accessor for paddr.
void countIssuedStore(LSQRequestPtr request)
Count a store being issued to memory by decrementing numUnissuedAccesses.
void handleLockedRead(XC *xc, Request *req)
void moveFromRequestsToTransfers(LSQRequestPtr request)
Move a request between queues.
void forwardStoreData(LSQRequestPtr load, unsigned int slot_number)
Fill the given packet with appropriate date from slot slot_number.
virtual bool hasPacketsInMemSystem()=0
True if this request has any issued packets in the memory system and so can't be interrupted until it...
SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
bool needsToTick()
May need to be ticked next cycle as one of the queues contains an actionable transfers or address tra...