Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12453 Discussions

Share variables and data between Nios2 and HDL prefably VHDL

Altera_Forum
Honored Contributor II
1,433 Views

Hi 

 

 

How do I send data from Nios 2 processor to HDL in quartus. I need to send data such as a variable i.e. a=5; or array[20] to the vhdl side in quartus. How do I set up a shared memory space. I am using the Altera DE3 board. Please explain to me carefully, I have around 4 months of vhdl and fpga experience.  

 

 

Regards 

 

 

Reigngt09
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
178 Views

Simplest way is through an avalon MM slave.

Altera_Forum
Honored Contributor II
178 Views

How would I go about implementing the avalon MM Slave to send data through?

Altera_Forum
Honored Contributor II
178 Views

On the HDL side refer to the avalon specification: 

http://www.altera.com/literature/manual/mnl_avalon_spec.pdf 

 

On NIOS side use "IORD" and "IOWR" 

poking through some of the nios example templates will help with learn how to do this
Altera_Forum
Honored Contributor II
178 Views

Hi 

 

i also would like to know how this works.  

 

In my project i want to send some control parameters to the Nios processor via the rs232 interface.  

Nios should then store them in some kind of a shared memory location where my custom vhdl logic reads from.  

 

 

I read that i could use a DMA or SGDMA Controller but this seems a bit of an overkill since i just want to sent parameters. 

I know the address range of my DDR3 RAM and how to write to a specific address. But i have a understanding problem with  

the reading part. 

 

 

I need an avalon slave device which i hook up to the avalon interconnect. 

Could i simply use a FIFO in write/read slave modus? 

If i connect the NIOS instruction and data master with the slave-in port and export the slave-out port to connect it up my logic.  

With C i then write directly to the Fifo buffer and the vhdl logic reads from the buffer directly.(?) 

 

Since only master-slave connections are allowed my logic to act as a master and initiate the read operations.  

and the vhdl module needs a lot of control functionalities like readdata, read address ? 

 

Or is it easier to use a onchip memory ram device with dual port access.  

I could write a specific parameter to a specific mem address and through this exact mapping its simple in  

VHDL to extract the parameters. 

But i still have the uncertainty with the slave port to the vhdl module and in general how to set up this shared memory location. 

 

The more i read about this topic the more i get confused and  

it would be great if you guys could help me  

 

 

Thanks in advance 

Tim
Reply