Altera_Forum
Honored Contributor
15 years agohow to read data from FIFO in SOPC
hi,BadOmen or other gurus:
I write a SOPC component which is connected to AVALON bus.the custom component mainly consist of FIFO,I want to write a large bulk of datas in it and then read the datas out as the slave interface of the SOPC system. in quartusII: FIFO this_fifo(.aclr(~reset_n ), . data(active_data), .rdclk(clk_50M), .rdreq(sl_read & sl_chipselect & out_en & (~rdempty) ), .wrclk(clk_27M), .wrreq(in_en & (~wrfull) ), .q(sl_readdata), .rdempty(rdempty), .wrfull(wrfull) ); In NiosII eclipse software,I write: while(1) { read_fifo=IORD_ALTERA_AVALON_PIO_DATA(CUSTOM_FIFO_BASE); } return 0; } then I wacthed these signals by signaltapII,there are several phenomenons I cannot understand!~ 1: There seems that the sl_chipselect,sl_read pulses are generated automatically,how can I control them,because I want to change the pulse frequences and the times when they need to be generated?? (I have try to add a timer in SOPC system and named it "sys_clk_timer",then in NiosII eclipse,I choose the "sys_clk_timer" ,but it cannot play a part) 2: I check the signaltapII waves ,and find that the active_data which is writed in FIFO are not the same as the sl_readdata which is readed from the FIFO(sometimes,the part datas in front of sl_readdata are right,then are wrong)?? 3:I have readed the .pdf of the FIFO,it says that,"aclr" signal should controlled by wrclk,maybe the FIFO component I make is not stable?? thanks for your patient answer~ best regards!