Altera_Forum
Honored Contributor
13 years agoMegaWizard FIFO misses first write
I'm using a MegaWizard FIFO in my CPLD design and it always misses the first data written to it after a reset. I've done everything I could think of in changing the edge of the write signal, creating a special clock using a state machine and nothing i do will result in the FIFO getting the first byte of data. Every write after that works perfectly. Has anyone experienced that? Is there a defect in the FIFO plugin?
Here is the interface to the FIFO:
fifo tx_fifo(
.aclr(rst),
.data(tx_byte),
.rdclk(clk),
.rdreq(tx_read_fifo),
.wrclk(tx_wrclk),
.wrreq(tx_wrreq),
.q(tx_fifo_data),
.rdempty(tx_fifo_empty),
.wrfull(tx_fifo_full));
Basically all you need to do is set the wrreq true, put data on the data input and then give it a wrclk (pos edge signals). I can see that this cycle works fine in subsequent writes, but something is screwy with the first one after a reset (aclr).