- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to use VHDL/verilog to write some simple data to the SSRAM/ DDR SDRAM in Cyclone III starter kit, then use control plane to read the data out.
Anyone has VHDL/verilog examples? just a simple write is O.k. I don't need read etc. Thank you very much!Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Are you sure that you want to use a hardware language to read and write to off-chip mem? I would use a simple c program in the nios environment. For starters, you could use the IOWR and IORD functions to write and read to/from memory. The address range for the memory is specified in sopc builder. Hope that helps. Andrew- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank u, I am not sure, I am not familiar with how to use nios to read and wirte off-chip memory.
--- Quote Start --- Hi, Are you sure that you want to use a hardware language to read and write to off-chip mem? I would use a simple c program in the nios environment. For starters, you could use the IOWR and IORD functions to write and read to/from memory. The address range for the memory is specified in sopc builder. Hope that helps. Andrew --- Quote End ---- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's an example of a function to test the off-chip mem. It won't completely test the memory, but I think it is sufficient for what you're doing. MEM_TEST_VAL is whatever you want it to be as long as it's not bigger than 32 bits. Have fun.
int ddr2_mem_test() { int i; int error_count; int readbyte; error_count = 0; // Write to the memory needed. for(i=0; i<(MEM_SPAN); i++) { IOWR_32DIRECT(DDR2_SDRAM_BASE, i, MEM_TEST_VAL); } // Read back and verify data. for(i=0; i<(MEM_SPAN); i++) { readbyte = IORD_32DIRECT(DDR2_SDRAM_BASE, i); if (readbyte != MEM_TEST_VAL) { error_count++; } } return error_count; }- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also want to read data from SSRAM using verilog, but can not succeed.
Does anyone can share this code to read /write data from/to SSRAM? thANKS. It will be greatly helpful. pleaseeeee share here or send to chrisfzhang@gmail.com if possible.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page