Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@msmssm
Copy link
Member

@msmssm msmssm commented Dec 8, 2020

This PR adds a feature to flush ICache and DCache on executing fence.i.
This feature enables fence.i to guarantee that all writes to memory before this instruction are visible to ICache access after this instruction.
In addition, fence.i can be used to trigger ICache and DCache flush by a programmer.

The flow to execute fence.i is as below.

  1. fence.i stalls in the rename stage until all the preceding ops are committed and all stores' data is written back to DCache.
  2. The fence.i enters the dispatch stage and all the following ops stall in the rename stage.
  3. When the fence.i is executed, it sends a cache flush request to CacheFlushManager and enters the ReplayQueue.
  4. CacheFlushManager makes ICache and DCache flush all data they have.
    • ICache resets all the valid bits of tagArray.
    • DCache writes all dirty cache lines to memory and resets tagArray, dirtyArray and dataArray.
  5. Once both ICache flush and DCache flush are completed, CacheFlushManager sends a completion signal to ReplayQueue and ReplayQueue issues the fence.i to the execution pipeline.
  6. Once the fence.i is re-executed and committed, the whole pipeline is flushed and the core starts to fetch the instruction behind the fence.i.

@msmssm msmssm requested a review from shioyadan December 8, 2020 02:43
@shioyadan shioyadan merged commit 85f8f0c into master Dec 8, 2020
@msmssm msmssm deleted the add-cache-flush-directmap branch December 9, 2020 01:51
shioyadan added a commit that referenced this pull request Dec 30, 2020
…ssociative-dcache-tree-lru

(Merge pull request #22 from rsd-devel/add-cache-flush-directmap

# Conflicts:
#	Processor/Src/Cache/CacheSystemTypes.sv
#	Processor/Src/Cache/DCache.sv
#	Processor/Src/Cache/DCacheIF.sv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants