Hello!
First of all I would like to ask what does it actually mean the parameter NumCaches in vex.cfg?
I would like to see if I understood well how the memory hierarchy parameters work.
We have 2 type of caches: Instruction and Data Caches (I disregard the Stream Buffer).
The parameters for the data cache are (for ICache they are similar):
lg2CacheSize
lg2LineSize
lg2Sets
These parameters are defined in the book.
Let's say we have:
lg2CacheSize=17
lg2LineSize=10
lg2Sets=5
This means we have a data cache with the following properties:
- it has a size of 128 KBytes
- with a line size of 1024 bytes
- with 32 Associative Sets with 2^(17-10-5)=2^2=4 lines/ways
As I can see the following inequation must hold, for the obvious reason that we can't have less than one way/line per set:
lg2CacheSize>=lg2Sets+lg2LineSize
(if lg2CacheSize=lg2Sets+lg2LineSize then we have sets of only 1 way, so we have a directly-maped cache).
The last question would be if in the VEX distribution there are included the source files of the Cache simulator.
Thank you.
Alex