Maker Pro
Maker Pro

another bizarre architecture

J

Jan Panteltje

Jan 1, 1970
0
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

That last example:
Remember Z80 compare increase and repeat?
And that was one instruction.
It also has otir (out increase and repeat).
Well, OK, I guess their system works.....
But I sort of do not see the advantage.
It is faster then PIC io... but many processors allow direct access
to io / or memory [mapped io], also with indexes.
Anyways you can program your own in FPGA, opencores.org has a processor
generator.
Each his own processor :) OK, now to write all the assemblers and compilers.
 
V

Vladimir Vassilevsky

Jan 1, 1970
0
John said:
This looks really weird to me...

http://www.maxim-ic.com/appnotes.cfm/appnote_number/3960

Does it resemble anything you've ever seen?

Just another small 16-bitter. From Maxim, which sounds like never use it.

It looks truly ghastly to

Coding at low level is a task of compiler. BTW, do they provide decent
tools for MAXQ?

For example, allowing printf() to use floats adds 3500 bytes
to a program binary.

I'd say this is not unusual for the printf() overhead.


Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com
 
J

Jim Stewart

Jan 1, 1970
0
John said:
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.

It looks more like writing a cpu's microcode
than traditional assembly language. Which
might be fun if you're into that sort of thing.
 
P

Paul E. Schoen

Jan 1, 1970
0
John Larkin said:
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

This is a lot different than the PIC code I am used to. However, there must
be some advantage to it. I don't see where you get your reference to the
printf() function, however. That would be a function of a C compiler.

Paul
 
R

Rich Grise

Jan 1, 1970
0
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.

Yes, it does resemble something I've seen - microcode. ;-) It actually
looks like something I'd enjoy playing with. :)

And yes, I'd expect a printf() to use that many bytes - printf() is a
freakin' monstrosity in any case. What does puts() compile to? I'd think
it wouldn't take a very big loop to turn a float into a string.

Cheers!
Rich
 
T

Tim Shoppa

Jan 1, 1970
0
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.

The transport-triggered architecture is wonderful for a generic
architecture where ALU's, special ops, I/O are all to be "semi-custom"
added to a generic core. After you pick the core and the special-op
and I/O units the chip can be taped out with no human intervention.

You don't have to use that Maxim architecture to do that though, there
are lots of places that can synthesize an 8051 with any of a menu of
hundreds of I/O and special-op ports.
For example, allowing printf() to use floats adds 3500 bytes
to a program binary.

Most applications using these sorts of processors are orthogonal to
the use of C code and it makes no sense at all to put printf() and
floats etc. on them.

Maybe you'd be more comfortable with the TI MSP430 family.

Tm.
 
J

Jim Granville

Jan 1, 1970
0
John said:
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.

They have one of the strangest ways of documenting opcodes I have seen,
which I think makes it looks stranger that it really is.
It does mean users have a learning curve to climb, unless you
want to operate purely, and only, in C - which places its own
restrictions on what you can do.

They claim low power, but the MAXQ2000 has a very poor mA/MHz offset,
- yes, it's OK at 20MHz, but only drops Icc a few %, as the clock drops
to 1MHz - so at lower clocks, it quickly looks plain lousy.
Hard to believe someone pitching a low power uC, would make that
mistake.

They seem to be targeting the DataACQ markets, so the core specs
matter less than the peripherals - eg there are (very) few uC offering
16 bit ADCs + LCD + 16*16 to 40 bit MAC, so if you really need those
features, the core will be a "don't care".

As a general mechant uC ?, nope...

-jg
 
J

John Devereux

Jan 1, 1970
0
John Larkin said:
This looks really weird to me...

http://www.maxim-ic.com/appnotes.cfm/appnote_number/3960

Does it resemble anything you've ever seen?

Its been out for a while now - I don't see advantage over more
established cores like MSP430 and ARM. And lots of disadvantages.
It looks truly ghastly to
program. For example, allowing printf() to use floats adds 3500 bytes
to a program binary.

Then don't do that! The full printf is quite powerful (and complicated
internally). An integer-only version can be made quite compact and is
still quite powerful. If you are determined to use floating point you
can pass the integer and fractional parts as separate parameters to
the function, using a format string that combines them visually.
 
J

John Larkin

Jan 1, 1970
0
The transport-triggered architecture is wonderful for a generic
architecture where ALU's, special ops, I/O are all to be "semi-custom"
added to a generic core. After you pick the core and the special-op
and I/O units the chip can be taped out with no human intervention.

You don't have to use that Maxim architecture to do that though, there
are lots of places that can synthesize an 8051 with any of a menu of
hundreds of I/O and special-op ports.


Most applications using these sorts of processors are orthogonal to
the use of C code and it makes no sense at all to put printf() and
floats etc. on them.

Maybe you'd be more comfortable with the TI MSP430 family.

Tm.


No, I use mostly MC68332's, very clean, orthogonal CISC machines that
are nice to program in assembly. I just thought that this was a
really strange, sort of dated architecture.

John
 
S

Spehro Pefhany

Jan 1, 1970
0
Yes, it does resemble something I've seen - microcode. ;-) It actually
looks like something I'd enjoy playing with. :)

And yes, I'd expect a printf() to use that many bytes - printf() is a
freakin' monstrosity in any case. What does puts() compile to?

It is extremely simple.
http://www.koders.com/c/fid61148695142D20F84C4E83E059EEED5677E7CD79.aspx
I'd think
it wouldn't take a very big loop to turn a float into a string.

