File: arrays01.v

package info (click to toggle)
yosys 0.7-2%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,196 kB
  • sloc: cpp: 70,658; python: 1,795; yacc: 1,785; sh: 1,397; makefile: 658; lex: 467; perl: 399; ansic: 97; tcl: 13
file content (16 lines) | stat: -rw-r--r-- 276 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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