blob: ddd41a13e8b1d4f1d7e3200dc47e2e18b604c3c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// expect-wr-ports 1
// expect-rd-ports 1
// expect-rd-clk \clk
// expect-rd-en \re
module top(input clk, we, re, input [7:0] addr, wd, output reg [7:0] rd);
reg [7:0] mem[0:255];
always @(posedge clk) begin
if (we)
mem[addr] <= wd;
if (re) begin
rd <= mem[addr];
if (we)
rd <= wd;
end
end
endmodule
|