aboutsummaryrefslogtreecommitdiffstats
path: root/tests/arch/efinix/memory.v
blob: 5634d6507fc7385932aa4ec8bb67cc8f24259387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module top
(
	input [7:0] data_a,
	input [8:1] addr_a,
	input we_a, clk,
	output reg [7:0] q_a
);
	// Declare the RAM variable
	reg [7:0] ram[63:0];

	// Port A
	always @ (posedge clk)
	begin
		if (we_a)
		begin
			ram[addr_a] <= data_a;
			q_a <= data_a;
		end
		q_a <= ram[addr_a];
	end
endmodule