Forum Discussion
SS5
Occasional Contributor
7 years agoHi
On-Chip Memory Size is 4096
FIFO Depth : 1024
So, have i have set the
# define ALMOST_EMPTY 1
# define ALMOST_FULL 1000 //FIFO Depth 1024The ALMOSTEMPTY and ALMOSTFULL printed in the console are correct.
# define ALMOST_EMPTY 1
# define ALMOST_FULL 1000 //FIFO Depth 1024
int main()
{
int result,i=0;
// Reset the FIFO's IRQ History register. *
altera_avalon_fifo_clear_event(FIFO_0_IN_CSR_BASE, ALTERA_AVALON_FIFO_EVENT_ALL);
int code = ALTERA_AVALON_FIFO_OK;
code= altera_avalon_fifo_init(FIFO_0_IN_CSR_BASE, 0x3F,ALMOST_EMPTY,ALMOST_FULL);
IOWR(ENABLE_PIO_BASE, 0, 0x1);
printf("STATUS = %u\n", altera_avalon_fifo_read_status(FIFO_0_IN_CSR_BASE,altera_avalon_fifo_read_status));
while(1)
{
result=altera_avalon_fifo_read_fifo(FIFO_0_OUT_BASE,FIFO_0_IN_CSR_BASE);
printf("%d\n",result);
}
return 0;
}In NIOS console,
STATUS =16
result: 0
Suggestion Please