From 12383f37b2e1d72784e01db0431efc8882f25430 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 18 Oct 2019 12:33:35 +0200 Subject: Common memory test now shared --- tests/arch/common/memory.v | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/arch/common/memory.v (limited to 'tests/arch/common/memory.v') diff --git a/tests/arch/common/memory.v b/tests/arch/common/memory.v new file mode 100644 index 000000000..cb7753f7b --- /dev/null +++ b/tests/arch/common/memory.v @@ -0,0 +1,21 @@ +module top +( + input [7:0] data_a, + input [6: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 -- cgit v1.2.3