Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20743 Discussions

Design of controller with DDR2 hi-speed interface and NIOS CPU

Altera_Forum
Honored Contributor II
1,000 Views

http://inlinethumb31.webshots.com/45854/2456230460103611618S600x600Q85.jpg  

 

Hello. 

We are now designing new system based on Stratix III. This is the first time I will use NIOS II processor and SOPC builder. Concept scheme of the system part is presenting on the picture. 

On the first (high-speed) stage data from ADC must be captured by ADC controlled and saved in DDR2 RAM. 

On the second (slow-speed) stage, data from DDR2 memory must be read by NIOS II and after making some calculations must be written back to the memory or transmitted out by slow-speed interface. 

 

The question is:  

1. What component of SOPC builder should be in a place of block, which is marking by “yellow ?” ?  

2. Also, I don’t understand, how could I link DDR2 256 bit local interface with 32 bit NIOS II interface. 

 

I think it must be some kind of Avalon bridge or adapter, but I couldn’t find information, concerning linking two SOPC devices with different bus width. 

Please, answer me or point me on documentation, where I can find solving for my problem. 

Thanks a lot.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
301 Views

This is actually going to be a lot easier than you think. 

 

You'll want to create the bulk of the system in SoPC builder: 

1 - Add a NIOS II processor to your SoPC system 

2 - Add a DDR2 High Performance controller to your SoPC system and configure it appropriately. 

 

The Avalon bus automatically takes care of the difference in width between the NIOS master and the DDR2 interface. The NIOS does not care how wide the memory is. The avalon interconnect fabric will take care of byteenable and addressing and all that. 

 

3 - The next thing is the "?" block. What you are really looking for is a DMA controller that will move the ADC data directly to memory. This is the same thing that has to be done with most communication interfaces (Ethernet, PCI express). Here are a few options: 

a - The regular DMA controller available in SoPC builder. 

http://www.altera.com/literature/hb/nios2/n2cpu_nii51006.pdf 

b - The Scatter-Gather DMA controller available in SoPC builder. 

http://www.altera.com/literature/hb/nios2/qts_qii55003.pdf 

c - Write your own. This really isn't that bad but it depends on your skill level. You may actually decide to build it right into your ADC user logic block. 

 

4 - Depending on what you chose for# 3, provide some way for your ADC user logic to interface with SoPC builder. You can make your ADC user logic a custom component within SoPC builder with an avalon master port (if you were going to do the DMA), avalon slave port, avalon streaming port or perhaps some combination of the three. 

 

I think you're only hurdle here is becoming familiar with everything. As such, I'd start with the NIOS and DDR2 controller and start playing around with that. Then add a DMA controller and maybe some useless peripheral (like a gpio port) and try streaming data from the gpio port.  

Have fun! 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
301 Views

Thanks for your support. The answer is very clear.

0 Kudos
Reply