aboutsummaryrefslogtreecommitdiffstats
path: root/tests/simple/arrays02.sv
blob: 76c2a7388deb8df00bb0fc5b1b9bc0c42769251c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module uut_arrays02(clock, we, addr, wr_data, rd_data);

input clock, we;
input [3:0] addr, wr_data;
output [3:0] rd_data;
reg [3:0] rd_data;

reg [3:0] memory [16];

always @(posedge clock) begin
	if (we)
		memory[addr] <= wr_data;
	rd_data <= memory[addr];
end

endmodule