[Coco] 6809/6309 Power Analysis

Boisy G. Pitre boisy at tee-boy.com
Thu Jan 21 16:54:48 EST 2010


Calling all hardware/electrical engineering gurus on the list...

As some of you know, I am working on my thesis this semester where I am exploring power-aware compiler optimizations.  I've selected (surprise) the 6809/6309 as my evaluation processor and will be retooling RELIC to use the power information that I am attempting to gather to make decisions about instruction use based on the current that they draw.

I'm hoping you hardware gurus can give me some input on the measurement part, in which I am attempting to determine the current draw of the 6809 when executing specific instructions.  The absolute value is not important; it is the relative difference of current draw for different instructions that I need to move forward.

Just to give you an idea of the type of equipment that I have access to at the UL campus:

	- Agilent Technologies MS06104A Mixed Signal Oscilloscope with analog probes as well as two 54620-61601 8-wire Logic Analyzer probe cables
	- Agilent Portable Logic Analyzer, don't have the exact model number but looks like a microwave oven and I am told costs around $55K.

The ideas brought up so far for measuring current at the instruction level:
	- use a PIC with an A/D convertor to measure the voltage.
	- use a shunt resistor (james recommended this method to me as well in private email) to measure current and outlined here: http://jet-server.commtest.co.nz/kb2/11624.htm

On the software side, I have constructed several test executables that run under NitrOS-9 and execute a particular instruction over and over (with interrupts masked of course). The baseline measurement instruction is CWAI, which puts the processor in sleep mode.  The code looks something like this:

    cwai #^IntMasks

With interrupts masked there should be no activity and the cwai should put the processor to a wait mode.  I would then take the measuring device of choice and measure the current for a fixed amount of time (say 1 second).

Afterwards, I would run the following program which has a series of 100 MUL instructions (MUL is chosen for presumably higher use of CPU):

     ldd       #$0000
     orcc     #IntMasks
toploop:
     mul
     mul
     mul
     ....
     mul          * 100th instruction
     bra       toploop

And again, use the same measuring device to measure the current draw for 1 second.

With a low and high mark, I could then begin measuring other instructions and see where they fall with the high-low current range.

My concern is the accuracy of the measurement, since I expect that the difference in current draw between instructions is small.  This is just a guess, but the level of accuracy that I would need to measure the difference in current draw between instructions would have to be AT LEAST 10e-3, or .001 amp (1 milliamp).

Suggestions?  How would you guys do this? Do I really need the high dollar equipment that I have access to, or do I need a high accuracy, sensitive multimeter that can measure current in very very small amounts?

Any input from the hardware experts here would be much appreciated.
--
Boisy G. Pitre
http://www.tee-boy.com/





More information about the Coco mailing list