FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
Announcements
All support for Intel NUC 7 - 13 systems has transitioned to ASUS. Read latest update.
6325 Discussions

example avalon slave code in VHDL

Altera_Forum
Honored Contributor II
3,346 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
1,613 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.
0 Kudos
Altera_Forum
Honored Contributor II
1,613 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!
0 Kudos
Altera_Forum
Honored Contributor II
1,613 Views

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

0 Kudos
Altera_Forum
Honored Contributor II
1,613 Views

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

thanks to everyone.
0 Kudos
Reply