blob: 37e63c1d00140f576a47afeffaea0aa3f29f2e9b (
plain)
1
2
3
4
5
6
7
8
9
10
|
module top(input [3:0] addr, wdata, input clk, wen, output reg [3:0] rdata);
typedef logic [3:0] ram16x4_t[0:15];
ram16x4_t mem;
always @(posedge clk) begin
if (wen) mem[addr] <= wdata;
rdata <= mem[addr];
end
endmodule
|