home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / transput / 850 next >
Encoding:
Text File  |  1992-07-21  |  3.9 KB  |  91 lines

  1. Newsgroups: comp.sys.transputer
  2. Path: sparky!uunet!inmos!inmos.co.uk!gimli!roger
  3. From: roger@gimli.inmos.co.uk (Roger Shepherd)
  4. Subject: Re: Block moves (MOVE, MOVE2D) and the cache on the T9K
  5. Message-ID: <1992Jul21.114753.6065@inmos.co.uk>
  6. Sender: roger@gimli (Roger Shepherd)
  7. Organization: INMOS Limited, Bristol, UK
  8. References:  <JAN.92Jul18223618@pallas.neuroinformatik.ruhr-uni-bochum.de>
  9. Date: Tue, 21 Jul 1992 11:47:53 GMT
  10. Lines: 79
  11.  
  12. In article <JAN.92Jul18223618@pallas.neuroinformatik.ruhr-uni-bochum.de>, 
  13. jan@pallas.neuroinformatik.ruhr-uni-bochum.de (Jan Vorbrueggen) writes:
  14.  
  15. >>  There was some discussion on comp.arch recently on the appriateness
  16. >>  of putting block moves into the instruction set of a processor.
  17. >>  I've always thought that the transputer did it right, especially
  18. >>  by providing MOVE2D, which comes in handy in many places.
  19. >>  
  20. >>  Of course, the implementation is no problem on the current chips,
  21. >>  as they don't have a cache. But how does this work on the T9K?
  22.  
  23. It is implemented on the T9000 in a straightforward manner; no
  24. optimisation of the operation is performed to exploit/use the cache.
  25.  
  26. >>  Will my MOVE2D, scattering the 16384 bytes of a sequentially
  27. >>  stored array into the proper places of a two dimensional one, i.e.
  28. >>  
  29. >>  [16384] BYTE a :
  30. >>  [16384][40] BYTE x :
  31. >>  SEQ i=0 FOR 16384
  32. >>    x [i][3] := a[i]
  33. >>  
  34. >>  implemented with a single MOVE2D, fill all of the cache with all those
  35. >>  unnecessary bytes? 
  36.  
  37. Which are the unnecessary bytes? 
  38.  
  39. The T9000 has 16 kbytes of cache. However, it does not cache 16k bytes,
  40. it caches 4 (banks) x 256 (lines) x 16 bytes, and each line is 16 byte
  41. (4 word) alogned. Your example is worse than you suspect; you actually
  42. perform writes to 16k distinct lines - 16 times the size of the cache.
  43. At the end of the execution of your example the cache will probably contain 
  44. some of the a array and some of the x array. It is unlikely that any of the
  45. initial state of the cache will remain. 
  46.  
  47. If your example were moderate; writing to 1024 bytes of cache, then 
  48. you would find that about 34% of the original cache content would remain. 
  49. This shows one difference in the behaviour of a random replacement cache
  50. (as in the T9000) and an LRU or FIFO replacement cache where the whole cache
  51. would have been destroyed by even this smaller example.
  52.  
  53. >>  Or can the CPU tell the cache controller in this
  54. >>  and similar cases "please don't cache these"?
  55.  
  56. No. But if the x array were something like a frame store, then you might
  57. have chosen to mark that bank of stroe as uncached, in which case the
  58. byte writes would be made to the external memory, and the cache would
  59. not be affected. (See my next comment).
  60.  
  61. >>                                               Hmm, actually this doesn't
  62. >>  seem quite possible in this case, as the destination words must be read
  63. >>  to be able to insert the bytes...
  64.  
  65. The T9000 does have byte write signals. If the external memory is
  66. uncached then these are used to perform part-word writes, rather than
  67. using a read-modify write. 64-bit wide external memory can only be
  68. used cached - in this case some write-modify-write operation has to take
  69. place. 
  70.  
  71.                                      well, at least some optimizations
  72. >>  on the microcode level are theoretically possible...and thrashing the
  73. >>  cache could certainly be avoided when doing a gather.
  74.  
  75. The read accesses in your example use the cache very well. You have
  76. sequential access through the array a. Each cache miss will cause
  77. 16-bytes of data to be fetched - all of which will be used in subsequent
  78. iterations of the copy.
  79.  
  80. >>  
  81. >>  Can anybody provide an answer to this arcane question :) ?
  82. >>
  83.  
  84. I hope I have.
  85.   
  86. -- 
  87. Roger Shepherd, INMOS Ltd   JANET:    roger@uk.co.inmos 
  88. 1000 Aztec West             UUCP:     ukc!inmos!roger or uunet!inmos-c!roger
  89. Almondsbury                 INTERNET: roger@inmos.com
  90. +44 454 616616              ROW:      roger@inmos.com OR roger@inmos.co.uk
  91.