Hi,I am using DE0 board with Cyclone III FPGA. If I am not wrong, it has 56 M9K blocks. According to my calculation, it gives 57344 bytes for me to use as on-chip RAM for my NIOS II processor. However, compilation report in Quartus tells me the error "Can't place all RAM cells in design", why? Thank you very much in advance. Cheers, Jimmy
Some of the memory blocks are used by the processor itself.The registers use one. Any data/instruction caches will use some. The branch prediction tables will use at least one. Any boot code will use some. The JTAG debug will use some. Also be aware that quartos may give a 'memory used' total in bits - which doesn't include all the 'wasted' bits inpartially used blocks.
Hm, okay... my problem is that the small C library does not support float, but without the small C library my elf-file is too big for the on-chip memory.Is the only solution then to extend to SRAM?
I have to use floating point, it is part of the requirement specification.I have just read that printf pulls in a lot of library code, are there any alternative methods to output to the console?
You can use alt_printf() which supports only fixed strings and a reduced set of formatting options (neither %d nor %f).Are you sure the small C library doesn't support floating point? I thought the limitation was only on I/O, namely you can use float type in code but you cannot use it in printf like functions. Please check, I'm not sure of this.
Well, I also need to print out the result from a float calculation. But you just gave me the idea of converting the floating point to string first and then printf the string... :)
--- Quote Start --- Well, I also need to print out the result from a float calculation. But you just gave me the idea of converting the floating point to string first and then printf the string... --- Quote End --- I guess you'll still get an increase of code similar to printf("%f") if you convert the float to string using a stdlib function. Infact the involved library calls are probalby the same.
You can probably write a convertion function that is 'good enough' for your values.For instance, if you want to print positive values to 2 decimal places something like:
unsigned int x = float_val; unsigned int y = (float_val - x) * 100; printf("%u.%2.2u\n", x, y);