GrantBuffer
Basic Functionality
GrantBuf receives tasks from MainPipe and forwards them based on the task type. It is mainly divided into: - Pre-fetch response (opcode = HintAck): Scheduled to enter the pre-fetch response queue pftRespQueue (size=10), dispatched to the prefetcher in FIFO order. - D channel response (opcode = Grant/GrantData/ReleaseAck): Scheduled to enter grantQueue (size=16), dispatched to the bus D channel in FIFO order; If it is Grant/GrantAck, its information also needs to be entered into the inflightGrant buffer (size=16) (indicating that Grant has been sent but GrantAck has not been received), waiting for L1 to return GrantAck from the E channel before clearing the information. - Merged request (task.mergeA = true): Performs both of the above actions simultaneously.
Feature 1: Blocking MainPipe Entry
GrantBuf will also provide [blocking information for the request entry] to ReqArb based on: [pipeline entry information + pipeline stage S1/S2/S3/S4/S5 status + internal pftRespQueue, inflightGrant, grantQueue status].
Statistics for 3 types of resources: - Insufficient GrantBuf resources: Number of occupied GrantBufs + number of potential GrantBufs in pipeline S1/S2/S3/S4/S5 (from sinkA or sinkC) > 16 - Insufficient E channel resources: inflightGrant + number of potential requests needing E channel return GrantAck in pipeline S1/S2/S3/S4/S5 (from sinkA) > 16 - Insufficient prefetch RespQueue resources: Number of occupied pftRespQueues + number of potential uses of preRespQueue in pipeline S1/S2/S3/S4/S5 (from sinkA) > 10
Conditions for blocking S1 channel entry into MainPipe: - A channel: Any of the above resource shortages. - B channel: As long as there is an unfinished operation in the inflightGrant buffer with the same address as the B channel. - C channel: GrantBuf resource shortage.
MSHR's 3 types of resource shortages (resource max number - 1): - GrantBuf resource shortage: Number of occupied GrantBufs + number of potential GrantBufs in pipeline S1/S2/S3/S4/S5 (from sinkA or sinkC) > 15 - E channel resource shortage: inflightGrant + number of potential requests needing E channel return GrantAck in pipeline S1/S2/S3/S4/S5 (from sinkA) > 15 - Prefetch RespQueue resource shortage: Number of occupied pftRespQueues + number of potential uses of preRespQueue in pipeline S1/S2/S3/S4/S5 (from sinkA) > 9
The blocking condition for MSHR entering Mainpipe is any one of the above 3 types.
Feature 2: Early Wake-up
The CustomL1Hint module in MainPipe will issue the l1Hint signal 3 cycles before GrantBuf dispatch to wake up missq in L1D$ early. GrantBuffer is responsible for providing resource information to block pipeline entry at S1, while MainPipe will accurately predict when to issue the l1Hint signal based on the scenario that has already entered the pipeline.
Feature 3: Handling Different Data Widths
For Grant/ReleaseAck containing one beat, they are dequeued from grantQueue and dispatched directly to the bus. For GrantData containing two beats, when dequeued from grantQueue, the first beat of data is dispatched directly to the bus, and the second beat of data is stored in grantBuf; subsequently, priority is given to sending data from grantBuf. After grantBuf has finished sending, the next element in grantQueue can be dequeued.
Overall Block Diagram