Altera_Forum
Honored Contributor
14 years agoAccess custum module using IOWR
Hello, I am having trouble accessing to my module using niosII IOWR function.:cry:
my logic is below: == module test_module( input clk, input wren, input[15:0] indata, output reg[15:0] outtdata); always @ (posedge clk) begin if(wren == 1) outdata = indata; end initial begin outdata = 123; end endmodule == my niosii software is below: == ... test = IORD(TEST_MODULE_0_BASE, 0); // (1) IOWR(TEST_MODULE_0_BASE, 0, 456); test = IORD(TEST_MODULE_0_BASE, 0); // (2) == I can read "123" at (1), but always get "0" at (2) instead of "456". My module is an Avalon Memory Mapped Slave, wren is "write", indata is "writedata", outdata is "readdata" for signal type in SOPC Builder. Any suggestion is appreciated!