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++

DDR2 and Ethernet

Altera_Forum
Honored Contributor II
1,145 Views

Hi friends, 

 

I want to control DDR2 and Ethernet with NIOS II on my board. ADC results are read from LVDS_rx module and store on DDR2 and then stream out via Ethernet. On my board, there is no SDRAM except for a DDR2, so I want to use on-chip memory for Nios ii . Can I get it? 

 

 

Any advice and guidance will be appreciated.
0 Kudos
13 Replies
Altera_Forum
Honored Contributor II
401 Views

I use cyclone III ep3c25f324. Is there enough on-chip memory for my project ? 

 

Need your help , thanks.
0 Kudos
Altera_Forum
Honored Contributor II
401 Views

Why not using DDR2 memory? It doesn't matter what memory type it is, since You need to use either DMA (better SGDMA for faster transfers) or write Your own Avalon Memory Master controller. How fast ADC is?

0 Kudos
Altera_Forum
Honored Contributor II
401 Views

You can put your code+data into internal memory (probably tightly coupled) while still using the external DDR2 memory for large items (like the ethernel buffers). 

 

However you may have to be careful about the size of the code. 

I don't know how small the TCP/IP stack can be, but even the 'hello world' program pulls in enough stuff from libc to be a little large for internal memory. 

 

My suspicion is that the IP stack won't be that concise! Enough code to send IPv4 UDP packets should be quite small, but you'll need something to give the system it's IP address. 

 

OTOH if you avoid all of libc, you can do quite useful stuff using internal memory.
0 Kudos
Altera_Forum
Honored Contributor II
401 Views

 

--- Quote Start ---  

Why not using DDR2 memory? It doesn't matter what memory type it is, since You need to use either DMA (better SGDMA for faster transfers) or write Your own Avalon Memory Master controller. How fast ADC is? 

--- Quote End ---  

 

 

400Msps ADC. DDR2 memory is used to store ADC result . if it's used for nios II ,what about the ADC ?
0 Kudos
Altera_Forum
Honored Contributor II
401 Views

Attached is a snap of cyciii spec. , I use ep3c25 and how many on-chip memory can I use for nios ii cpu?

0 Kudos
Altera_Forum
Honored Contributor II
401 Views

 

--- Quote Start ---  

You can put your code+data into internal memory (probably tightly coupled) while still using the external DDR2 memory for large items (like the ethernel buffers). 

 

However you may have to be careful about the size of the code. 

I don't know how small the TCP/IP stack can be, but even the 'hello world' program pulls in enough stuff from libc to be a little large for internal memory. 

 

My suspicion is that the IP stack won't be that concise! Enough code to send IPv4 UDP packets should be quite small, but you'll need something to give the system it's IP address. 

 

OTOH if you avoid all of libc, you can do quite useful stuff using internal memory. 

--- Quote End ---  

 

 

 

hi, dsl: 

you mean I can use the on-chip memory if ....? Could you give me more guidance according the spec. of cyciii and my project ?
0 Kudos
Altera_Forum
Honored Contributor II
401 Views

I doubt You'll be able to run Nios on on-chip memory... Nios II/e probably worth trying, but that Cyclone III You use is kinda small.

0 Kudos
Altera_Forum
Honored Contributor II
401 Views

 

--- Quote Start ---  

Why not using DDR2 memory? It doesn't matter what memory type it is, since You need to use either DMA (better SGDMA for faster transfers) or write Your own Avalon Memory Master controller. How fast ADC is? 

--- Quote End ---  

 

 

 

If I use the DDR2 memory for nios ii cpu and buffer several thousands bytes of adc results , now how to control the DDR2 ?
0 Kudos
Altera_Forum
Honored Contributor II
401 Views

It's done by DDR2 controller in SOPC. I've already mentioned that You need either DMA or own memory master core.

0 Kudos
Altera_Forum
Honored Contributor II
401 Views

 

--- Quote Start ---  

It's done by DDR2 controller in SOPC. I've already mentioned that You need either DMA or own memory master core. 

--- Quote End ---  

 

 

oh, i see... 

 

Can I use the DDR2 memory as two separate blocks ,one for nios ii cpu and the other fo adc result ?
0 Kudos
Altera_Forum
Honored Contributor II
401 Views

Sure, why not. If You'll use SGDMA, then You can allocate memory using malloc() or use fixed value.

0 Kudos
Altera_Forum
Honored Contributor II
401 Views

OK,I'll try it. Thank you!

0 Kudos
Altera_Forum
Honored Contributor II
401 Views

I'm not sure what the minimum M9K footprint for a nios cpu is, but it is relatively small! 

- 1 M9K for the registers 

- Remove the dynamic branch prediction logic (this is a 'hidden' option) 

- Read code from tightly coupled memory 

- No data cache, data can be in the same M9K as the code 

- No JTAG debug 

- Boot directly from the instruction memory (no separate M9K for epcs (etc) boot) 

- Write small, tight code without any libc bloat and with minimal wrapper layers.
0 Kudos
Reply