diff --git a/techlibs/xilinx/xilinx_srl.cc b/techlibs/xilinx/xilinx_srl.cc index e23062eb7..10aa789e5 100644 --- a/techlibs/xilinx/xilinx_srl.cc +++ b/techlibs/xilinx/xilinx_srl.cc @@ -77,7 +77,7 @@ void run_fixed(xilinx_srl_pm &pm) } else log_abort(); - if (first_cell->type.in(ID($_DFFE_NP_), ID($_DFFE_PP_))) + if (first_cell->type.in(ID($_DFFE_NP_), ID($_DFFE_PP_), ID(FDRE), ID(FDRE_1))) c->setParam(ID(ENPOL), 1); else if (first_cell->type.in(ID($_DFFE_NN_), ID($_DFFE_PN_))) c->setParam(ID(ENPOL), 0); diff --git a/tests/arch/xilinx/xilinx_srl_enable.ys b/tests/arch/xilinx/xilinx_srl_enable.ys new file mode 100644 index 000000000..c95a849aa --- /dev/null +++ b/tests/arch/xilinx/xilinx_srl_enable.ys @@ -0,0 +1,46 @@ +# Regression test for a xilinx_srl bug where a fixed shift register inferred +# from FDRE cells dropped the clock enable. FDRE has an active high clock +# enable but run_fixed assigned it ENPOL 2 (no enable) instead of ENPOL 1, +# so the resulting shift register shifted every cycle and ignored stalls. +read_verilog <