home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / arch / 12111 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.9 KB  |  53 lines

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!spool.mu.edu!uwm.edu!linac!att!princeton!moo!awolfe
  3. From: awolfe@moo.Princeton.EDU (Andrew Wolfe)
  4. Subject: How does an R4000-style cache work?
  5. Message-ID: <1993Jan6.235455.25425@Princeton.EDU>
  6. Originator: news@nimaster
  7. Keywords: Write-back Cache
  8. Sender: news@Princeton.EDU (USENET News System)
  9. Nntp-Posting-Host: moo.princeton.edu
  10. Organization: Princeton Univ.
  11. Date: Wed, 6 Jan 1993 23:54:55 GMT
  12. Lines: 39
  13.  
  14. I am unclear on the timing involved when write misses occur on a write-back
  15. cache (like in the R4000).  Perhaps someone can clarify.
  16.  
  17. When a write is attempted - a virtual index is used to select a cache line
  18. and a virtual offset selects bytes within that line.  This happens during
  19. the DF stage in the R4000.  The memory can then be accessed during the DS
  20. stage.  I assume that the tag is read at this time.  If a write is allowed
  21. to occur at this time - it may destroy data in the cache.
  22.  
  23. The tag is checked at the next stage (TC).  If the tags match - all is OK -
  24. but if the tags do not match, then I have written over the previous data in
  25. the cache.  If I delay stores until after the tag check - then the memory is
  26. busy with another instruction in the pipeline.
  27.  
  28.  
  29.  
  30. I can conceive of several possible solutions:
  31.  
  32. 1)  Always save a copy of the overwritten line (for writeback).
  33.  
  34. 2)  Delay the write - then simultaneously read and write the cache.
  35.     (write from instruction in TC, read from instruction in MS)
  36.  
  37. 3)  Delay the write - then stall the pipeline on a hit or miss if the next 
  38.     instruction is a load.
  39.  
  40. The first two require a heavy-duty dual-ported cache.  The third requires
  41. stalls that I cannot find documented.
  42.  
  43. What method is really used to solve this problem in the R4000 and similar
  44. write-back caches?
  45.  
  46.  
  47. -- 
  48. --------------------------------------
  49. Andrew Wolfe
  50. Assistant Professor
  51. Department of Electrical Engineering
  52. Princeton University
  53.