Forum Discussion
Altera_Forum
Honored Contributor
14 years agoStrange problem with IORD_16DIRECT
Hi, I have a 16-bit pio (input) in my sopc and I want to access the data through IORD_16DIRECT. The data shown on the port is 0x00, 0x01, 0x02....0xff (verified through signaltap). However, th...
Altera_Forum
Honored Contributor
14 years agoIs your pio returning the next value on each read request?
Are you decoding the address lines properly? Although you are using IORD_16DIRECT() the bus cycle requested by the nios cpu will be a 32bit one (with all byte enables asserted). Since your slave is 16bit it will see 2 read cycles, one for address 0 and one for address 2 (not sure what the address line is called by then! - might be A0 relative to your slave). In practise it is best to use 32bit slaves and set the high bits to zero on reads.