NAME BCTL; PARTNO 391472-03; REVISION 03; DATE 2/16/94; DESIGNER Schaeffer/Haynie; COMPANY CBM; ASSEMBLY A3000 040 coprocessor; LOCATION U209; DEVICE g22V10; /************************************************************************/ /* */ /* A3640 68040 enhanced bus master control PAL */ /* */ /************************************************************************/ /* Clock: BCLK */ /************************************************************************/ /* Free Pins: I(8),I(10),I(11),I(13) */ /* IO(18),IO(22) */ /************************************************************************/ /* HISTORY */ /* SS 92: Completely new. */ /* SS Nov 92: Bus lockup problems with DMA. When bus busy */ /* was negated in state 9, control passed to state */ /* 0. This didn't adequately handle "implicit */ /* ownership", since state 9 was also granting the */ /* bus. Fixed by holding state 9 until the bus */ /* busy was again asserted. */ /* DBH Feb 17: Problems with bus lockup! */ /* 1) LOCKE and LOCK polarities reversed. */ /* 2) State 9 loops on !BB, causing reqlinquish to */ /* an '030 request having to wait until the */ /* '040 wants the bus. 7-49 of the '040 user's */ /* manual warns of this. */ /* The arbiter now handles implicit ownership and */ /* as well a lock occuring on an arbitration */ /* boundary. */ /************************************************************************/ /** Inputs **/ PIN 1 = bclk ; PIN 2 = !bgack30_ ; PIN 3 = !br30_ ; PIN 4 = !bb ; PIN 5 = !br40_ ; PIN 6 = !lock ; PIN 7 = !locke ; PIN 9 = !pwrst ; /** Outputs **/ PIN 19 = !bg40_ ; PIN 20 = !bg30_ ; PIN 21 = !bgack040 ; /** Used Internally **/ PIN 14 = !bs1 ; PIN 15 = !bs0 ; PIN 16 = !bs2 ; PIN 17 = !bs3 ; /** Declarations**/ field bs_stat = [bs0,bs1,bs2,bs3]; /** master state definitions **/ $define R00 'b'0000 /* bs = f */ $define R01 'b'0110 /* bs = 9 */ $define R02 'b'0010 /* bs = d */ $define R03 'b'0011 /* bs = c */ $define R04 'b'1010 /* bs = 5 */ $define R05 'b'0100 /* bs = b */ $define R06 'b'1100 /* bs = 3 */ $define R07 'b'1001 /* bs = 6 */ $define R08 'b'1000 /* bs = 7 */ $define R09 'b'0101 /* bs = a */ $define R10 'b'0001 /* bs = e */ $define STATE0 out bgack040 $define STATE1 out bg30_ $define STATE2 out bg30_ $define STATE3 $define STATE4 $define STATE5 out bg30_ $define STATE6 out bg30_ $define STATE7 out bgack040 $define STATE8 out bgack040 $define STATE9 out bgack040 $define STATE10 out bgack040 /* This gets all the reset terms out of the state machine proper, but achieves the same effect. */ [bs3..0].ar = pwrst; /* The state machine proper. */ sequence bs_stat { /* This is the idle state. If neither master wants the bus, we stick aroun here. As soon as one does, we jump to either's particular mastership branch. */ present R00 if bgack30_ next R04 STATE4; if !bgack30_ & br30_ next R01 STATE1; if !bgack30_ & !br30_ & br40_ next R07 STATE7; if !bgack30_ & !br30_ & !br40_ next R00 STATE0; default next R00 STATE0; /* This starts the 68030 bus as master branch. Here we simply assert a bus grant to the '030 bus. */ present R01 next R02 STATE2; /* At this stage, we wait for a bus grant acknowledge back from the '030 bus. Upon receipt of that, or negation of the '030 request, we go on to the next state. */ present R02 if bgack30_ next R03 STATE3; if !bgack30_ & br30_ next R02 STATE2; if !bgack30_ & !br30_ next R03 STATE3; /* This state simply drops the 68030 bus grant. */ present R03 next R04 STATE4; /* This is the main '030-as-master running state. As long as the '030 bus is master and no new grants some in, we hang out here. If BGACK goes away, the arbiter goes back to to the idle state. If a new bus request is asserted, a grant must be presented to that master. */ present R04 if br30_ next R05 STATE5; if bgack30_ & !br30_ next R04 STATE4; if !bgack30_ & !br30_ next R00 STATE0; /* Here a 68030 bus grant is supplied to a potential new master while the '030 bus is mastered by the original '030 master. */ present R05 next R06 STATE6; /* This state holds bus grant to the '030 bus active, waiting for either the current '030 master to negate BGACK, or the new '030 master to negate bus request. */ present R06 if !br30_ next R03 STATE3; if bgack30_ & br30_ next R06 STATE6; if !bgack30_ & br30_ next R02 STATE2; /* The remaining states manage the 68040 as master. Here, a grant is simply driven to the '040 bus. */ present R07 OUT bg40_; next R08 STATE8; /* This is the main 68040 as master running state. As long as the '040 wants the bus and the '030 doesn't, stay here. */ present R08 OUT bg40_; if !br30_ next R08 STATE8; if br30_ & lock & !locke next R08 STATE8; if br30_ & lock & locke next R09 STATE9; if br30_ & !lock next R09 STATE9; /* At this point we drop grant to the '040, and would like to let the '030 on the bus. If the '040 has dropped bus bus, it's ok to proceed. If not, either hang out here as long as bus busy is asserted and we're not starting a new locked cycle. If we are, go back to the running state. */ present R09 if !bb next R10 STATE10; if bb & !lock next R09 STATE9; if bb & lock & locke next R09 STATE9; if bb & lock & !locke next R08 STATE8; /* Just for safety's sake, make sure we really did see the '040 give the bus back. */ present R10 if !bb next R00 STATE0; if bb & !br40_ next R09 STATE9; if bb & br40_ next R08 STATE8; }