I've created a Nios system with a peripheral that I built in DSP Builder. Now, I want to program the system in Nios II 10.0 IDE. To write in my DSP peripheral I use the macro IOWR, but what .h file do I have to add? (For example, if you use the PIO, you have to add the file "altera_avalon_pio_regs.h" because in this file is defined the macro IOWR)Thanks.
Hi!IOWR and IORD are not defined in this *.h-file. In this file are macros defined which only use IOWR/IORD. For example --- Quote Start --- #define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0) --- Quote End --- Meaning that the PIO_DATA-register lies at <BASE_ADDRESS> + (offset=0). Usually the developer who created the sopc-component write these reg-files so that a software-engineer can access the component more easily. If you are writing code using iord_altera_avalon_pio_data(base) your code becomes more readable. Of course you could use iord(base, offset). But then you have to take care that you are using the correct offset everytime you access your component. So in your case, you have to do it on your own or use IORD/IOWR directly, knowing which offset is for which register. Regards P.S.: I don't know, never used the DSP Builder. But maybe there is a tool/template for the DSP Builder?