home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / arch / 10802 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  3.8 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!sgiblab!sgigate!odin!mips!meter!pries
  2. From: pries@mips.com (Paul Ries)
  3. Newsgroups: comp.arch
  4. Subject: Re: MIPS R2000/R3000 cache design
  5. Date: 16 Nov 92 08:24:43 GMT
  6. Organization: Mips Technologies, Inc.
  7. Lines: 63
  8. Distribution: world
  9. Message-ID: <pries.721902283@meter>
  10. References: <1992Nov14.174200.14883@cs.tu-berlin.de>
  11. NNTP-Posting-Host: meter.mti.sgi.com
  12.  
  13. uhe@cs.tu-berlin.de (Ulrich Hertlein) writes:
  14.  
  15.  
  16. >Hi netlanders,
  17.  
  18. > I'm preparing a short introduction to the design of the R2000/R3000 CPUs and
  19. >am having a little trouble with the design of the caches.
  20.  
  21. >The book I bought says that the cache size for the R2000 is variable from
  22. >4 KB to 64 KB but doesn't state how the different cache size is handled by the
  23. >cache controller.  Obviously, the tag memory for a 64 KB cache has got to be
  24. >larger than for a 4 KB cache.  Does that mean that the CPU already has the
  25. >tag memory for the entire 64 KB (or 256 KB in the R3000)?
  26.  
  27. > And how are the cache lines addressed?  The cache-controller has to know the 
  28. >size of the available cache memory and again my book doesn't help.
  29.  
  30. > Is there anyone around that has knowledge of this?  Please respond asap, this
  31. >is kind of urgent ...
  32.  
  33. >thanks a lot!
  34.  
  35. >desperately,
  36. >-ulli
  37. Well the R2000/R3000 primary caches are direct mapped.  The AdrLo pins are
  38. used to index the primary cache.  The choice of cache size is made by deciding 
  39. how many of the pins to hook up to the caches. Each word (32-bits of data plus 
  40. 8-bits of parity) of cache has a unique tag, so the tag array and the data array
  41. are addressed the same way.  The tag array is external just like the data array
  42. so adding additional data entries requires adding additional tag entries.  The 
  43. width of the tag is what determines the minimum cache size.  There is no need 
  44. for the processor to know the size of the cache.  The processor provides an 
  45. index and is returned a tag.  The tag width is what determines the minimum cache
  46. size.  If a larger cache size than the minimum is used then the tag will return
  47. redundant information.  If number of cache rams were really critical the cache 
  48. size could be used to ignore certain bits of tags allowing different tag widths
  49. for different cache sizes...the R2000/R3000 does not support this.  The full
  50. width of the tag is always required.
  51.  
  52. Anyway, the processor forms a physical address for each reference.  The lower 
  53. bits of this address are put on AdrLo, which picks a location in the cache, 
  54. which returns data and a tag.  The tag is compared against the upper physical 
  55. bits and the data is used if the tag matches, otherwise a miss occurs.  
  56. The sum of the number of lower bits used to index the cache, the number of 
  57. address bits in a single word of the cache (4 bytes are two bits of address)
  58. and the number of address bits in the tag must be at least the size of the
  59. physical address space.  In the R2000/R3000 the tag has 20 address bits and the
  60. physical address space is 32 bits (including user and kernel spaces), so
  61. 32-20-2=10.  So you must use at least 10 of the AdrLo bits, which address
  62. 2^10 words or 4 Kbytes.  The width of AdrLo determines the maximum size.
  63. AdrLo width in the R3000 is 18, which includes byte address bits that are never
  64. connected to the cache, so the maximum cache size is 2^18 or 256 Kbytes.
  65.  
  66. Hope this helps...if not, try constructing a small example, say a 5 bit address
  67. space, with 4 bits of AdrLo and 3 bits of Tag.  This would allow caches of
  68. size 1, 2 or 4 locations (since the bottom two bits are used for byte addressing
  69. mainmemory only).
  70.  
  71. -- 
  72. -Paul Ries DISCLAIMER: <generic disclaimer, I speak for me only, etc>
  73. UUCP:     pries@mti.sgi.com                 Phone:    415-390-4481 
  74. USPS:     Silicon Graphics Computer Systems, MS 10L-135 2011 N. Shoreline Blvd,
  75.     Mountain View, CA 94039-7311
  76.