fifo memory initialization

Status
Not open for further replies.

stanford

Full Member level 2
Joined
Feb 16, 2014
Messages
132
Helped
4
Reputation
8
Reaction score
6
Trophy points
1,298
Activity points
2,223
Is below correct for initializing fifo and is this synthesizable?

Code:
logic [4:0] wptr;
logic [7:0] mem [15:0];
genvar i;

always_ff @(posedge wclk or negedge wrst)
	if (!wrst)
		for (i=0;i<16;i=i+1)
			mem[i] <= '0;
	else if (winc && !full)
		mem[wptr[3:0]] <= wdata[7:0];
 


This will generate a flop-based FIFO in which every flop has an async reset input. It's fine for a small size, but for larger FIFOs you probably want SRAM.
 

Power-on reset or initialization of BRAM is for free, if you want to perform an arbitrary reset, it must be coded sequentially, one memory cell per clock cycle.
 

Power-on reset or initialization of BRAM is for free, if you want to perform an arbitrary reset, it must be coded sequentially, one memory cell per clock cycle.

But but... this is ASIC.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…