aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/xilinx/cells_sim.v
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-06-24 16:39:18 -0700
committerEddie Hung <eddie@fpgeh.com>2019-06-24 16:39:18 -0700
commitf1675b88f63b4c279e368d5ec9e6ca48f528024d (patch)
treec2f436e5f9350b00d648a68b32bc693294f3ed26 /techlibs/xilinx/cells_sim.v
parentc3df895bf464fd651c4d634ecb58ba78ca572f5f (diff)
parentefd04880dbeb2021c503c82ad962fe8c5d6802d4 (diff)
downloadyosys-f1675b88f63b4c279e368d5ec9e6ca48f528024d.tar.gz
yosys-f1675b88f63b4c279e368d5ec9e6ca48f528024d.tar.bz2
yosys-f1675b88f63b4c279e368d5ec9e6ca48f528024d.zip
Merge remote-tracking branch 'origin/eddie/ram32x1d' into xc7mux
Diffstat (limited to 'techlibs/xilinx/cells_sim.v')
-rw-r--r--techlibs/xilinx/cells_sim.v17
1 files changed, 17 insertions, 0 deletions
diff --git a/techlibs/xilinx/cells_sim.v b/techlibs/xilinx/cells_sim.v
index 8c04d602e..29abc9807 100644
--- a/techlibs/xilinx/cells_sim.v
+++ b/techlibs/xilinx/cells_sim.v
@@ -289,6 +289,23 @@ module FDPE_1 (output reg Q, input C, CE, D, PRE);
always @(negedge C, posedge PRE) if (PRE) Q <= 1'b1; else if (CE) Q <= D;
endmodule
+module RAM32X1D (
+ output DPO, SPO,
+ input D, WCLK, WE,
+ input A0, A1, A2, A3, A4,
+ input DPRA0, DPRA1, DPRA2, DPRA3, DPRA4,
+);
+ parameter INIT = 32'h0;
+ parameter IS_WCLK_INVERTED = 1'b0;
+ wire [4:0] a = {A4, A3, A2, A1, A0};
+ wire [4:0] dpra = {DPRA4, DPRA3, DPRA2, DPRA1, DPRA0};
+ reg [31:0] mem = INIT;
+ assign SPO = mem[a];
+ assign DPO = mem[dpra];
+ wire clk = WCLK ^ IS_WCLK_INVERTED;
+ always @(posedge clk) if (WE) mem[a] <= D;
+endmodule
+
module RAM64X1D (
output DPO, SPO,
input D, WCLK, WE,