Forum Discussion
Altera_Forum
Honored Contributor
19 years ago --- Quote Start --- originally posted by shilpa v.prabhu@Mar 29 2007, 07:21 AM thanks elli for the reply.
we dont have enough resource in fpga to place an on-chip memory. just for the sake of testing i instantaited one more sdram. used first sdram to place .rodata, rwdata stack and heap., so that one sdram is totally free. i was able to test the full sdram in simualtions. i contacted altera my support regarding this issue. they have also replied telling that stack and heap are placed at the end of the memory. then i asked them where can i find the memory allocation done for rodata, rwdata, stack and heap? they suggested me to generate .objdump file which will give the placement details. we can generate this file from nios ii window. goto nios ii ide -> window -> preferences -> nios ii -> generate objdump file.
i generated this file. i could see the address allocation done for .rwdata, .rodata, .text etc.. but did not find exact allocation done for stack and heap. i am waiting for the reply from mysupport. also during mass production of the boards we want to check the complete sdram i.e each and every location of sdram. we dont have any other memory in our project except flash and sdram. so if we place rodata, rwdata, stack and heap in the sdram then we wont be able to test the complete sdram.so give me some suggestions on this.
thanks
shilpa
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=22608)
--- quote end ---
--- Quote End --- Hi Shilpa, thanks for the explanation of that .objdump file. Until now I didn't need it, but I wanted to check, where this sections are located befor I finish the project. Therefor this will be very useful. If I understood it right, the answer of where your .rwdata address allocation is, answers the question where your heap and stack is allocated, because they are inside the .rwdata section. As I wrote already, the stack grows downwards (toward lower addresses) from the end of the .rwdata address allocation. The heap grows upwards from the last used memory within the .rwdata section. So maybe for you it is interesting how big your heap and stack is. I remember, that I read a post about that here in the forum and they suggested to check the sp (Stack Pointer) and fp (Frame Pointer) registers. There was even a small program, that saved the lowest address inside the sp register which is related to the maximum size of stack and things like that. Anyway, I think you are right, you can't test a memory in which the test program is located. Why don't you put your program (.rwdata, .rodata, .text etc.) inside the flash? You could use the "Flash Programmer" for doing that. Then you can test the whole sdram, right? If it's a speed problem, maybe you should really use two sdrams, one could be your program memory and the other one your device under test. Correct me if I'm wrong, but as far as I know, sdram is faster then flash. On the other hand, sdram is volatile, it needs to be reloaded after every power up, flash is non-volatile. Hope that helped a bit, Elli