Forum Discussion
Altera_Forum
Honored Contributor
21 years agoHi nir, thank you for your example. I added it to my system but I still have some questions about it.
I mapped the "output" signal to type export because it's a not-avalon signal, right? Why are the expressions like input1 <= input1 needed? For me they don't make any sense. For accessing the peripheral I wrote the following code (EXAMPLE_INTERFACE_BASE is the address of our example peripheral):int t;
IOWR(EXAMPLE_INTERFACE_BASE, 0 , 255);
t = IORD(EXAMPLE_INTERFACE_BASE, 0);
printf ("t = %d\n", t); I would expect t to be 1 but the result is always 0. Why? What am I doing wrong? And the last question: in this example we in principle can access eigth 32-bit input ports and eigth 32-bit output ports (because address is a 3-bit value), right? What if I want to have lets say two 3-bit input ports, one 1-bit input port, one 32-bit input port and one 1-bit output port? How do I have do declare them in the vhdl-code and access them from them SW?