aboutsummaryrefslogtreecommitdiffstats
path: root/tests/xilinx_ug901/rams_sp_nc.v
diff options
context:
space:
mode:
Diffstat (limited to 'tests/xilinx_ug901/rams_sp_nc.v')
-rw-r--r--tests/xilinx_ug901/rams_sp_nc.v26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/xilinx_ug901/rams_sp_nc.v b/tests/xilinx_ug901/rams_sp_nc.v
new file mode 100644
index 000000000..08abc0d2c
--- /dev/null
+++ b/tests/xilinx_ug901/rams_sp_nc.v
@@ -0,0 +1,26 @@
+// Single-Port Block RAM No-Change Mode
+// File: rams_sp_nc.v
+
+module rams_sp_nc (clk, we, en, addr, di, dout);
+
+input clk;
+input we;
+input en;
+input [9:0] addr;
+input [15:0] di;
+output [15:0] dout;
+
+reg [15:0] RAM [1023:0];
+reg [15:0] dout;
+
+always @(posedge clk)
+begin
+ if (en)
+ begin
+ if (we)
+ RAM[addr] <= di;
+ else
+ dout <= RAM[addr];
+ end
+end
+endmodule