OpenFPGA/yosys/tests/simple/arrays02.sv

17 lines
274 B
Systemverilog
Raw Normal View History

2019-11-27 15:40:39 -06:00
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