aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/xilinx/cells_sim.v
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-04-22 11:45:49 -0700
committerEddie Hung <eddie@fpgeh.com>2019-04-22 11:45:49 -0700
commit4486a98fd5928a4e3cdf9cd27c27b7dd821513bb (patch)
tree0afd22de8a09ab3995355e3813015c4523bd63fd /techlibs/xilinx/cells_sim.v
parentcbb85e40e87fbfb1602bb934ed76a97efb9e55c6 (diff)
parentec88129a5cf510afc39ea12efa6059bed3eadfc3 (diff)
downloadyosys-4486a98fd5928a4e3cdf9cd27c27b7dd821513bb.tar.gz
yosys-4486a98fd5928a4e3cdf9cd27c27b7dd821513bb.tar.bz2
yosys-4486a98fd5928a4e3cdf9cd27c27b7dd821513bb.zip
Merge remote-tracking branch 'origin/xc7srl' into xc7mux
Diffstat (limited to 'techlibs/xilinx/cells_sim.v')
-rw-r--r--techlibs/xilinx/cells_sim.v39
1 files changed, 39 insertions, 0 deletions
diff --git a/techlibs/xilinx/cells_sim.v b/techlibs/xilinx/cells_sim.v
index 0c8f282a4..3a4540b83 100644
--- a/techlibs/xilinx/cells_sim.v
+++ b/techlibs/xilinx/cells_sim.v
@@ -308,3 +308,42 @@ module RAM128X1D (
wire clk = WCLK ^ IS_WCLK_INVERTED;
always @(posedge clk) if (WE) mem[A] <= D;
endmodule
+
+module SRL16E (
+ output Q,
+ input A0, A1, A2, A3, CE, CLK, D
+);
+ parameter [15:0] INIT = 16'h0000;
+ parameter [0:0] IS_CLK_INVERTED = 1'b0;
+
+ reg [15:0] r = INIT;
+ assign Q = r[{A3,A2,A1,A0}];
+ generate
+ if (IS_CLK_INVERTED) begin
+ always @(negedge CLK) if (CE) r <= { r[14:0], D };
+ end
+ else
+ always @(posedge CLK) if (CE) r <= { r[14:0], D };
+ endgenerate
+endmodule
+
+module SRLC32E (
+ output Q,
+ output Q31,
+ input [4:0] A,
+ input CE, CLK, D
+);
+ parameter [31:0] INIT = 32'h00000000;
+ parameter [0:0] IS_CLK_INVERTED = 1'b0;
+
+ reg [31:0] r = INIT;
+ assign Q31 = r[31];
+ assign Q = r[A];
+ generate
+ if (IS_CLK_INVERTED) begin
+ always @(negedge CLK) if (CE) r <= { r[30:0], D };
+ end
+ else
+ always @(posedge CLK) if (CE) r <= { r[30:0], D };
+ endgenerate
+endmodule