Hi,I'm new to Nios and is learning to set up connection between Nios and other peripherals. Suppose a component is connected with Nios through avalon mm interface, the component works as a slave and performs certain task. I'm wondering how to let Nios know that the task is accomplished? My guess is that a single bit register on the component is toggled when the task is done, while Nios keeps reading from this register to check the status. Is this the correct / common way to do the job? If not, how to do that? Thanks
Yes it is a common way to do it. You have a status bit, either a "busy" or "running" bit that is 1 as long as the component is performing the tast, or a "done" bit that is 0 when processing and 1 when the task is finished. The CPU regularly reads that bit and waits until it changes to the regular value. This is called "polling".If the task is long and you would like the CPU to do something else in the mean time and be warned as soon as the task is finished, you can also use an interrupt.