From: John Larkin on
On Mon, 05 Feb 2007 22:44:53 GMT, Rich Grise <rich(a)example.net> wrote:

>On Mon, 05 Feb 2007 13:06:49 -0800, John Larkin wrote:
>> On Mon, 05 Feb 2007 18:32:28 GMT, Vladimir Vassilevsky
>>
>>>I have seen the comments like "I don't know why, but this variable
>>>should be set to 1, otherwise it doesn't work..."
>>
>> That seems like a very valuable comment to me. It alerts future
>> programmers that there may be a problem somewhere. Even worse would be
>> if the situation went undocumented.
>>
>> We sometimes write a comment like "this chip seems to need a wait
>> after loading the control register. 1 millisecond seems to work, so we
>> used three just for luck."
>
>So, when's the book, "How To Write Understandable and Maintainable Code"
>coming out? ;-)
>

Sorry, there's no demand.

John

From: slebetman on
On Feb 1, 3:03 am, John Larkin
<jjlar...(a)highNOTlandTHIStechnologyPART.com> wrote:
> This looks really weird to me...
>
> http://www.maxim-ic.com/appnotes.cfm/appnote_number/3960
>
> Does it resemble anything you've ever seen? It looks truly ghastly to
> program. For example, allowing printf() to use floats adds 3500 bytes
> to a program binary.
>
> John

It's a move machine, otherwise known as a Transport Triggered
Architecture. The MAXQ is only the second commercially available move
machine in existence. The first was New England's ABLE:

http://world.std.com/~alexc/able.html

The first time I became aware of move machines was from the "Ultimate
RISC" page:

http://www.cs.uiowa.edu/~jones/arch/risc/

(there is a corresponding page for "Minimal CISC" at http://
www.cs.uiowa.edu/~jones/arch/cisc/)

The Delft University of Technology in the Netherlands took the concept
to high performance computing and ended up with a parameterized core
where you can define how many ALUs, FPUs, MMUs, scratch registers,
transfer channels etc. and the CPU along with the appropriate C
compiler back-end is generated for you:

http://ce-serv.et.tudelft.nl/MOVE/index.html

TU Delft's move machine is very heavily parallel at the instruction
level. Alas ILP currently appears to be a dead end.

Maxim's MAXQ is marketed as very low digital noise (unfortunately with
most cores these days running below 3V it matters less) low power
chip. (but they are slow to implement significant power saving tech
instead relying on the intrinsic property of the architecture).

I myself have designed and implemented (in simulators/emulators)
several TTA designs. It's especially attractive for the designer since
the instruction decoder is simply a demultiplexer. And of course, any
left over register address can be hooked up to a peripheral.

From: Jim Granville on
slebetman(a)yahoo.com wrote:
<snip>
> Maxim's MAXQ is marketed as very low digital noise (unfortunately with
> most cores these days running below 3V it matters less) low power
> chip. (but they are slow to implement significant power saving tech
> instead relying on the intrinsic property of the architecture).

The numbers I've seen are not all that low power: they have one of
the worse Icc/Freq curves of the claimed low power uC.

To be fair, that does not seem to be the core's fault, but
looks like the chipdesigners were a bit slack in the
memory access design area.

Might have fallen into the old trap of believing their own propaganda,
and as you suggest, thinking if you have a low power core, that's
all you needed for a low power device.

> I myself have designed and implemented (in simulators/emulators)
> several TTA designs. It's especially attractive for the designer since
> the instruction decoder is simply a demultiplexer. And of course, any
> left over register address can be hooked up to a peripheral.

That explains the strange opcode documentation.
Sounds like this could also port to a FPGA reasonably well
(if anyone would bother, as the compilers will be very locked to
one implementation... )

-jg

From: Rich Grise on
On Tue, 06 Feb 2007 03:25:28 +0000, Ken Smith wrote:
> Rich Grise <rich(a)example.net> wrote:
> [....]
>>The worst are comments that don't tell you anything, usually caused by
>>some supervisor ordering a bunch of code grunts, "Your code WILL be
>>commented!" and you get this:
>>
>>LABEL1: MOV BP,SP ; move the contents of the stack pointer to the base
>> ; pointer register
>
> Many years ago, a friend of mine made a nice little joke program. You
> could feed uncommented code into it and it would produce code with very
> nice comments. It would look at two instructions and look up phrases
> based on them and the random number generator. You knew you were in
> trouble when they seemed to be making sense.
>

I once wrote a "poetry generator" which did pretty much the same - random
noun, random verb, random adverb, random adjective, and so on. It came out
kind of like Haiku, but some of the results were kind of spooky. ;-)

Cheers!
Rich

From: Terry Given on
Rich Grise wrote:
> On Tue, 06 Feb 2007 03:25:28 +0000, Ken Smith wrote:
>
>>Rich Grise <rich(a)example.net> wrote:
>>[....]
>>
>>>The worst are comments that don't tell you anything, usually caused by
>>>some supervisor ordering a bunch of code grunts, "Your code WILL be
>>>commented!" and you get this:
>>>
>>>LABEL1: MOV BP,SP ; move the contents of the stack pointer to the base
>>> ; pointer register
>>
>>Many years ago, a friend of mine made a nice little joke program. You
>>could feed uncommented code into it and it would produce code with very
>>nice comments. It would look at two instructions and look up phrases
>>based on them and the random number generator. You knew you were in
>>trouble when they seemed to be making sense.
>>
>
>
> I once wrote a "poetry generator" which did pretty much the same - random
> noun, random verb, random adverb, random adjective, and so on. It came out
> kind of like Haiku, but some of the results were kind of spooky. ;-)
>
> Cheers!
> Rich
>

years ago at uni, we had to do a C code metric for a group project.
turns out its kinda impossible to do properly thanks to the
pre-processor (its easy to bollocks up code that way), but we counted
lines of comments, and used an X-bar-R chart to measure their
distribution, figuring that dispersed comments are probably better than
a single essay at the beginning.

Cheers
Terry