Accessing SRAM on the Spartan-3 Starter Board

May 10, 2007 3 Replies

Dear All,



I'm sure this question was already been posted (and answered) in this list, but I could not find a suitable answer for my little knowledge of this matters, so, with my apologies, i'm posting it again.



I'm developing a microblaze system based on the Spartan-3 starter kit board. I need to access the on-board SRAM from my C code. I have hooked the SRAM to the OPB bus using BSB. The automatically generated memory_test application works just fine.



I just need the memory to hold data during program execution, e.g, int's, I d'ont have any sort of timing requirements.



My question is: how i'm I suppose to read and write to/from the SRAM? Just use the XIo_Out/In(32, 16, 8) library functions or is their a more efficient way of accessing the memory? I'm particulary confused by the functions on the XEmc library, that are related to the SRAM, but I really d'ont know what they do.



Tank you all,



Jos=E9 Mariano



a small hint:

just look the way the Xio_out is actually done in the xilinx library source. there you see how todo it.

its just standard C pointer access to raw memory

Antti

As Antti has said, you only have to create a pointer such as int *sdram_pointer=3D(int *)(0x22000000)

*sdram_pointer=3D..... sdram_pointer++; .=2E..

Great, tank you both very much.

Regards,

jose mariano

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required