get_cache_assoc() : Unsure how to proceed

175 views
Skip to first unread message

karsonn

unread,
Nov 1, 2020, 5:15:45 PM11/1/20
to cmpt-295-sfu
SFU ID: 301362267
Github username: kqrse
Line and file: N/A
Expected behavior: N/A
Observed behavior: N/A
Question: 
For get_cache_assoc(), how exactly are we supposed to get the associativity of a cache, given that we can't use get_block_size()? All of the formulas regarding cache properties seem to at least require the block size (given the rest of the available information we have) in order to calculate the associativity. 

Unless there is an alternative method of obtaining the associativity through using access_cache() and observing the hit and misses? I've watched the lecture and lab videos, however I'm uncertain as to how to proceed. Would it be possible if I could be pointed in the right direction please?

Thank you.

Arrvindh Shriraman

unread,
Nov 1, 2020, 11:37:03 PM11/1/20
to cmpt-295-sfu
Look at the function parameters. That is your hint.
You first need to fill get_block_size, get_cache_size and then get_cache_assoc.
get_cache_size needs block_Size which will be passed by us in as a parameter
get_cache_assoc only needs to know the cache_size which again we pass in as a parameter

For get_cache_assoc. Think conflict misses; how can you access the cache to create conflict misses.
How do you detect whether a miss (i.e., access_cache() returned false). and that was due to a conflict miss (as opposed to a capacity miss). 

See this video



- Think how can you separate between 
Reply all
Reply to author
Forward
0 new messages