home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s078 / 1.img / BUSARB.PLD < prev    next >
Encoding:
CUPL PLD Program format  |  1991-12-08  |  4.5 KB  |  117 lines

  1. Name      Busarb;
  2. Partno      CA0019;
  3. Date      3/19/85;
  4. Revision  01;
  5. Designer  Kahl;
  6. Company   Assisted Technology;
  7. Assembly  None;
  8. Location  None;
  9. Device    f105;
  10.  
  11. /****************************************************************/
  12. /*                                */
  13. /* Multiprocessor Bus Arbiter                    */
  14. /*                                */
  15. /* This is an implementation of a single chip multiprocsssor    */ 
  16. /* bus arbiter (as originally described by Signetics Corp.)     */
  17. /* Priority A Processors (R0..4) are granted the bus (G0A..G4A)    */
  18. /* on a "Last Granted Lowest Priorty" basis.  Priority b     */
  19. /* Processors (r0..2) are granted the bus (g0b..g2b) on a fixed */
  20. /* priority basis, and only when Priority A Processors are not    */
  21. /* requesting the bus.                        */
  22. /****************************************************************/
  23. /* Allowable Target Device Types :  82S105                         */
  24. /****************************************************************/
  25.  
  26. /**  Inputs  **/
  27.  
  28. pin 1    = sys_clk;         /* System Clock         */
  29. pin [9..5] = ![R0..4];        /* Priority A Processor Request */
  30. pin [4..2] = ![r0..2];        /* Priority b Processor Request */
  31. pin 19    = sys_reset;        /* System Reset         */
  32.  
  33. /**  Outputs  **/
  34.  
  35. pin [18..15,13] = [G0A,G1A,G2A,G3A,G4A];/* Priority A Processor Grant    */
  36. pin [12..10] = [g0b,g1b,g2b];        /* Priority b Processor Grant    */
  37.  
  38. /**  Internal Node Declarations  **/
  39.  
  40. node [A,B,C,D,E,F];        /* Internal State Bits        */
  41.  
  42. /** Declarations and Intermediate Variable Definitions **/
  43.  
  44. field mach_A = [A,B,C,D,E,F];    /* Priority A Processor Field    */
  45. field mach_b = [A,B,C];        /* Priority b Processor Field    */
  46.  
  47. not_A = !R0 & !R1 & !R2 & !R3 & !R4;    /* No A Processors Requesting    */
  48.  
  49. $define WAIT0  'b'111111    /* Wait State 0 - reset state    */
  50. $define WAIT1  'b'111110    /* Wait State 1            */
  51. $define WAIT2  'b'111101    /* Wait State 2            */
  52. $define WAIT3  'b'111100    /* Wait State 3            */
  53. $define WAIT4  'b'111011    /* Wait State 4            */
  54. $define GRANT0 'b'000110    /* Grant Priority A Processor 0    */
  55. $define GRANT1 'b'000111    /* Grant Priority A Processor 1    */
  56. $define GRANT2 'b'001110    /* Grant Priority A Processor 2    */
  57. $define GRANT3 'b'001111    /* Grant Priority A Processor 3    */
  58. $define GRANT4 'b'010110    /* Grant Priority A Processor 4    */
  59. $define waitx  'b'111        /* Any wait state for machine A    */
  60. $define grant0 'b'101        /* Grant Priority b Processor 0    */
  61. $define grant1 'b'110        /* Grant Priority b Processor 1    */
  62. $define grant2 'b'100        /* Grant Priority b Processor 2    */
  63.  
  64. /** Logic Equations **/
  65.  
  66. sequence mach_A {
  67.  
  68. present WAIT0    if R0                next GRANT0    out !G0A;
  69.         if R1 & !R0            next GRANT1    out !G1A;
  70.         if R2 & !R1 & !R0        next GRANT2    out !G2A;
  71.         if R3 & !R2 & !R1 & !R0        next GRANT3    out !G3A;
  72.         if R4 & !R3 & !R2 & !R1 & !R0    next GRANT4    out !G4A;
  73. present WAIT1    if R1                next GRANT1    out !G1A;
  74.         if R2 & !R1            next GRANT2    out !G2A;
  75.         if R3 & !R2 & !R1        next GRANT3    out !G3A;
  76.         if R4 & !R3 & !R2 & !R1        next GRANT4    out !G4A;
  77.         if R0 & !R4 & !R3 & !R2 & !R1    next GRANT0    out !G0A;
  78. present WAIT2    if R2                next GRANT2    out !G2A;
  79.         if R3 & !R2            next GRANT3    out !G3A;
  80.         if R4 & !R3 & !R2        next GRANT4    out !G4A;
  81.         if R0 & !R4 & !R3 & !R2        next GRANT0    out !G0A;
  82.         if R1 & !R0 & !R4 & !R3 & !R2    next GRANT1    out !G1A;
  83. present WAIT3    if R3                next GRANT3    out !G3A;
  84.         if R4 & !R3            next GRANT4    out !G4A;
  85.         if R0 & !R4 & !R3        next GRANT0    out !G0A;
  86.         if R1 & !R0 & !R4 & !R3        next GRANT1    out !G1A;
  87.         if R2 & !R1 & !R0 & !R4 & !R3    next GRANT2    out !G2A;
  88. present WAIT4    if R4                next GRANT4    out !G4A;
  89.         if R0 & !R4            next GRANT0    out !G0A;
  90.         if R1 & !R0 & !R4        next GRANT1    out !G1A;
  91.         if R2 & !R1 & !R0 & !R4        next GRANT2    out !G2A;
  92.         if R3 & !R2 & !R1 & !R0 & !R4    next GRANT3    out !G3A;
  93. present GRANT0    if !R0                next WAIT1    out  G0A;
  94. present GRANT1    if !R1                next WAIT2    out  G1A;
  95. present GRANT2    if !R2                next WAIT3    out  G2A;
  96. present GRANT3    if !R3                next WAIT4    out  G3A;
  97. present GRANT4  if !R4                next WAIT0    out  G4A;
  98. }
  99.  
  100. /* A subset of the state bits is created as a second machine so that    */
  101. /* after a Priority b Processor is granted the bus, the Bus Arbiter    */
  102. /* returns to the same WAIT state from which it was interrupted before    */
  103. /* the bus request.                            */
  104.  
  105. sequence mach_b {
  106.  
  107. present waitx     if r0 & not_A             next grant0    out !g0b;
  108.         if r1 & !r0 & not_A        next grant1    out !g1b;
  109.         if r2 & !r1 & !r0 & not_A    next grant2    out !g2b;
  110. present grant0    if !r0                next waitx    out  g0b;
  111. present grant1    if !r1                next waitx    out  g1b;
  112. present grant2    if !r2                next waitx    out  g2b;
  113. }
  114.  
  115.                         /* all registers preset    */
  116. [A,B,C,D,E,F,G0A,G1A,G2A,G3A,G4A,g0b,g1b,g2b].ap = sys_reset;
  117.