[comp.sys.mac.programmer] Transfer problems

dbeck@unix.SRI.COM (Douglas K. Beck) (06/18/88)

Here is a question for some fine detain maven.  My current
project is being done with Lightspeed C.  One of the tasks
is to move 16 megabytes of data from a National Semi add in
board in my Mac II to a parallel output port.  The task requires
that a new long word be delivered in one microsecond or under.
Looking at my 020 book lead me to believe that the instruction
move.l (a3)+,(a4) could be done in 7 cycles.  The MacII clock
has a 64ns period thus the basic instruction *should* execute in
447ns.  I constructed an assembly language loop that consisted of
16 of the move instructions and two loop update instructions which
contribute about 10 percent overhead, with the entire loop body
residing in the cache.  The execuition speed I obtain is 1.22us
per longword transfer. Where did I go wrong?  A demoralized mind
wants to know.
dbeck@unix.sri.com  doug beck 

carlton@ji.Berkeley.EDU (Mike Carlton) (06/20/88)

(Sorry to post this, email bounced)
In article <18251@sri-unix.SRI.COM> dbeck@unix.sri.com (Douglas K. Beck) writes:
>is to move 16 megabytes of data from a National Semi add in
>board in my Mac II to a parallel output port.  The task requires
>that a new long word be delivered in one microsecond or under.
...
>residing in the cache.  The execuition speed I obtain is 1.22us
>per longword transfer. Where did I go wrong?  A demoralized mind
>wants to know.
>dbeck@unix.sri.com  doug beck 

One detail is working against you: the NuBus clock rate is 10 Mhz.  To 
make it even worse, the 68020 has to synch with the NuBus -- this costs 
even more time.  I was told that the cost of synch'ing was about 200 ns, 
making the total cost at least 300 ns (this is from memory and so is 
probably not exact).  Don't forget that the video memory is also written 
across the same bus, so if there are screen updates you're bound to have 
some contention.

Wish I had better news ... :-)

mike (carlton@ji   ...!ucbvax!ji!carlton)