aboutsummaryrefslogtreecommitdiffstats
path: root/tests/memories/read_two_mux.v
blob: 4f2e7e1cd7b92664cb9476b8fdf65c688c58e810 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// expect-wr-ports 1
// expect-rd-ports 1
// expect-no-rd-clk

module top(input clk, input we, re, reset, input [7:0] addr, wdata, output reg [7:0] rdata);

reg [7:0] bram[0:255];
(* keep *) reg dummy;

always @(posedge clk) begin
	rdata <= re ? (reset ? 8'b0 : bram[addr]) : rdata;
	if (we)
		bram[addr] <= wdata;
end

endmodule