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++
公告
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 讨论

how to achieve the communication between niosII system and FPGA module

Altera_Forum
名誉分销商 II
2,684 次查看

I builded a niosII system use the SOPC builder,and now I need to communicates with a FPGA module through the niosII system,How do I achieve it? 

 

I have search some Information in the Altera website ,and the general ideas to do it is :build a dual-port ram between the niosII system and FPGA module 

 

But I am a rookie in this Field,I don't know how to do it clearly,is there any one can help me?I appreciate it very much!
0 项奖励
8 回复数
Altera_Forum
名誉分销商 II
1,690 次查看

You can add Avalon bus interface to your FPGA module. Here more details about the bus: http://www.altera.com/literature/manual/mnl_avalon_spec.pdf  

What kind of data do you need to access in your module? It the data volume is low you can simply implement Avalon MM Slave interface and poll periodically the registers from Nios II.
0 项奖励
Altera_Forum
名誉分销商 II
1,689 次查看

First go to the sopc builder add the desire component like PIO and give it to desire name , and then go to nios-ii processor .v file and add that component in it (take a view of other io, how they are added) and then create new symbol of nios-ii and update it. then you will have that io available at input or output side whatever you select while adding component in sopc. this is the hardware part.

0 项奖励
Altera_Forum
名誉分销商 II
1,690 次查看

linas: 

thank you for your help,and I still have a question:If I build a dual-port ram use the MageWizard Plug-in manager,how can I conect the nios II system to the dual-port ram 

And the data between niosII system and FPGA module are some 16-bit word data,and each word may Has a different meaning,So I need write each word of data in a different  

 

address in the ram,and the reading process is also the same,So I think I can't do it in the way you just mentioned
0 项奖励
Altera_Forum
名誉分销商 II
1,690 次查看

Kaushal: 

first thanks for your help,and if I build a dual-port ram use the MageWizard Plug-in manager(),how can I connect the nios II system to the dual-port ram? can I just connect the nios II system to the dual-port ram through some PIO (connect the PIO to the address bus、data bus....),and than operate this PIOs in the nios II system to write/read data to/from the dual-port ram?
0 项奖励
Altera_Forum
名誉分销商 II
1,690 次查看

What about using DMA, that writes data from your module to shared single port RAM later accessed by Nios II? You must write some kind Avalon MM adapter to access your component from Nios II in every case.

0 项奖励
Altera_Forum
名誉分销商 II
1,690 次查看

linas: 

So now the most important thing is to learn how to write the Avalon MM adapter to access my dual-port ram form Nios II!thank you!
0 项奖励
Altera_Forum
名誉分销商 II
1,690 次查看

Look at the documentation of Altera's Avalon bus. These adapters (slave and master templates) are provided by Altera here: http://www.altera.com/support/examples/exm-list.jsp?cat=embedded  

You may also search in this forum, there were vhdl versions of these adapters somewhere. 

But I suggest you to skip on-chip RAM. I am sure, that your Nios II has its own memory, it would be smarter that your component writes data directly to that memory. Arbitration circuitry is crated by SOPC Builder, so you need just to provide write signal, address and data through your adapter to the Avalon bus.
0 项奖励
Altera_Forum
名誉分销商 II
1,690 次查看

yes ! 

and control it through u r C-code, details of u r added component is available in u r system.h file
0 项奖励
回复