From welland Mon Dec  7 16:51:17 1987
Date: Mon, 7 Dec 87 16:51:14 est
From: welland (Bob Welland)
To: boyer, daveh, gerard, porter
Subject: IO space problem
Status: R










      Using The IO Space In Time Critical Applications


                     Robert V. Welland



                          _A_B_S_T_R_A_C_T

          This  document  is   directed   at   hardware
     designers who are intending to use the IO space in
     a time critical way. An example of such an  appli-
     cation would be a hard disk controller with a disk
     buffer in the IO space.



_1.  _P_r_e_f_a_c_e

     This engineering update is  relevant  to  any  hardware
developer  who  is  intending  to  use the IO space (E90000-
EFFFFF) in a real-time manner. For example if you are  going
to  put  a disk buffer into this space and want to read from
it quickly, then this document concerns you.


_2.  _I_n_t_r_o_d_u_c_t_i_o_n

     In certain display modes the A2000 may not  give  reli-
able real-time response to devices in the auto-config and IO
space (E80000-EFFFFF) when the designer relies on the tradi-
tional  DTACK  mechanisms  (i.e.  either  generating XRDY or
allowing the system to generate  DTACK  automatically).   In
order  for  the  designer to get reliable real-time response
s/he will have to generate DTACK onboard.  The designer will
have  to  use OVR in order to gain control of the DTACK line
and then assert DTACK.

_3.  _G_e_n_e_r_a_t_i_n_g _D_T_A_C_K

     Their are two things that the designer must do to  gen-
erate DTACK:

          1. Generate OVR (override).

          2. Generate DTACK.

     To make this discussion simpler  we  will  assume  that
there  is  a  board  select  signal  (AM) that is an address
decode of the space allocated during auto-config.  The  fol-
lowing   PAL   equations  (in  CUPL  form)  demonstrate  the



                      December 7, 1987





                           - 2 -


generation of DTACK.

/*  Inputs  */

/* Address strobe from the 68000 */
PIN     xx      !AS;

/* Board address match */
PIN     xx      !AM;

/* DTACK enable signal from board */
PIN     xx      !DTACKEN;

/*  Outputs  */

PIN     xx      !DTACK;  /* DTACK */
PIN     xx      !OVR;    /* OVR - override */

/*  Equations  */

/* Assert OVR whenever our board is selected */
OVR     =       AM & AS;

/* Enable OVR whenever our board is selected */
OVR.oe  =       AM & AS;

/* Assert DTACK whenever our board is selected
 * and DTACKEN is asserted
 */
DTACK   =       AM & AS & DTACKEN;

/* Enable DTACK whenever our board is selected */
DTACK.oe=       AM & AS;


     Note that DTACKEN must be asserted at the  moment  when
XRDY would usually be deasserted. If you want one wait state
DTACK would be asserted after the falling edge  of  S4  (the
edge  DTACK  gets  sampled  on).  Remember that the 68000 is
asynchronous so it will automatically sync DTACK internally.
This can make DTACK generation much easier.

_4.  _A _F_e_w _N_o_t_e_s _O_n _O_V_R

     Commodore is generally cautious about the use  of  OVR.
The  reason  for  this  is  that it has been mis-used in the
past. I would like to clarify why we are cautious.

_4._1.  _U_n_c_o_n_t_e_s_t_e_d _A_c_c_e_s_s_e_s

     OVR tristates the DTACK signal. In the above usage that
is  ALL  it will do.  The reason for this is that any access
to our space is uncontested.  Ownership of such a space  has
been  given  to  one  device during auto-configuration. This



                      December 7, 1987





                           - 3 -


means that all other devices on the bus should  be  ignoring
this  cycle  (i.e. they will not try to respond). In fact if
they do, a collision will occur and the spec says that  BOTH
devices  are  supposed  to get off the bus and generate buss
error (BERR). This should never happen however.

_4._2.  _C_o_n_t_e_s_t_e_d _A_c_c_e_s_s_e_s

     Generating OVR outside of the expansion, IO,  or  auto-
config  space  (200000-9FFFFF,  E90000-EFFFFF,  and  E80000-
E8FFFF respectively) can lead to disaster. This  is  because
you  are  contending  with some other device for this cycle.
The results will be unpredictable.  For example if you  gen-
erate  OVR  in  the area of FC0000 you will be in contention
with the ROM.  What we are getting at is the following law:


     OVR does not give you exclusive access to the bus

A corrillary to this law would be:


     Any time you come in contention with another device for
     the bus, reguardless of the state of OVR, unpredictable
     things will occur.


_5.  _S_u_m_m_a_r_y

     If you are going to use IO space  in  a  time  critical
manner,  use OVR and DTACK instead of XRDY. Never try to use
OVR to gain control of another devices address space.

























                      December 7, 1987



