Forum Discussion
Altera_Forum
Honored Contributor
15 years agoThe macro you are using is for the PIO component. You want to do something this instead:
# include "io.h"# include "system.h" ..... read_data = IORD_32DIRECT(BASE_ADDRESS_OF_SLAVE, BYTE_OFFSET); "BASE_ADDRESS_OF_SLAVE" is whatever your custom component shows up as in system.h and "BYTE_OFFSET" is the offset inside your component you are reading from, make sure you express the offset in bytes and not 32-bit words. Looking at your HDL I see a couple of issues: 1) You have 18 bits of addressing but no address decoding, so a read from any address will pop the FIFO 2) You don't prevent reads from the FIFO when it's empty. Waitrequest should be driven high when the FIFO is empty and the rdreq of the FIFO should be gated by this condition. 3) You are driving the FIFO aclr with an active low reset_n signal, in other words your FIFO is stuck in reset and that's why no data is moving through