Don't be a puts(). You have to convert binary to ASCII, denormalize,
deal with leading and trailing zeros, decimal points, and so on.
Cheers!
Rich


Best regards,
Spehro Pefhany
 
J

John Larkin

Jan 1, 1970
0


Monkeys with typewriters. Most of the functions say nothing about what
they do, and many are effectively or entirely comment-free. This is
the Microsoft philosophy: the only documentation is the code itself.
Don't be a puts(). You have to convert binary to ASCII, denormalize,
deal with leading and trailing zeros, decimal points, and so on.

Fixed-point 64-bit to formatted ascii string is maybe a page of
assembly for the 68K. Might run over a page with zero supression and
commas every 3 digits.

John
 
A

Alex Colvin

Jan 1, 1970
0
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.

I used to work with New England Digital (no relation to DEC) Able
computers. The first commercial single-instruction computer. Built out of
MSI circuitry and used as a signal processor in the first commercial
digital synthesizers.

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

One of these days I'd love to do it in VHDL, although I bet Cameron
already has.
 
J

Jan Panteltje

Jan 1, 1970
0
Monkeys with typewriters. Most of the functions say nothing about what
they do, and many are effectively or entirely comment-free.

No, you have to be able to read 'C'!!!!!!
I sort of like that link, maybe it is because I used DJ Delorie's C compiler
djgpp on MS DOS many many years ago...
:)
http://en.wikipedia.org/wiki/DJGPP
 
J

John Larkin

Jan 1, 1970
0
No, you have to be able to read 'C'!!!!!!

To even tell what the intent of a 100-line function is? The fact that
the comments are so few, and generally misspelled, suggest that what's
going on here is beyond simple inarticulateness.

Face it: the current state of software is an unholy mess, and the
paradigm doesn't work. Windows source code looks like this.

John
 
J

Jan Panteltje

Jan 1, 1970
0
To even tell what the intent of a 100-line function is? The fact that
the comments are so few, and generally misspelled, suggest that what's
going on here is beyond simple inarticulateness.

Face it: the current state of software is an unholy mess, and the
paradigm doesn't work. Windows source code looks like this.

John

OK, I will face it, I have heard your argument before, but I happily write
many hundreds of lines of C code without additional explaining text before
each line (that is what you want).
Long ago I have learned: Write your code so it is readble, so not something like:


double pnurk(double a, souble b)
{
double c;

c = b / a;

return b / a;
}


but:

BOOL calculate_current(double resistance, double voltage, double *current)
{
if(debug)
{
fprintf(stderr,\
"calculate_current: arg resistance, voltage\n",\
resistance, voltage);
}

if(resistance < 0.0)
{
fprintf(stderr,\
"My-Program: calculate_current():\n\
Your resistance is negative (%.2f), you must be kidding right? Aborting.\n",\
resistance);

return SUCKS;
}

*current = voltage / resistance;

if(debug)
{
fprintf(stderr, "calculate_current(): calculated current=%.2f\n", *current);
}

return OK
}

Sorry could not resist.


So in a program you can then know what it does.
Of course the example is very simple, but if you are consistent
most of the time you need no more text, use the right variable names.

And use spaces.....

return a/b*c%25+15; // sucks

In the link we were talking about it is 100% clear to me at least what happens.
If you have a look at gcc, and libc.info (the reference in Linux) you can
look up all these functions.
I cannot say anything about the MS soft... MS is C++ so, and so silly that
Visual Studio.
I program in Linux with 9 rxvt terminals, libc.info open in one of these, with
the source in a normal text editor in an other rxvt, and run the code in a third
rxvt.
And switch between the virtual screens with ctrl-cu left-right-up-down.
rarely run out of (9) rxvts.
No mouse, only mouse when I test GUI stuff, and even then started from rxvt.

Anyways I do not see your problem, but you are no programmaer I think, so I
had very very hard time myself in the begining (>20 years ago) to understand
C code... mathematical shock to see != and == etc.. :)
 
V

Vladimir Vassilevsky

Jan 1, 1970
0
Jan Panteltje wrote:

BOOL calculate_current(double resistance, double voltage, double *current)
{
if(debug)
{
fprintf(stderr,\
"calculate_current: arg resistance, voltage\n",\
resistance, voltage);
}

if(resistance < 0.0)
{
fprintf(stderr,\
"My-Program: calculate_current():\n\
Your resistance is negative (%.2f), you must be kidding right? Aborting.\n",\
resistance);

return SUCKS;
}

*current = voltage / resistance;

if(debug)
{
fprintf(stderr, "calculate_current(): calculated current=%.2f\n", *current);
}

return OK
}

What a shamefull nonportable, unsafe and murky piece of code.

This is a way to go:

CURRENT calculate_current(VOLTAGE voltage, RESISTANCE resistance)
{
CURRENT current;

if(fabs(resistance) < VERY_SMALL_NUMBER)
{
throw BAD_RESISTANCE;
}
else
{
current = voltage/resistance;
}
return current;
}



Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com
 
J

John Devereux

Jan 1, 1970
0
John Larkin said:
To even tell what the intent of a 100-line function is? The fact that
the comments are so few, and generally misspelled, suggest that what's
going on here is beyond simple inarticulateness.

You do realise that this is an implementation of the C standard
library? The behaviour of the functions is spelled out, in detail, in
the C standard, and any number of C reference books and online
references.
Face it: the current state of software is an unholy mess, and the
paradigm doesn't work.

What would you do, rewrite Windows XP in 68k assembler? :)
Windows source code looks like this.

If Only...
 
Top