This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Targeting Green Arrays Processors

I'm not sure if this is a bad idea of anything, but I'm interested in
running C/C++ programs on the processors by the GreenArrays, Inc.

These chips are a really bad fit to run C programs on; however, it can be useful to have a way to run "off the shelf" or "legacy" code on it.

What I've read by them suggests that:

a. Their processors have caches which are very small,

They don't have any cache; they have 64 words of RAM (and 64 words of ROM), and of course the two hardware stacks. Address space is 9 bits, and two of those bits are special function.

b. The company is testing a method of streaming larger programs into
the processors during execution,

Not sure what you mean. A processor can execute code from any of the links directly; such code can be arbitrarily large. This is for example how you boot the system. Also, a few CPUs can cooperate to access and run stuff from an external RAM.

c. The processors run a dialect of Forth natively as an instruction
set (not binary?), and

It's a 2-stack instruction set. It maps well to Forth, but it is not Forth: it's lower level, it's a machine language.

GCC will have a hard time supporting this CPU since GCC doesn't
handle stacks very well.  Note that these stacks aren't addressable
as memory.

d. "Virtual machines"/run-time engines could be made to implement
other languages, such as C.

It's not terribly hard to write a VM that runs on four or six or so CPUs and runs code from some external RAM. You could even make it have some registers for your GCC port.

The tricky part will be to make it have any performance; it's going
to be slow no matter what, but there are gradations of slow ;-)

How would GCC (and other compilers?) target these processors,

There already exists at least one Forth system that uses the GA system pretty much as described above. Forth is a more natural fit for these CPUs, of course: it makes for a simpler VM.

Whatever compiler you build, it is going to target some VM, not
the raw hardware.

and is this a good idea?

It's a fine way to run some legacy code or the big control code for some smaller computational kernels. Don't expect stellar performance, but it can still be faster than most microcontrollers!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]