Go to the documentation of this file.
45 #ifndef __CPU_MINOR_NEW_LSQ_HH__
46 #define __CPU_MINOR_NEW_LSQ_HH__
216 Addr req1_addr,
unsigned int req1_size,
217 Addr req2_addr,
unsigned int req2_size);
290 {
fatal(
"No packets in a SpecialDataRequest"); }
374 bool isLoad_,
PacketDataPtr data_ = NULL, uint64_t *res_ = NULL) :
375 LSQRequest(port_, inst_, isLoad_, data_, res_),
420 uint64_t *res_ = NULL);
485 unsigned int store_buffer_size,
486 unsigned int store_limit_per_cycle);
504 unsigned int &found_slot);
640 LSQ(std::string name_, std::string dcache_port_name_,
642 unsigned int max_accesses_in_memory_system,
unsigned int line_width,
643 unsigned int requests_queue_size,
unsigned int transfers_queue_size,
644 unsigned int store_buffer_size,
645 unsigned int store_buffer_cycle_store_limit);
BarrierDataRequest(LSQ &port_, MinorDynInstPtr inst_)
MinorCPU::MinorCPUPort & getDcachePort()
Return the raw-bindable port.
#define fatal(...)
This implements a cprintf based fatal() function.
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
SplitDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB interace.
void popResponse(LSQRequestPtr response)
Sanity check and pop the head response.
std::vector< RequestPtr > fragmentRequests
Fragment Requests corresponding to the address ranges of each fragment.
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.
bool packetInFlight
Has my only packet been sent to the memory system but has not yet been responded to.
MinorCPU & cpu
The enclosing cpu.
unsigned int numTranslatedFragments
Number of fragments that have completed address translation, (numTranslatedFragments + numInTranslati...
unsigned int numAccessesIssuedToMemory
The number of accesses which have been issued to the memory system but have not been committed/discar...
uint64_t * res
Res from pushRequest.
void pushFailedRequest(MinorDynInstPtr inst)
Push a predicate failed-representing request into the queues just to maintain commit order.
void tryToSendToTransfers(LSQRequestPtr request)
Try and issue a memory access for a translated request at the head of the requests queue.
int16_t ThreadID
Thread index/ID type.
LSQRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
bool skippedMemAccess()
Was no memory access attempted for this request?
LSQQueue transfers
Once issued to memory (or, for stores, just had their state changed to StoreToStoreBuffer) LSQRequest...
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB response interface.
void reportData(std::ostream &os) const
MinorTrace report interface.
unsigned int numAccessesInDTLB
Number of requests in the DTLB in the requests queue.
void retireResponse(PacketPtr packet_)
For loads, paste the response data into the main response packet.
unsigned int numAccessesInMemorySystem
Count of the number of mem.
FailedDataRequest(LSQ &port_, MinorDynInstPtr inst_)
PacketPtr makePacketForRequest(const RequestPtr &request, bool isLoad, Packet::SenderState *sender_state, PacketDataPtr data)
Make a suitable packet for the given request.
void completeDisabledMemAccess()
void makePacket()
Make a packet to use with the memory transaction.
bool accessesInFlight() const
Are there any accesses other than normal cached loads in the memory system or having received respons...
bool isLoad
Load/store indication used for building packet.
unsigned int numIssuedFragments
Number of fragments already issued (<= numFragments)
Fault pushRequest(MinorDynInstPtr inst, bool isLoad, uint8_t *data, unsigned int size, Addr addr, Request::Flags flags, uint64_t *res, AtomicOpFunctorPtr amo_op, const std::vector< bool > &byte_enable=std::vector< bool >())
Single interface for readMem/writeMem/amoMem to issue requests into the LSQ.
void step()
Step checks the queues to see if their are issuable transfers which were not otherwise picked up by t...
MinorCPU & cpu
My owner(s)
std::shared_ptr< Request > RequestPtr
void markDelayed()
BaseTLB::Translation interface.
unsigned int numFragments
Number of fragments this request is split into.
unsigned int unreservedRemainingSpace() const
Like remainingSpace but does not count reserved spaces.
virtual void stepToNextPacket()=0
Step to the next packet for the next call to getHeadPacket.
const unsigned int storeLimitPerCycle
Maximum number of stores that can be issued per cycle.
virtual bool hasPacketsInMemSystem()=0
True if this request has any issued packets in the memory system and so can't be interrupted until it...
Addr cacheBlockMask
Address Mask for a cache block (e.g.
A similar adaptor but for elements held by pointer ElemType should implement ReportIF.
void startAddrTranslation()
Send single translation request.
bool hasPacketsInMemSystem()
Never sends any requests.
bool isTranslationDelayed
Address translation is delayed due to table walk.
unsigned int numInTranslationFragments
Number of fragments in the address translation mechanism.
bool canRequest()
Is their space in the request queue to be able to push a request by issuing an isMemRef instruction.
PacketDataPtr data
Dynamically allocated and populated data carried for building write packets.
unsigned int numRetiredFragments
Number of fragments retired back to this request.
void completeMemBarrierInst(MinorDynInstPtr inst, bool committed)
Complete a barrier instruction.
bool sentAllPackets()
Have we stepped past the end of fragmentPackets?
void insert(LSQRequestPtr request)
Insert a request at the back of the queue.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
virtual bool sentAllPackets()=0
Have all packets been sent?
void startAddrTranslation()
Start a loop of do { sendNextFragmentToTranslation ; translateTiming ; finish } while (numTranslatedF...
ThreadContext is the external interface to all thread state for anything outside of the CPU.
void forwardStoreData(LSQRequestPtr load, unsigned int slot_number)
Fill the given packet with appropriate date from slot slot_number.
void finish(const Fault &fault_, const RequestPtr &request_, ThreadContext *tc, BaseTLB::Mode mode)
TLB interace.
A virtual base opaque structure used to hold state associated with the packet (e.g....
SpecialDataRequest(LSQ &port_, MinorDynInstPtr inst_)
MinorCPU is an in-order CPU model with four fixed pipeline stages:
void threadSnoop(LSQRequestPtr request)
Snoop other threads monitors on memory system accesses.
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
void makeFragmentRequests()
Make all the Requests for this transfer's fragments so that those requests can be sent for address tr...
Wrapper for a queue type to act as a pipeline stage input queue.
bool isDrained() const
Drained if there is absolutely nothing left in the buffer.
void makeFragmentPackets()
Make the packets to go with the requests so they can be sent to the memory system.
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
bool needsToBeSentToStoreBuffer()
This request, once processed by the requests/transfers queues, will need to go to the store buffer.
std::shared_ptr< FaultBase > Fault
MinorCPUPort(const std::string &name_, MinorCPU &cpu_)
@ PartialAddrRangeCoverage
const unsigned int numSlots
Number of slots, this is a bound on the size of slots.
void recvTimingSnoopReq(PacketPtr pkt)
bool canPushIntoStoreBuffer() const
Must check this before trying to insert into the store buffer.
DcachePort(std::string name, LSQ &lsq_, MinorCPU &cpu)
unsigned int numUnissuedStores()
Number of stores in the store buffer which have not been completely issued to the memory system.
bool needsToTick()
May need to be ticked next cycle as one of the queues contains an actionable transfers or address tra...
bool sentAllPackets()
Has no packets to send.
Provide a non-protected base class for Minor's Ports as derived classes are created by Fetch1 and Exe...
bool isBarrier()
Is this a request a barrier?
void stepToNextPacket()
Step on numIssuedFragments.
void minorTrace() const
Report queue contents for MinorTrace.
unsigned int numUnissuedAccesses
Number of occupied slots which have not yet issued a memory access.
void stepToNextPacket()
Remember that the packet has been sent.
bool tryToSend(LSQRequestPtr request)
Try to send (or resend) a memory request's next/only packet to the memory system.
bool canInsert() const
Can a new request be inserted into the queue?
void moveFromRequestsToTransfers(LSQRequestPtr request)
Move a request between queues.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
const std::string name() const
Return port name (for DPRINTF).
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 ...
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 sendNextFragmentToTranslation()
Part of the address translation loop, see startAddTranslation.
RequestPtr request
The underlying request of this LSQRequest.
void countIssuedStore(LSQRequestPtr request)
Count a store being issued to memory by decrementing numUnissuedAccesses.
Special request types that don't actually issue memory requests.
void tryToSuppressFault()
Instructions may want to suppress translation faults (e.g.
bool issuedToMemory
This in an access other than a normal cacheable load that's visited the memory system.
void stepToNextPacket()
Step on numIssuedFragments.
virtual PacketPtr getHeadPacket()=0
Get the next packet to issue for this request.
void recvTimingSnoopReq(PacketPtr pkt) override
Receive a timing snoop request from the peer.
LSQRequestPtr retryRequest
The request (from either requests or the store buffer) which is currently waiting have its memory acc...
AddrRangeCoverage canForwardDataToLoad(LSQRequestPtr request, unsigned int &found_slot)
Look for a store which satisfies the given load.
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
unsigned int numStoresInTransfers
The number of stores in the transfers queue.
bool isComplete() const
Has this request been completed.
FailedDataRequest represents requests from instructions that failed their predicates but need to ride...
void issuedMemBarrierInst(MinorDynInstPtr inst)
A memory barrier instruction has been issued, remember its execSeqNum that we can avoid issuing memor...
SingleDataRequest(LSQ &port_, MinorDynInstPtr inst_, bool isLoad_, PacketDataPtr data_=NULL, uint64_t *res_=NULL)
std::deque< LSQRequestPtr > slots
Queue of store requests on their way to memory.
bool sentAllPackets()
packetInFlight can become false again, so need to check packetSent
MinorDynInstPtr inst
Instruction which made this request.
virtual void retireResponse(PacketPtr packet_)=0
Retire a response packet into the LSQRequest packet possibly completing this transfer.
void sendStoreToStoreBuffer(LSQRequestPtr request)
A store has been committed, please move it to the store buffer.
void step()
Try to issue more stores to memory.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setSkipped()
Set this request as having been skipped before a memory transfer was attempt.
bool packetSent
Has the packet been at least sent to the memory system?
SingleDataRequest is used for requests that don't fragment.
bool hasPacketsInMemSystem()
True if this request has any issued packets in the memory system and so can't be interrupted until it...
std::vector< InstSeqNum > lastMemBarrier
Most recent execSeqNum of a memory barrier instruction or 0 if there are no in-flight barriers.
InstSeqNum getLastMemBarrier(ThreadID thread_id) const
Get the execSeqNum of the last issued memory barrier.
void startAddrTranslation()
Send single translation request.
void retireResponse(PacketPtr packet_)
Keep the given packet as the response packet LSQRequest::packet.
Request for doing barrier accounting in the store buffer.
AddrRangeCoverage
Coverage of one address range with another.
bool canSendToMemorySystem()
Can a request be sent to the memory system.
void setState(LSQRequestState new_state)
Set state and output trace output.
void recvFunctionalSnoop(PacketPtr pkt) override
Receive a functional snoop request packet from the peer.
LSQRequest * LSQRequestPtr
virtual void startAddrTranslation()=0
Start the address translation process for this request.
void deleteRequest(LSQRequestPtr request)
Delete the given request and free the slot it occupied.
virtual bool isBarrier()
Is this a request a barrier?
MemoryState
State of memory access for head access.
bool isDrained()
Is there nothing left in the LSQ.
MemoryState state
Retry state of last issued memory transfer.
Queue< LSQRequestPtr, ReportTraitsPtrAdaptor< LSQRequestPtr >, NoBubbleTraits< LSQRequestPtr > > LSQQueue
The LSQ consists of three queues: requests, transfers and the store buffer storeBuffer.
PacketPtr getHeadPacket()
Get the head packet as counted by numIssuedFragments.
bool hasPacketsInMemSystem()
Has packet been sent.
void clearMemBarrier(MinorDynInstPtr inst)
Clear a barrier (if it's the last one marked up in lastMemBarrier)
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...
const unsigned int inMemorySystemLimit
Maximum number of in-flight accesses issued to the memory system.
Derived SenderState to carry data access info.
const unsigned int lineWidth
Memory system access width (and snap) in bytes.
bool isSnooping() const override
Determine if this request port is snooping or not.
EventFunctionWrapper translationEvent
Event to step between translations.
bool recvTimingResp(PacketPtr pkt)
Memory interface.
StoreBuffer(std::string name_, LSQ &lsq_, unsigned int store_buffer_size, unsigned int store_limit_per_cycle)
std::vector< Packet * > fragmentPackets
Packets matching fragmentRequests to issue fragments to memory.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17