home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / intel / 1369 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  2.9 KB

  1. Path: sparky!uunet!iWarp.intel.com|inews!mkahn
  2. From: mkahn@hopi.sedona.intel.com (Mitch Kahn)
  3. Newsgroups: comp.sys.intel
  4. Subject: Re: Clocks, bus cycles and wait states on the 8088
  5. Message-ID: <MKAHN.92Jul30094752@hopi.sedona.intel.com>
  6. Date: 30 Jul 92 16:47:52 GMT
  7. References: <1992Jul24.160813@axion.bt.co.uk>
  8. Sender: news@inews.intel.com
  9. Organization: /eng/eng3/mkahn/.organization
  10. Lines: 61
  11. In-reply-to: dlumby@axion.bt.co.uk's message of 24 Jul 92 15:08:13 GMT
  12.  
  13. dlumby@axion.bt.co.uk (Dave Lumby) writes:
  14.  
  15.  
  16. ]
  17. ] I'm currently modifying a peice of time critical assembler code for a rather
  18. ] old 8088 based system and I'd like to be able to work out *exactly* how long
  19. ] my new code will take to execute.
  20. ]
  21. ] From reading Intel's iAPX86,88 User Manual I can get figures for the no. of
  22. ] _clocks_ for each instruction but how do _clocks_ relate to bus cycles. From
  23. ] what I've read it would appear that each bus cycle is broken into at least
  24. ] four clock cycles (T1 - T4) + wait states + idle cycles.
  25. ]
  26. ] The heart of the code I'm planning to introduce will include a REP MOVSW to
  27. ] copy a 64 byte string as 32 words. The code is held in EPROM (running with 2
  28. ] wait states) the source and destination strings are both in RAM (with one
  29. ] wait state). The timings for REP MOVSW are quoted as 9 + 17/rep (8086) and 9
  30. ] + 21/rep for an 8088.
  31.  
  32.  
  33. In systems with prefetch queues, like the 8088, it is best to double check
  34. with a logic analyzer. Depending on system state, execution time can be 
  35. *slightly* indeterminate.
  36.  
  37. ]
  38. ] Given that the 8088 is running at 5MHz then with no wait states the transfer
  39. ] of 32 words would take 9 + 21*32 = 681 clocks = 136.2uS
  40. ]
  41. ] REP MOVSB is coded as two bytes and therefore I'd guess that the 2 wait
  42. ] states on the EPROM would add 4 clocks to the overall time. But do the wait
  43. ] states on the RAM also add a further 2 clocks (1 read/1 write) per byte
  44. ] transfered?
  45.  
  46. The instruction fetch does not factor in to the instruction execution time.
  47. It is assumed that the prefetch queue decouples the execution unit from ]
  48. the bus controller.
  49.  
  50. ]
  51. ] I'd be very grateful if someone could let me know how the wait states will
  52. ] affect the timing.
  53.  
  54. Wait states will add 2N (N= # of wait states per access) clocks to each
  55.  word transferred on an 8086,
  56. 4N to each word on an 8088. This assumes that the source and destination
  57. regions have the same wait state profile.
  58.  
  59. On the bus, it'll look like this:
  60.  
  61. T1 - T2 - TW - TW - T3 - T4 - TI - TI ....T1-T2-Tw-Tw-T4
  62.     Fetch word                fiddle w/word     deposit word
  63. ** This is for an 8086. An 8088 will need two fetches and two deposits
  64. per word.
  65.  
  66. The Ti/fiddle-with-word states are necessary because the 8086/8088
  67. is very inefficient. The 80186/80188 perform the same function
  68. at the full bandwidth (no idle states).
  69.  
  70. --
  71. |  Mitch Kahn              | "I hope you know that this will go down on |
  72. |  mkahn@sedona.intel.com  |  your permanent record..."                 |
  73. *************************MY OWN OPINIONS*********************************
  74.