From reid@cc.gatech.edu Thu Nov 14 10:03:12 1996
Received: from burdell.cc.gatech.edu (root@burdell [130.207.3.207]) by cleon.cc.gatech.edu (8.8.Beta.5/8.6.9) with ESMTP id KAA06314 for <annc@cleon.cc.gatech.edu>; Thu, 14 Nov 1996 10:03:10 -0500 (EST)
Received: from gaia.cc.gatech.edu (reid@gaia.cc.gatech.edu [130.207.3.8]) by burdell.cc.gatech.edu (8.8.Beta.5/8.6.9) with ESMTP id KAA01871 for <annc@cc.gatech.edu>; Thu, 14 Nov 1996 10:03:09 -0500 (EST)
Received: (from reid@localhost) by gaia.cc.gatech.edu (8.8.Beta.5/8.6.9) id KAA15268 for annc@cc.gatech.edu; Thu, 14 Nov 1996 10:03:08 -0500 (EST)
From: reid@cc.gatech.edu (Charles Reid Harmon)
Message-Id: <199611141503.KAA15268@gaia.cc.gatech.edu>
Subject: Re: documentation on cache stuff for superdlx
To: annc@cc.gatech.edu (Ann L. Chervenak)
Date: Thu, 14 Nov 1996 10:03:08 -0500 (EST)
In-Reply-To: <199611132212.RAA03890@cleon.cc.gatech.edu> from "Ann L. Chervenak" at Nov 13, 96 05:12:28 pm
X-Mailer: ELM [version 2.4 PL23]
Content-Type: text
Status: R

> Hi, Reid,
> 
> Various students have asked me how they can simulate
> cache parameters in superdlx.  Can you point me to 
> some documentation on this?
> 
> Thanks.
> 
> Ann

There isn't any documentation written, but it's not complicated, so I'll
explain it briefly:

The simulator by default charges a fixed access time for memory accesses.  It
gets this value from the machinefile configuration:

Memory
	size		600000
	latency		2		<---------

We patched in a cache simulator written by Scott Wills in CompE.  It uses its
own configuration file.  To use a given configuration file, add the following
arguments to the simulator command line: -c <cachefile>

If this is specified, the original memory latency is NOT used.  All memory
access times are determined by what's in the cache and how soon it will become
available.

The parameters in <cachefile> are pretty straightforward if you've studied
caches and know the kinds of behaviors that a cache could exhibit.  Here is the
configuration I've been using:

---------------------------- BEGIN ----------------------------------
Comment:      Hopefully a reasonable cache specification for SuperDLX

Word-Size: 4
Main-Memory-Access-Time: 5
Main-Memory-Transfer-Time: 1
Main-Memory-Access-Size: 0

L1-Cache:
Line-Size: 16
Set-Size: 2
Number-Of-Sets: 256
Replacement-Policy: FIFO
Write-Update-Policy: COPY-BACK
Write-Allocation-Policy: INSERT-IN-CACHE
Cache-Access-Time: 2
Cache-Type: SPLIT

L2-Cache:
Line-Size: 16
Set-Size: 1
Number-Of-Sets: 65536
Replacement-Policy: FIFO
Write-Update-Policy: COPY-BACK
Write-Allocation-Policy: INSERT-IN-CACHE
Cache-Access-Time: 3
Cache-Type: UNIFIED
----------------------------- END -----------------------------------

Some notes on this:
1) Don't change the word size; the simulator always assumes a 4-byte word.
2) The memory size comes from the machinefile, or from the -ms<numbytes>
   argument, if you specify it.
3) Access times accummulate.  Here they've been specified as 2 for L1, 3 for
   L2, and 5 for main memory.  This means a hit in L1 takes 2 cycles, a hit
   in L2 takes 2+3==5 cycles, and a hit in main memory takes 2+3+5==10 cycles.
4) The difference in Main-Memory-Access-Time and Main-Memory-Transfer-Time is
   this: a cache miss requires the entire line to be requested.  The simulator
   assumes a 64-bit data bus, so it will transfer up to 2 words at a time.
   The requested word is always transfered first (with another word), and the
   rest of the word pairs arrive afterwards.  The transfer time is the time
   between these arrivals.  Having a transfer time of 1 cycle, as above,
   simulates a pipelined burst mode: on an L1 and L2 miss, it will take 10
   cycles to get the first two words for the line in, but the next two words
   will arrive in the cycle after that, and the next two words in the cycle
   after THAT.  They just stream in from memory.
5) The Line-Size is in terms of the number of words.
6) The Set-Size is the number of Lines, or the associativity.  The L1 cache
   above is 2-way set associative.
7) The Number-Of-Sets relates to the direct-mapped nature of the cache.  The
   word address's last (8) bits are taken to get a number from 0 to
   (Number-Of-Sets-1).  This chooses which set the address will occupy,
   although it may occupy any line within the set.  (Line-Size, Set-Size, and
   Number-Of-Sets should all be powers of 2.)  To get a direct mapped cache,
   set Set-Size to 1.  To get a fully associative cache, set Number-Of-Sets to
   1.  The size of the cache is: WordSize*LineSize*SetSize*NumberOfSets.
8) The cache type SPLIT means strictly that half of the sets are used for
   instructions, and half for data.  For L1, use SPLIT or UNIFIED; for L2, 
   only use UNIFIED.
9) You don't have to have an L2 cache; you can just remove all those lines.
10) Valid Replacement-Policy's are: RANDOM, LRU, FIFO.
11) Valid Write-Update-Policy's are: WRITE-THROUGH and COPY-BACK.
12) Valid Write-Allocation-Policy's are: INSERT-IN-CACHE and BYPASS-CACHE.

Feel free to E-mail me with any questions you might have.

Reid


