Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Custom component writing to SD-RAM

Altera_Forum
Honored Contributor II
1,522 Views

Hi fellows, 

 

i have created a system in which nios II processor is running at 100 MHZ and ddr sdram is running at 150 mhz so , i also added a clock crossing bridge,  

 

after this i created a custom slave component which is perfectly accepting what is coming from nios II. But i need by custom slave component to write to sdram? 

 

what is the best way to do it? 

 

and please show example designs if possible.. 

 

thanks for your help...
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
511 Views

One more thing i forgot to mention, this slave should also be able to receive data from sdram.  

 

now the question is more complete.  

 

looking forward to your helps....
0 Kudos
Altera_Forum
Honored Contributor II
511 Views

You can add an Avalon master port to your custom component. Through this master port, you can write to and read from your SDRAM (or any other slave component). Components can contain more than one Avalon port including a mixture of both master and slave ports.

0 Kudos
Altera_Forum
Honored Contributor II
511 Views

is there an example where an custom avalon master writing to sdram?

0 Kudos
Altera_Forum
Honored Contributor II
511 Views

Perhaps one of the master examples on the altera website (http://www.altera.com/support/examples/nios2/exm-avalon-mm.html) would be useful?  

 

One thing to keep in mind is that you really shouldn't be too worried specifically about how to write to SDRAM but instead how to write to an Avalon slave. Writing to any slave, including SDRAM, is the same. 

 

Another thing to watch out for is that SDRAM is an example of a high latency slave, particularly for reads. Because of this, if you need to achieve high bandwidth/efficiency to the slave, you will need to use pipelining or burst transfers.
0 Kudos
Altera_Forum
Honored Contributor II
511 Views

Here are some other examples written in VHDL: http://www.alteraforum.com/forum/showthread.php?t=19053 

 

The master templates up on the altera design examples page are an early version of what is used here: http://www.altera.com/support/examples/nios2/exm-modular-scatter-gather-dma.html This one is more feature rich and uses standard streaming interfaces for the control, response, and data plane interfaces so I would recommend it over the old templates. 

 

When accessing SDRAM in general make sure you study the master access pattern. Accessing locations sequentially will give you the best performance and random accesses all over the place will give you the least performance (in general).
0 Kudos
Reply