Load-Store Queue LSQ
Sub-module List
Sub-module | Description |
---|---|
VirtualLoadQueue | TODO |
LoadQueueRAR | TODO |
LoadQueueRAW | TODO |
LoadQueueReplay | DONE |
LoadQueueUncache | TODO |
LoadExceptionBuffer | TODO |
StoreQueue | DONE |
Function Description
LSQ includes two parts, LoadQueue and StoreQueue, and has a wrapper layer to facilitate port connections. The primary function of the Lsqwrapper is just wiring.
- LoadQueue
- LoadQueueRAR: RAR violation check queue
- LoadQueueRAW: RAW violation check queue
- LoadQueueUncache: MMIO/Noncacheable load instruction processing queue
- LoadQueueReplay: Load instruction scheduling and re-dispatch queue
- LoadExceptionBuffer: Load instruction exception handling queue
- VirtualLoadQueue: Load instruction order maintenance queue
- StoreQueue
Feature 1: Update LqPtr for Load Instructions and SqPtr for Store Instructions
-
Due to timing effects, the allocation of LqPtr and SqPtr is split into two parts, as shown in the figure
LSQ Allocation - Dispatch stage
- Count the number of LoadFlow or StoreFlow for each instruction, and calculate LqPtr or SqPtr in a cumulative manner
- LSQ enqueue stage
- Calculate the accurate LqPtr or SqPtr in a cumulative manner based on the enqPtr maintained by LoadQueue or StoreQueue
- LsqEnqCtrl update logic
- If a pipeline flush occurs, update based on the number of flushed Load or Store instructions and the number of committed instructions
- If no pipeline flush occurs, but there is an allocation request, update based on the number of enqueued and committed instructions
- Otherwise, update based on the number of committed instructions
- Dispatch stage
Overall Block Diagram
\newpage
Interface Timing
Interface Timing Example for Load and Store Instruction Enqueue