The Memory Model Hierarchy Parameters

Usage of VEX tools

The Memory Model Hierarchy Parameters

Postby Alexandru Susu » Thu Mar 17, 2005 10:43 pm

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
Alexandru Susu
 

Re: The Memory Model Hierarchy Parameters

Postby frb » Fri Mar 18, 2005 12:45 pm

Alexandru Susu wrote:First of all I would like to ask what does it actually mean the parameter NumCaches in vex.cfg?

NumCaches determines how many distinct data cache banks are modeled in a multi-cluster architecture. By default, all clusters talk to the same cache. By setting a higher NumCaches, clusters are assigned (in a round-robin fashion) to individual cache banks. For example, NumCaches=2 and clusters=4 means that
cluster 0 is connected to cache 0
cluster 1 is connected to cache 1
cluster 2 is connected to cache 0
cluster 3 is connected to cache 1
Note that the total cache size gets multiplied by NumCaches, and all banks are equal.
Alexandru Susu wrote: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).

Yes, what you say is correct.
Alexandru Susu wrote:The last question would be if in the VEX distribution there are included the source files of the Cache simulator.

In the current distribution, we don't include cache models. However, in the "share/api" directory you can find an example on how to write your own model (or better, how to hook whatever you want to each load/store, such as a cache model). Writing a simple cache model is relatively simple, and it's probably better so that you can have your parameters under control. If your goal is to do extensive cache work, it might even be better to write a small interface (following the example) to hook up the VEX simulator to a standard cache simulator, such as dinero (http://www.cs.wisc.edu/~markhill/DineroIV/)
frb
 
Posts: 62
Joined: Thu Nov 12, 2009 3:44 pm


Return to VEX Tools



Who is online

Users browsing this forum: No registered users and 0 guests

cron