Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ll-xn!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!cs.utexas.edu!oakhill!wca
From: wca@oakhill.UUCP (william anderson)
Newsgroups: comp.arch
Subject: M88000 power dissipation as a function of programming
Keywords: M88000 power programming code
Message-ID: <1370@claude.oakhill.UUCP>
Date: 8 Jul 88 18:11:09 GMT
Organization: Motorola Inc. Austin, Tx
Lines: 267


INTRODUCTION

In a private communication, Landon Dyer  asks the
following question in response to the power considerations discussed
in article <1362@oakhill.UUCP>:

-> Is it possible that a worst-case instruction-stream address sequence
-> (from a program designed to maximize address-bit changes while minimizing
-> cache hits) would cause an 88100 to overheat?

That is to say, can a malevolent programmer find an instruction sequence
for the MC88100 which is equivalent to the legendary HCF (Halt and Catch
Fire) instruction?



PATHOLOGICAL EXAMPLE

Assume we have the following register contents:

	r2:	0x55555555
	r3:	0xAAAAAAAA

Consider the following M88K "program", with the above register contents:

0xFFFFFFFC:
	st	r2,r3,r0
	br.n	-1
	st	r3,r2,r0

On the MC88100, r0 is hardwired to 0.  Consider what this loop does:

 1 - The first st stores all 5s at address = AAAAAAAA.  The address of this
     instruction is -1.

 2 - The br.n branches back to the first st instruction while executing
     another store in the delay slot.  The address of this instruction
     is 0.

 3 - The second st stores all As at address = 55555555.

A loop where stores (where the MC88100 must drive its data pins) run
nearly back to back with highly uncorrelated states on both data and
address busses, and with uncorrelated states on the instruction address
bus, is the worst case power dissipation for the MC88100.

Therefore the relevant M88K P bus states in this loop look like (using
hexadecimal notation):

I-Address	D-Address	Data		Byte Strobe
(30 bits)	(30 bits)	(32 bits)	(4 bits)
--------	--------	--------	-
3FFFFFFF	
00000000	
00000001	
3FFFFFFF	
00000000	AAAAAAAA	55555555	F
00000001	AAAAAAAA	55555555	0
3FFFFFFF	55555555	AAAAAAAA	F
00000000	AAAAAAAA	55555555	F
00000001	AAAAAAAA	55555555	0
3FFFFFFF	55555555	AAAAAAAA	F

and so on.  Note that the I-address pins are going from all 0 to all 1
to all 0 every third cycle, and both the D-address and Data pins are
alternating 1s and 0s at every pin at the same frequency.



POWER CONSIDERATIONS FOR PATHOLOGICAL EXAMPLE

Now, the AC power dissipation (as discussed in article <1362@oakhill.UUCP>)
is given by:

                           P =  .5*C*V**2*F*N,          [ equation 1 ]
where:
                    P = AC power dissipation (W)
                    C = load capacitance (F),
                    V = voltage swing (V),
                    F = frequency (Hz), and
                    N = number of pins which make transitions.

      (For the MC88100, V = 3.8 volts (TTL logic levels) and F = 20 MHz)

NOTE:  This formula was INCORRECTLY posted as P = 2*C*V**2*F*N in
       the aforementioned article.  We sincerely apologize for any
       inconvenience that this might have caused.  However, the
       derivation of this formula takes about 60 seconds and is
       left as an exercise for the reader (use the formulae
       P = V*I and I = C*dV/dt, and average over one clock to do
       the derivation).

If we plug in the numbers, using:

		    C = 85 pF		(70 pF maximum output load capacitance
					 plus 15 pF internal output capacitance)

		    V = 3.8 V		(see above)
		    N = 2/3 * 96 = 64	(2/3 due to transition frequency)
we get:
		    P = .79 W		(F = 20 MHz)
		    P = .98 W		(F = 25 MHz)

This result is well below the maximum power dissipation of 1.5 W given
for the MC88100.  In general, the AC power dissipation of the MC88100
highly dominates any DC power dissipation.

Clearly, this program is pathological:

 - No work gets done and the code never terminates; therefore, we can
   make the MC88100 halt (i.e. quit doing useful work) but we cannot make
   it catch fire.

 - The instruction addresses are contrived (in fact, this program
   won't work with the MC88200 CMMUs since addresses >= FFF00000 are
   hardwired for I/O address space).



REALISTIC EXAMPLE WITH OPTIONAL POP-QUIZ

Perhaps a more interesting example would be where the M88K is doing
memory-intensive work in a useful manner.  Let's consider an example
which might be useful in a Unix(R) kernel: wordmove().  A common example
of the C source code for wordmove() might be:

void
wordmove_1(d, s, n) long *d, *s; unsigned int n;
{
	while ( n-- ) *d++ = *s++;
}

OR:

void
wordmove_2(d, s, n) long *d, *s; unsigned int n;
{
     register i;
     for(i = -n; i; i++) s[n+i] = d[n+i];
}

OR:

void
wordmove_3(d, s, n) long *d, *s; unsigned int n;
{
     register i;
     for(i = 0; i