Blocks RAM in HandelC

I want to test the example in page 217 of DK2 Handel-C Language Reference Manual.

------- ram unsigned 8 RAM1[4] = {0,1,2,3} with {block="BlockRAM"}; ram unsigned 8 RAM2[4] with {block="BlockRAM"}; signal s; unsigned x; unsigned i; while(1) { par { s = RAM1[i]; RAM2[i] = s; x = s; i++; } }

-------

BUt it doesn't compile, I get the following error: Illegal initializer. I suppose that I can't initialize the RAM, then why Celoxica give examples that doesn't works? or what's missing?

Thanks

Gerardo

Reply to
Gerardo Sosa
Loading thread data ...

i is used before it is set. Maybe unsigned i = 0; as the declaration.

Steve

Reply to
Steve Casselman

Thanks Steve, but I don't think that this be the error, because the error put the cursor in the line: ram unsigned 8 RAM1[4] = {0,1,2,3} with {block="BlockRAM"};

Anyway I probed:

unsigned i=0;

and

unsigned i; i=0;

But, both either don't work.

Regards

Gerardo

Reply to
Gerardo Sosa

all you need to do is add the static keyword to the ram declaration

A
Reply to
ABloke

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.