I think the easiest, but maybe not best solution would be to modify the
assembler, with two changes:
- change the RETI opcode to the new value (a text substitution in the
assembler's source),
- convert all ADD opcodes such that a no-op is inserted before the add (all
ADD opcodes become prefixed by a NOP, when the machine code is output).

Making the change in the assembler means that the compiler is free to
optimize all it can, and the assembler can clean up the generated code to
work around this hardware bug.

If you need help with modifying the assembler, please contact me directly
and I'll try to help you put something together.

Neil

On 9/25/06, Rick Jenkins <r...@hartmantech.com> wrote:

It seems I'm the only person taking this seriously - an earlier post was
ignored.

The CPU6 bug is a very serious one, documented in TI's slaz020. In
summary, any RET or RETI, returning from a function or interrupt call, which
hits an add with a register indirect source address, will cause the add to
be *executed twice*.

TI suggest two possible workarounds.

 1. One may avoid the register indirect addressing mode as source address
on adds, substituting indexed indirect with zero index. They quite rightly
document their concern that an optimisation pass may reverse this.

 2. Change the opcode of RETI to an alternate, which works normally, and
add a NOP before any error-prone ADD after a CALL. The opcode change seems
fairly bulletproof, but an optimiser will surely clobber the NOP.

Neither fix is easily done by an mspgcc user, since the fixes must be
applied in the libraries as well as in code generated by the user.

Theoretically, there exist revision E chips without these bugs, but you
can't buy one yet, and even the latest samples from TI are rev. D, which
have the bug. In any case, the earlier chips are out there - lots of them.

Does anyone have any ideas on how to cope?

--

Rick Jenkins <r...@hartmantech.com>

Hartman Technica http://www.hartmantech.com

Phone +1 (403) 230-1987 voice & fax

221 35 Avenue. N.E., Calgary, Alberta, Canada T2E 2K5


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users



Reply via email to