Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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];
 

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top