FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
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.
5988 Discussions

example avalon slave code in VHDL

Altera_Forum
Honored Contributor II
2,665 Views

I'm new to Altera and I need to create a component with avalon memory mapped slave interface. 

I really would like to see an example in VHDL code. I only can find examples in verilog code. 

 

Thanks
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
932 Views

Do you know a little bit about SOPC Builder? 

 

You could start a clean Quartus II project, open the SOPC Builder, Create New System by choosing VHDL as Target HDL. Then add: 

1) a Nios proc (just default) for having an avalon master (otherwise there will be an error message) 

2) an Onchip Ram (System Contents -> Altera SOPC Builder -> Avalon Components -> Memory-> On-Chip Memory) with e.g. 1kBytes (default for exception and reset address, otherwise there will be an error message) 

3) an Interval Timer (System Contents -> Altera SOPC Builder -> Avalon Components -> Others -> Interval Timer).  

 

Then go to the tap 'System Generation' and click 'Generate'.  

 

After generating that SOPC Builder project you will find a timer_0.vhd in you Quartus II project folder. This is quite simple VHDL code with an Avalon Slave Interface. You can try out some parameter settings of the Interval Timer and compare the results in the VHDL file. Keep in mind, that it's really just an example, depending on your needs, the avalon memory mapped slave interface signals can differ. For example, maybe you will never need an interrupt signal. For further information refer to the manual for the avalon memory mapped interface.
Altera_Forum
Honored Contributor II
932 Views

Thanks Herbert, 

 

That helped! 

I mannaged to create components with all the interfaces I need. 

 

I worked earlier with Xilinx tools. But these Altera tools are very good!
Altera_Forum
Honored Contributor II
932 Views

Thank you both, I had this exact same question. Good answer.

Altera_Forum
Honored Contributor II
932 Views

I also required the same slave templates in VHDL. your replies got helpful. 

thanks to everyone.
Reply