ETC AN3729

MA31750 - Application Note 11
AN3729
MA31750 - Bus Arbiter
Application Note
Replaces July 2000 version, AN3729-3.0
1.0 INTRODUCTION
This application note presents a possible solution for a bus
arbiter in a multiple-controller MA31750 system. Such an
arbiter can be used to arbitrate between the primary MA31750
system and 1 or more other bus masters. These bus masters
can be other MA31750 systems, DMA controllers such as the
MA31753, or external interfaces.
2.0 PROCESSOR CONSIDERATIONS
When designing a bus arbiter for an NMA31750 system,
the following points need to be taken into account:
2.1 LOCKN PULL-UPS
The LOCKN signals should be pulled up because they go
tristate when the processor is degranted. Pull-ups are not
shown in the arbiters that are described in the next sections,
but they must be incorporated.
2.2 PROTECTED CYCLES
The processor internally latches GRANTN on AS falling to
ensure that, when GRANTN is removed, the processor
continues driving the busses, strobes and control signals until
the cycle has completed. However, on the first external cycle
after being granted, or the first external cycle after an internal
cycle, this latch has not yet been clocked, and there is a
danger, when removing GRANTN during these types of
cycles, that the processor stops driving whilst strobes are still
active. To prevent this from happening, these cycles must be
protected from being degranted, or if grant is taken off during a
protected cycle, it must be reasserted before AS falling.
2.3 GRANTN TIMING
The processor samples GRANTN on falling CLKOUT, so
an arbiter should not allow set-up and hold times to be
violated. This can be achieved by latching out the GRANTN
signals off the falling edge of CLKOUT of the relevant system.
In addition, note that as GRANTN falls to drive the address bus
and strobes, the AS can rise off a falling CLK edge. This can
erode the address set-up time to AS rising. If this affects the
system, then GRANTN must be asserted low to drive the
address bus valid and provide the set-up time before the CLK
falling edge (and the AS rising edge).
2.4 TCLK TIMING
If the MA31750 is degranted for long periods, a problem
can occur: If after degranting the processor, the TCLK falling
edge is close to the falling CLK edge at the end of the machine
cycle, and then grant is not returned to that system until after
another falling edge of TCLK, a cycle may be aborted. (The
time-out circuitry is disabled a short time after the end of the
degranted cycle. If a TCLK falling edge occurs between the
end of the cycle and the disabling of the time-out circuit, then
the time-out count remains active. This problem can occur
irrespective of the state of DTON.) This can be prevented by
synchronising TCLK to CLK to ensure that TCLK only changes
during CLKOUT high. This can be achieved by putting TCLK
AN3729-3.1 July 2002
through a D-type that is clocked by CLKOUT from the same
system (to be safe, 2 D-types should be used to prevent
metastability problems). This is not shown in the next sections.
3.0 2 CHANNEL SYNCHRONOUS BUS ARBITER
The following is an explanation of a bus arbiter that
arbitrates between 2 systems, one of which is the default
system (system1), but the other having priority over the first
(system2). Only the request from system2 is monitored - if it is
asserted then grant is given to system2, otherwise grant is
given to system1. The lock signals are also monitored to
ensure that either system can keep grant during atomic
instructions which should not be interrupted. Both systems and
the arbiter run off the same clock. An example of such a
scheme would be an MA31750 system which gets the bus by
default, and a DMA controller which has priority over the
processor.
3.1 BUS ARBITRATION LOGIC
The circuit is shown in figure 1. Falling CLKOUT is used to
latch in requests and latch out grants to ensure sufficient setup and hold time of GRANTN to CLKOUT falling (see section
2.3). If the latched request changes state (and LOCKN is
inactive), the active grant will be deasserted. Although grant
may be taken away immediately, no grant is given until activity
on the bus has finished. The signal PRESETN, which prevents
a new grant being assigned, is generated from AS or ACTIVE
asserted with no grants (ACTIVE comes from the cycle protect
logic described in section 3.2). Note that the arbitration logic
can be overridden by PROTECT, the other signal from the
cycle protect logic (section 3.2), which keeps grant on or
reassigns grant to the last system granted.
3.2 CYCLE PROTECT LOGIC
The circuit is shown in figure 2. The cycle protect logic
detects activity on the bus by sampling AS on CLKOUT falling.
If AS is sampled low, the cycle is inactive and the ACTIVE
signal is deasserted (low). ACTIVE high inhibits granting i.e.
grants can only be asserted on inactive cycles. This circuit also
detects the first external cycle following inactivity on the bus,
and from this it generates the signal PROTECT which lasts
until AS falling i.e. until the end of the cycle to be protected.
This signal is used to prevent degranting of either system if
that system is executing the first external cycle. Protecting this
cycle from degranting is important for the correct operation of
the processor (see section 2.2). Note that the protected cycle
can be either the first external cycle after grant has been
asserted, or an external cycle following a granted internal
cycle.
It can happen that grant is taken off system1 while it is
performing internal cycles but just as it is about to perform an
external cycle. As soon as AS goes high, the PRESETN
signal, which is generated from AS high with no grants, is
asserted and prevents granting of system2. At the same time,
the PROTECT signal will become asserted and will reassign
grant to system1 until the cycle is complete.
1/6
MA31750 - Application Note 11
LOCKN1
PRESETN
PRE
PRE
GNTN2
PROTECT
LOCKN2
D
Q
D
GRANTN2
LGNT2
Q
REQN2
QB
CLK
CLK
LGNT1
PRESETN
CLKOUT1
P ROTECT
PRE
D
GNTN2
LGNT2
GRANTN1
GNTN1
Q
ACTIVE
CLK
GNTN2
LGNT1
GNTN1
PRESETN
GNTN1
AS
Figure 1: 2 Channel Synchronous Bus Arbitration Logic
VCC
D
AS
AS
CLKOUT1
Q
CLK QB
CLR
PROTECT
PRE
D
CLK
Q
D
AS
Q
CLK
ACTIVE
Figure 2: Synchronous Cycle Protect Logic
LOCKN1
LOCKN2
PRE
D
GNTN2
PRESETN
PRE
Q
D
Q
D
Q
LGNT2
REQN2
CLK
QB
CLK
CLK
GRANTN2
PROTECT
LGNT1
PRESETN
P ROTECT
CLKOUT1
PRE
D
GNTN1
Q
CLK
CLKOUT2
Figure 3: 2 Channel Asynchronous Bus Arbitration Logic
2/6
GRANTN1
MA31750 - Application Note 11
VCC
AS
CLKOUT1
D
Q
D
AS
CLK
CLR
Q
CLK QB
CLR
PROTECT
LGNT1
PRE
D
AS
D
AS
CLKOUT2
Q
Q
CLK
CLR
CLK
ACTIVE
LGNT2
Figure 4: 2 Channel Asysnchronous Cycle Protect Logic
4.0 2 CHANNEL ASYNCHRONOUS BUS
ARBITER
6.0 3 CHANNEL ASYNCHRONOUS BUS
ARBITER
This section describes a bus arbiter that is required to
arbitrate between 2 systems having separate asynchronous
clocks e.g. a processor with an external interface.
This section describes a bus arbiter that is required to
arbitrate between 3 systems having separate asynchronous
clocks e.g. a processor with 2 external interfaces.
4.1 BUS ARBITRATION LOGIC
The bus arbitration logic is shown in figure 3 (the grant
latch and preset logic are the same as in figure 1). It is similar
to the synchronous case except for the addition of another Dtype clocked by CLKOUT2 falling to synchronise GRANTN2 to
system2.
6.1 BUS ARBITRATION LOGIC
The bus arbitration logic is shown in figure 6 (the grant
latch and the preset logic are the same as in figure 5). It is
similar to the synchronous case except for the addition of 2 Dtypes clocked by CLKOUT2 and CLKOUT3 falling to
synchronise GRANTN2 and GRANTN3 to systems 2 and 3
respectively.
4.2 ASYNCHRONOUS CYCLE PROTECT LOGIC
The cycle protect logic is similar to the synchronous case,
but now the CLKOUT signals from both system1 and system2
are used to detect activity on the bus. The circuit is shown in
figure 4. Note that the latched grant signals LGNT1 and
LGNT2 from the arbitration logic are used to select the clock
from the system that was last granted.
5.0 3 CHANNEL SYNCHRONOUS BUS
ARBITER
This section describes a 3 channel synchronous bus
arbiter where system1 is again the default system, system2
has priority over system1 and system3 has priority over both of
the other 2 systems (e.g. a processor and 2 DMA controllers).
5.1 BUS ARBITRATION LOGIC
Figure 5 shows the bus arbitration logic which is simply an
extension of the 2 channel case.
5.2 CYCLE PROTECT LOGIC
This is exactly the same as for the 2 channel synchronous
bus arbiter (figure 2).
6.2 ASYNCHRONOUS CYCLE PROTECT LOGIC
The cycle protect logic is similar to figure 4, but now the
CLKOUT signals from all 3 systems are used to detect activity
on the bus. The circuit is shown in figure 7.
6.3 WAVEFORMS
Figure 8 shows typical waveforms for the 3 channel
asynchronous arbiter described above. The sequence of
events is as follows:
1) System 3 executes an external cycle during which it
deasserts REQN3.
2) GRANTN3 is deasserted when REQN3 high is latched.
3) ACTIVE goes low followed by GRANTN1 being asserted.
4) System1 executes 2 external cycles followed by an
internal cycle, REQN2 is asserted during the internal cycle.
5) REQN2 low is latched and GRANTN1 is deasserted.
6) System 1 executes another external cycle so PROTECT
is asserted and GRANTN1 reasserted.
7) GRANTN1 is deasserted at the end of this cycle.
8) When ACTIVE has gone low, GRANTN2 is asserted.
9) System 2 starts executing external cycles, starting with a
protected cycle.
3/6
MA31750 - Application Note 11
LOCKN1
GNTN3
PRESETN
LOCKN2
GRANTN3
LGNT3
PRE
PRE
LOCKN3
D
D
Q
Q
PROTECT
REQN3
CLK
CLK
QB
LOCKN1
PROTECT
PRESETN
LOCKN2
D
PRE
Q
D
REQN2
CLK
GRANTN2
LGNT2
PRE
GNTN2
Q
QB
CLK
PROTECT
PRESETN
CLKOUT1
GRANTN1
LGNT1
PRE
D
GNTN3
GNTN1
Q
LGNT3
CLK
GNTN2
ACTIVE
LGNT2
GNTN3
GNTN2
GNTN1
PRESETN
AS
LGNT1
GNTN1
Figure 5: 3 Channel Synchronous Bus Arbitration Logic
CLKOUT3
LOCKN1
GNTN3
PRESETN
LOCKN2
LOCKN3
PRE
PRE
D
Q
D
Q
D
Q
REQN3
CLK
GRANTN3
QB
CLK
LGNT3
PROTECT
CLK
GNTN2
LOCKN1
GRANTN2
PRESETN
LOCKN2
PRE
D
PRE
Q
REQN2
D
CLK
Q
D
Q
LGNT2
QB
CLK
CLK
PROTECT
LGNT1
PRESETN
CLKOUT1
PROTECT
PRE
D
Q
GNTN1
CLK
CLKOUT2
Figure 6: 3 Channel Asynchronous Bus Arbitration Logic
4/6
GRANTN1
MA31750 - Application Note 11
VCC
AS
D
Q
AS
CLK
CLR
CLKOUT1
D
Q
CLK QB
CLR
PROTECT
LGNT1
AS
CLKOUT2
D
PRE
Q
CLK
CLR
D
AS
Q
CLK
ACTIVE
LGNT2
AS
CLKOUT3
D
Q
CLK
CLR
LGNT3
Figure 7: 3 Channel Asynchronous Cycle Protect Logic
CLKOUT1
CLKOUT2
CLKOUT3
AS
REQN2
REQN3
GRANTN1
GRANTN2
GRANTN3
ACTIVE
PROTECT
PRESETN
Figure 8: Typical Waveforms for 2 Channel Asynchronous Arbiter
5/6
POWER ASSEMBLY CAPABILITY
The Power Assembly group was set up to provide a support service for those customers requiring more than the basic
semiconductor, and has developed a flexible range of heatsink and clamping systems in line with advances in device voltages
and current capability of our semiconductors.
We offer an extensive range of air and liquid cooled assemblies covering the full range of circuit designs in general use today.
The Assembly group offers high quality engineering support dedicated to designing new units to satisfy the growing needs of
our customers.
Using the latest CAD methods our team of design and applications engineers aim to provide the Power Assembly Complete
Solution (PACs).
HEATSINKS
The Power Assembly group has its own proprietary range of extruded aluminium heatsinks which have been designed to
optimise the performance of Dynex semiconductors. Data with respect to air natural, forced air and liquid cooling (with flow
rates) is available on request.
For further information on device clamps, heatsinks and assemblies, please contact your nearest sales representative or
Customer Services.
http://www.dynexsemi.com
e-mail: [email protected]
HEADQUARTERS OPERATIONS
DYNEX SEMICONDUCTOR LTD
Doddington Road, Lincoln.
Lincolnshire. LN6 3LF. United Kingdom.
Tel: +44-(0)1522-500500
Fax: +44-(0)1522-500550
CUSTOMER SERVICE
Tel: +44 (0)1522 502753 / 502901. Fax: +44 (0)1522 500020
SALES OFFICES
Benelux, Italy & Switzerland: Tel: +33 (0)1 64 66 42 17. Fax: +33 (0)1 64 66 42 19.
France: Tel: +33 (0)2 47 55 75 52. Fax: +33 (0)2 47 55 75 59.
Germany, Northern Europe, Spain & Rest Of World: Tel: +44 (0)1522 502753 / 502901.
Fax: +44 (0)1522 500020
North America: Tel: (613) 723-7035. Fax: (613) 723-1518. Toll Free: 1.888.33.DYNEX (39639) /
Tel: (949) 733-3005. Fax: (949) 733-2986.
These offices are supported by Representatives and Distributors in many countries world-wide.
© Dynex Semiconductor 2002 TECHNICAL DOCUMENTATION – NOT FOR RESALE. PRODUCED IN
UNITED KINGDOM
Datasheet Annotations:
Dynex Semiconductor annotate datasheets in the top right hard corner of the front page, to indicate product status. The annotations are as follows:Target Information: This is the most tentative form of information and represents a very preliminary specification. No actual design work on the product has been started.
Preliminary Information: The product is in design and development. The datasheet represents the product as it is understood but details may change.
Advance Information: The product design is complete and final characterisation for volume production is well in hand.
No Annotation: The product parameters are fixed and the product is available to datasheet specification.
This publication is issued to provide information only which (unless agreed by the Company in writing) may not be used, applied or reproduced for any purpose nor form part of any order or contract nor to be regarded
as a representation relating to the products or services concerned. No warranty or guarantee express or implied is made regarding the capability, performance or suitability of any product or service. The Company
reserves the right to alter without prior notice the specification, design or price of any product or service. Information concerning possible methods of use is provided as a guide only and does not constitute any guarantee
that such methods of use will be satisfactory in a specific piece of equipment. It is the user's responsibility to fully determine the performance and suitability of any equipment using such information and to ensure
that any publication or data used is up to date and has not been superseded. These products are not suitable for use in any medical products whose failure to perform may result in significant injury
or death to the user. All products and materials are sold and services provided subject to the Company's conditions of sale, which are available on request.
All brand names and product names used in this publication are trademarks, registered trademarks or trade names of their respective owners.
www.dynexsemi.com