From 5344bfe637e0c8d527f94f615e4ed8704c358cf8 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 6 Sep 2019 15:46:15 -0700 Subject: Perform D replacement properly --- passes/pmgen/xilinx_dsp.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'passes/pmgen/xilinx_dsp.cc') diff --git a/passes/pmgen/xilinx_dsp.cc b/passes/pmgen/xilinx_dsp.cc index 547073aa6..ba8a1de05 100644 --- a/passes/pmgen/xilinx_dsp.cc +++ b/passes/pmgen/xilinx_dsp.cc @@ -144,13 +144,22 @@ void pack_xilinx_dsp(dict &bit_to_driver, xilinx_dsp_pm &pm) cell->setParam("\\BREG", 1); } if (st.ffD) { + SigSpec D_ = cell->getPort("\\D"); + SigSpec D = st.ffB->getPort("\\D"); + SigSpec Q = st.ffB->getPort("\\Q"); + D_.replace(Q, D); + if (st.ffDmux) { + SigSpec Y = st.ffDmux->getPort("\\Y"); + SigSpec AB = st.ffDmux->getPort(st.ffDenpol ? "\\B" : "\\A"); SigSpec S = st.ffDmux->getPort("\\S"); - cell->setPort("\\CED", st.ffBenpol ? S : pm.module->Not(NEW_ID, S)); + D_.replace(Y, AB); + + cell->setPort("\\CED", st.ffDenpol ? S : pm.module->Not(NEW_ID, S)); } else cell->setPort("\\CED", State::S1); - cell->setPort("\\D", st.sigD); + cell->setPort("\\D", D_); cell->setParam("\\DREG", 1); } -- cgit v1.2.3