yosys/manual/CHAPTER_StateOfTheArt/arrays01.v

17 lines
276 B
Verilog
Raw Normal View History

2013-07-20 08:19:12 -05:00
module uut_arrays01(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 [15:0];
always @(posedge clock) begin
if (we)
memory[addr] <= wr_data;
rd_data <= memory[addr];
end
endmodule