aboutsummaryrefslogtreecommitdiffstats
path: root/tests/techmap/mem_simple_4x1_cells.v
blob: 7ecdd2dee0923bf95dda302a7eed965a2c3906c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module MEM4X1 (CLK, RD_ADDR, RD_DATA, WR_ADDR, WR_DATA, WR_EN);
	input CLK, WR_DATA, WR_EN;
	input [3:0] RD_ADDR, WR_ADDR;
	output reg RD_DATA;

	reg [15:0] memory;

	always @(posedge CLK) begin
		if (WR_EN)
			memory[WR_ADDR] <= WR_DATA;
		RD_DATA <= memory[RD_ADDR];
	end
endmodule