Forum Discussion
Altera_Forum
Honored Contributor
16 years agoi can't give you and an VHDL example as i use verilog HDL
but have a look at avalon memory-mapped slave template (http://www.altera.com/support/examples/nios2/exm-avalon-memory-slave.html?gsa_pos=1&wt.oss_r=1&wt.oss=avalon slave template) to understand how you can include your own functionality as an sopc component. mainly you need some signals like chipselect, write, writedata, read, readdata and clock & reset you need to code a register that holds your signals you want to control via nios this register is read via the read signal and delivers its content via readdata and vice versa, write & writedata to store the information. use chipselect to enable the access now you can use one of these bits from that register as enable for your functionality