home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / m68k / 1483 < prev    next >
Encoding:
Text File  |  1992-12-21  |  3.7 KB  |  74 lines

  1. Newsgroups: comp.sys.m68k
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!ftlsw.telematics.com!ted
  3. From: ted@telematics.com (Ted Goldblatt)
  4. Subject: 68040 bus error handling question (long-ish)
  5. Message-ID: <1992Dec18.222101.12243@telematics.com>
  6. Sender: root@telematics.com
  7. Nntp-Posting-Host: sirius.ftlsw.telematics.com
  8. Organization: Telematics Intl., Inc.; Ft. Lauderdale, FL
  9. Date: Fri, 18 Dec 1992 22:21:01 GMT
  10. Lines: 62
  11.  
  12. We have run into a gotcha in a `040 board that we have built.
  13. It replaces a `020 based board in a bus type system with off
  14. board I/O space.  Most of the off board I/O registers are 16
  15. bits wide.  Those that are longs cannot be written as longs, but
  16. must be written as 2 word writes (this is enforced by the
  17. individual I/O boards, and is true for historical reasons).
  18. Unfortunately, not all software obeys this rule.  The original
  19. (68010 based) processor board didn't have a problem with this
  20. (obviously :-)).  The `020 based board did, so its address
  21. decode logic mapped all I/O space requests (or maybe just
  22. writes) as if they were to 16 bit ports, and used the `020's
  23. dynamic bus sizing feature to avoid the problem.  The `040
  24. doesn't have dynamic bus sizing, so this solution cannot be used
  25. (yes, a 68150 would solve that problem, and we use one for board
  26. local I/O space references, but the off board I/O is referenced
  27. via the same data paths as memory, and we cannot afford the
  28. performance hit of putting a `150 in this data path, or the
  29. complexity and board space to add another parallel data path).
  30.  
  31. We are (trying to :-)) find all violations of this rule so we
  32. can change the write to be OK, but there is concern that we
  33. cannot find them all (and the failure modes tend to be nasty to
  34. debug).  So far, the h/w types haven't been able to come up with
  35. a practical all h/w solution (they _can_ detect that a violating
  36. write was attempted, but they cannot split the write themselves).
  37. They have suggested that they could raise TEA (and maybe latch
  38. an error flag), and that we could (in our bus error handler)
  39. figure out that this has happened and "fix" it in software.
  40.  
  41. If we ignore the problem of determining that the bus error _was_
  42. due to this problem, the remaining issue is how to complete the
  43. cycle in s/w (or rather, having done that, how to get back to
  44. where we belong).  This involves 2 things: cleaning up any
  45. pending writebacks, and setting things up so that the next
  46. instruction we execute is the correct one.  It's not clear how
  47. to do the latter.
  48.  
  49. The `020 manual (mc68020um/ad rev 1, p 6-18) has a section on
  50. how to complete the bus cycle in software.  The `040 book
  51. (m68040um/ad) has no such section, and very much assumes that
  52. either the error was fatal and no recovery will be done, or that
  53. the bus error handler will end with an RTE and re-execute the
  54. (failing) instruction.  We can easily enough just tear down the
  55. stack frame, but the next question would be, where do we go?
  56. The diagram of the access error stack frame (on page 8-24) says
  57. that the stacked PC is for the "next" instruction.  Assuming
  58. that this means "next instruction to be executed when the RTE
  59. occurs" rather than "instruction after the one that caused the
  60. bus error", we need to point this to the instruction after the
  61. one we simulated.  The problem is how do we figure this out
  62. without putting in a fair amount of instruction decode logic
  63. just to figure out how long the faulting instruction was?  Is
  64. there some info in the stack frame (that we overlooked) that
  65. would make this easier?  Even better, is there a simpler way to
  66. do the whole bus error handling in s/w?
  67.  
  68. Thanx for any suggestions!
  69.  
  70. ted
  71. -- 
  72. Ted Goldblatt    ted@telematics.com     (305) 351-4367
  73.     Telematics Intl., Inc.   Ft. Lauderdale, FL
  74.