Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

how to achieve the communication between niosII system and FPGA module

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!

8 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    yes !

    and control it through u r C-code, details of u r added component is available in u r system.h file