home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p070 / 8.ddi / TUTOR.PLB / ARBITER.PLD < prev    next >
Encoding:
Text File  |  1990-12-11  |  2.0 KB  |  58 lines

  1.                     ROTATING PRIORITY RESOURCE ARBITER
  2.  
  3. This procedural state machine definition implements a rotating priority
  4. resource arbiter intended to control access to a local bus.  The arbiter
  5. ensures a one-cycle quiescent period between accesses.  See Chapter 9 of
  6. the reference guide for a discussion of state machines and procedures.
  7.  
  8. |PAL16R6 in:(R[1..3], RESET), out:(A[1..3], Q[2..0]), clock:CLOCK
  9. |
  10. | Title:    "ROTATING PRIORITY RESOURCE ARBITER"
  11. |           "Project 2700-3"
  12. |           "Designed by WPL"
  13. |
  14. | Registers: CLOCK // A[1..3], Q[2..0]
  15. | High:      CLOCK
  16. |
  17. | Procedure: RESET, Q[2..0]
  18. |
  19. | { WAIT1.  R1? (A1=1 ->ACK1)    |Wait for a request to arrive,
  20. |           R2? (A2=1 ->ACK2)    |giving R1 the highest
  21. |           R3? (A3=1 ->ACK3)    |priority.
  22. |           ->WAIT1
  23. |
  24. |   WAIT2.  R2? (A2=1 ->ACK2)    |Wait for a request to arrive,
  25. |           R3? (A3=1 ->ACK3)    |giving R2 the highest
  26. |           R1? (A1=1 ->ACK1)    |priority.
  27. |           ->WAIT2
  28. |
  29. |   WAIT3.  R3? (A3=1 ->ACK3)    |Wait for a request to arrive,
  30. |           R1? (A1=1 ->ACK1)    |giving R3 the highest
  31. |           R2? (A2=1 ->ACK2)    |priority.
  32. |           ->WAIT3
  33. |
  34. |   ACK1.   R1? (A1=1 ->ACK1)    |Hold acknowledgement 1 until
  35. |           ->WAIT2              |request line 1 drops.
  36. |
  37. |   ACK2.   R2? (A2=1 ->ACK2)    |Hold acknowledgement 2 until
  38. |           ->WAIT3              |request line 2 drops.
  39. |
  40. |   ACK3.   R3? (A3=1 ->ACK3)    |Hold acknowledgement 3 until
  41. |           ->WAIT1   }          |request line 3 drops.
  42.  
  43.  
  44. The test commands listed below are examples to show the operation of the
  45. state machine and are not intended to form a comprehensive test of the
  46. part.
  47.  
  48. |Vectors:
  49. | { Display RESET, CLOCK, (Q[2..0])d, R[1..3], A[1..3]
  50. |   Test    RESET=1; CLOCK=0,1
  51. |   Clear   RESET
  52. |   Test    R[1..3]=111b; CLOCK=2(0,1)
  53. |   Test    R[1..3]=100b; CLOCK=1(0,1)
  54. |   Test    R[1..3]=000b; CLOCK=2(0,1)
  55. |   Test    R[1..3]=111b; CLOCK=2(0,1)
  56. |   End  }
  57.  
  58.