aboutsummaryrefslogtreecommitdiffstats
path: root/tests/arch/xilinx/pmgen_xilinx_srl.ys
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-10-18 11:06:12 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2019-10-18 11:06:12 +0200
commitc2ec7ca7031e2e9c655723fcdb3ce3cb83cc74b1 (patch)
tree79cce7951390a0068beeab26be5d310222059c51 /tests/arch/xilinx/pmgen_xilinx_srl.ys
parent3c41599ee1f62e4d77ba630fa1a245ef3fe236fa (diff)
downloadyosys-c2ec7ca7031e2e9c655723fcdb3ce3cb83cc74b1.tar.gz
yosys-c2ec7ca7031e2e9c655723fcdb3ce3cb83cc74b1.tar.bz2
yosys-c2ec7ca7031e2e9c655723fcdb3ce3cb83cc74b1.zip
Moved all tests in arch sub directory
Diffstat (limited to 'tests/arch/xilinx/pmgen_xilinx_srl.ys')
-rw-r--r--tests/arch/xilinx/pmgen_xilinx_srl.ys57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/arch/xilinx/pmgen_xilinx_srl.ys b/tests/arch/xilinx/pmgen_xilinx_srl.ys
new file mode 100644
index 000000000..ea2f20487
--- /dev/null
+++ b/tests/arch/xilinx/pmgen_xilinx_srl.ys
@@ -0,0 +1,57 @@
+read_verilog -icells <<EOT
+module \$__XILINX_SHREG_ (input C, input D, input [31:0] L, input E, output Q, output SO);
+ parameter DEPTH = 1;
+ parameter [DEPTH-1:0] INIT = 0;
+ parameter CLKPOL = 1;
+ parameter ENPOL = 2;
+
+ wire pos_clk = C == CLKPOL;
+ reg pos_en;
+ always @(E)
+ if (ENPOL == 2) pos_en = 1'b1;
+ else pos_en = (E == ENPOL[0]);
+
+ reg [DEPTH-1:0] r;
+ always @(posedge pos_clk)
+ if (pos_en)
+ r <= {r[DEPTH-2:0], D};
+
+ assign Q = r[L];
+ assign SO = r[DEPTH-1];
+endmodule
+EOT
+read_verilog +/xilinx/cells_sim.v
+proc
+design -save model
+
+test_pmgen -generate xilinx_srl.fixed
+hierarchy -top pmtest_xilinx_srl_pm_fixed
+flatten; opt_clean
+
+design -save gold
+xilinx_srl -fixed
+techmap -autoproc -map %model
+design -stash gate
+
+design -copy-from gold -as gold pmtest_xilinx_srl_pm_fixed
+design -copy-from gate -as gate pmtest_xilinx_srl_pm_fixed
+dff2dffe -unmap # sat does not support flops-with-enable yet
+miter -equiv -flatten -make_assert gold gate miter
+sat -set-init-zero -seq 5 -verify -prove-asserts miter
+
+design -load model
+
+test_pmgen -generate xilinx_srl.variable
+hierarchy -top pmtest_xilinx_srl_pm_variable
+flatten; opt_clean
+
+design -save gold
+xilinx_srl -variable
+techmap -autoproc -map %model
+design -stash gate
+
+design -copy-from gold -as gold pmtest_xilinx_srl_pm_variable
+design -copy-from gate -as gate pmtest_xilinx_srl_pm_variable
+dff2dffe -unmap # sat does not support flops-with-enable yet
+miter -equiv -flatten -make_assert gold gate miter
+sat -set-init-zero -seq 5 -verify -prove-asserts miter