generated from riscv-software-src/template-riscv-code
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add L1 Instruction Cache #152
Closed
danbone
wants to merge
10
commits into
riscv-software-src:master
from
danbone:danbone/issue_143_icache
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
13edff8
Add L1 Instruction Cache
431e74e
Connect up ICache to Fetch
b09fd6c
Fix rename and issue tests accounting for icache latency
4dee506
Fix LSU test accounting for extra ICache latency
9c77264
Fix L2Cache tests. Change L2+MSS to use credit instead of ack
7fd5471
Add fetch block size, and buffer size parameters to Fetch
58a9f4c
Merge branch 'master' into danbone/issue_143_icache
danbone 063a6f3
Merge remote-tracking branch 'upstream/master' into danbone/issue_143…
50acbb1
update dcache comments on L2Cache credits
b020c81
Merge branch 'danbone/issue_143_icache' of https://github.com/danbone…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
project (core) | ||
add_library(core | ||
Core.cpp | ||
ICache.cpp | ||
Fetch.cpp | ||
Decode.cpp | ||
Rename.cpp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ namespace olympia { | |
in_lsu_lookup_req_.registerConsumerHandler | ||
(CREATE_SPARTA_HANDLER_WITH_DATA(DCache, getInstsFromLSU_, MemoryAccessInfoPtr)); | ||
|
||
in_l2cache_ack_.registerConsumerHandler | ||
(CREATE_SPARTA_HANDLER_WITH_DATA(DCache, getAckFromL2Cache_, uint32_t)); | ||
in_l2cache_credits_.registerConsumerHandler | ||
(CREATE_SPARTA_HANDLER_WITH_DATA(DCache, getCreditsFromL2Cache_, uint32_t)); | ||
|
||
in_l2cache_resp_.registerConsumerHandler | ||
(CREATE_SPARTA_HANDLER_WITH_DATA(DCache, getRespFromL2Cache_, MemoryAccessInfoPtr)); | ||
|
@@ -78,7 +78,9 @@ namespace olympia { | |
memory_access_info_ptr->setCacheState(MemoryAccessInfo::CacheState::HIT); | ||
}else{ | ||
memory_access_info_ptr->setCacheState(MemoryAccessInfo::CacheState::MISS); | ||
// Poll on dcache_l2cache_credits_ > 0 which means | ||
// DCache is blocking for now. Busy is set on miss, until the miss is | ||
// resolved by the L2. | ||
// For NB behaviour: Poll on dcache_l2cache_credits_ > 0 which means | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you would like to use If this comment relates to a future change rather the current behavior, please add a |
||
// that L2Cache can accept requests from DCache. | ||
// Provide a corresponsing backpressure mechanism up the pipeline. | ||
if(!busy_) { | ||
|
@@ -99,13 +101,8 @@ namespace olympia { | |
busy_ = false; | ||
} | ||
|
||
void DCache::getAckFromL2Cache_(const uint32_t &ack) { | ||
// When DCache sends the request to L2Cache for a miss, | ||
// This bool will be set to false, and Dcache should wait for ack from | ||
// L2Cache notifying DCache that there is space in it's dcache request buffer | ||
// | ||
// Set it to true so that the following misses from DCache can be sent out to L2Cache. | ||
dcache_l2cache_credits_ = ack; | ||
void DCache::getCreditsFromL2Cache_(const uint32_t &ack) { | ||
danbone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dcache_l2cache_credits_ += ack; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the planned documentation, can you please include a list of input and output ports of the Icache and what do they represent. It would be helpful to understand this part of code changes.