C Compiler for Picoblaze !!!!!

Hi all, I'm designing a C compiler for the PicoBlaze processor. The compiler is a subset of the C language, but is quite good.

I called the C compiler PicoC :-)

I'm an FPGA designer and I want to use this compiler for my job. I think is very interesting to have a small microprocessor in an FPGA that you can program in C!

Are you using PicoBlaze at moment? do you think you can help me to test the Compiler?

The compiler at moment gives working code, but I need someone to do some good testing.

I do not promise that I'll give the compiler to eveybody, but I'll give the compiler to 5 or 10 people in all.

Also,the compiler is in pre Alpha version. That means that has not all the functionality.

When the compiler will be finished I'll do some optimization on the generated code.

At moment I can write code like this:

EXAMPLE:

int i; int *ii; char s; char *ss;

void main() { i =0; for(i=0;i

Reply to
Francesco Poderico
Loading thread data ...

You might want to check out SDCC on sourceforge.

--
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
 Click to see the full signature
Reply to
Stephen Williams

Did you check out the LCC ?

formatting link

Reply to
E.S.

I would be interested in the compiler especially if the sorce code were available.

Reply to
Brad Smallridge

Francesco: Your compiler assumes memory is attached to the I/O port, which is usually not. When it is, it is mostly special purpose read or write only memory (registers) not fit for storing variables. The idea with a C compiler for Picoblaze is to have an intelligent use of the registers. In your example all variables should be registers. Only if needed you should offload variables to some scratchpad. The Picoblaze-3 core (KCPSM3.vhd) has a 64 byte scratchpad for that, with its own set of I/O instructions FETCH and STORE. Of course you must also be able to declare references to the I/O ports to control your attached hardware, which will then use INPUT and OUTPUT. A problem with Picoblaze in relation to a, say C, compiler is its inability to work with constant arrays (lookup tables, constant strings) and computed jumps, often you end up with lists of compare/branch lists. Otherwise Picoblaze is tiny yet powerful core to control all sorts of things in an FPGA design. Your C compiler, if more focussed on the typical use of Picoblaze, could nevertheless be very useful in using the core. Henk van Kampen see:

formatting link

code.

Reply to
Henk van Kampen

Thank you henk for your comment, Yes, I'm assuming to have some external memory attached to the processor. But if you declare a variable as register you may not need any external ram

eg.

void main(){ register char i; register int *p; p=1; for(i=0;i Francesco:

generated code.

Reply to
Francesco Poderico

My apologies, A C compiler for PicoBlaze ? Is really needed ? Leaving out an academic research, is the correct choice ?

Walter.

"Francesco Poderico" a écrit dans le message de news: snipped-for-privacy@posting.google.com...

generated code.

Reply to
Walter Gallegos

I would also look at the HLA, here

formatting link

There is an opening for more portable assemblers, call it a "Structured Assembler", or a C-Syntax Assembler, if you will. These will always be subsets, but if they implement a common preprocessor, and in-line asm, for example, then it will be possible to have one source file that is portable. Eg A design could start on a PC, to develop the algorithm, and then be re-coded/optimised as needed, to target tiny cores, like the PicoBlaze, et al.

-jg

Reply to
Jim Granville

Francesco: Please let me know when you have something testable. I think it could be useful to cooperate with/add to my Picoblaze IDE too. You should consider targeting it to the Picoblaze-3 core, which is main stream now, I think. A variation of that core with a block ram as scratchpad gives you 256 byte variable/data space, which can be initialized constant area also. This allows you to work with strings etc. Additionally, since block rams are dual ported, you can share 1 blockram between two Picoblazes. You need to be able to locate your data/variables somewhere in blockram, to keep variables for both pB's separated (or not, so you can use variables to communicate between the

2 pB's). Do not assume any genaral purpose memory attached to the I/O ports. Henk

Reply to
Henk van Kampen

Isn't that why they make software simulators?

Though I can see the need for portability when you don't yet know how much work the application will involve to select a suitable processor.

Chris

Reply to
Chris Stratton

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.