-
Notifications
You must be signed in to change notification settings - Fork 549
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
i#4842 drcachesim unit test: Add cache_fifo unit test #5454
Merged
Conversation
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
When the current access is a hit and the currently accessed 'way' has a counter of 1, meaning it was the 'first accessed way' before this access, set the next 'way' as victim. This is because the currently accessed 'way' is no longer the 'first accessed way' and its counter is then cleared and the next 'way' is a victim.
derekbruening
requested changes
Apr 18, 2022
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
- Move get_block_index() to caching_device class - Call replace_which_way() from get_next_way_to_replace() in cache_fifo - Remove update to cache state in cache_fifo - Update test cases and expected replaced ways
bete0
commented
Apr 18, 2022
Some prior review comments have no response, and some only partial: e.g., access_and_check_ duplication. None are marked resolved. |
derekbruening
requested changes
Apr 20, 2022
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
- Adds comments explaining the difference between get_next_way_to_replace() and replace_which_way() - Calls get_next_way_to_replace() from replace_which_way() in caching_device as opposed to other way around - Makes get_next_way_to_replace() a const - Updates test cases
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
- Change line_idx args to block_idx for consistencny - Remove redundant comment - Make get_block_index(), compute_tag() and compute_block_idx() const - Remove cache_lru_test_t and cache_fifo_test_t since we have cache_policy_test_t template - Add block_indices_are_identical helper method - Update logic in tag comparison loop - Update comment in unit_test_cache_fifo_four_way() (s/E/A/)
derekbruening
approved these changes
May 24, 2022
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
clients/drcachesim/tests/cache_replacement_policy_unit_test.cpp
Outdated
Show resolved
Hide resolved
- Add comments to tags_are_different() that a quadratic solution is ok - Create a vector that holds test addresses
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds unit tests for FIFO cache simulator
Adds a method get_next_way_to_replace() that just returns the victim 'way'
without a side effect on the cache state. This makes unit testing the cache
replacement policies convenient and avoids unexpected behavior.
Adds cache_policy_test_t template for testing multiple cache replacement policies.
Adds get_block_index() method that returns the block index for a given
addr_t address.
Issue: #4842, #5456