Fix tests/various/async FFL test
authorClifford Wolf <clifford@clifford.at>
Tue, 9 Jul 2019 20:44:39 +0000 (22:44 +0200)
committerClifford Wolf <clifford@clifford.at>
Tue, 9 Jul 2019 20:44:39 +0000 (22:44 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
passes/sat/clk2fflogic.cc
tests/various/async.v

index 49ec795d352ed134026e779d691141e0ae8b9d05..4bb4aa04762ec646d7736abd8ce15b3a5cec8585 100644 (file)
@@ -253,6 +253,13 @@ struct Clk2fflogicPass : public Pass {
                                                SigSpec qval = module->Mux(NEW_ID, past_q, past_d, clock_edge);
                                                Const rstval = cell->parameters["\\ARST_VALUE"];
 
+                                               Wire *past_arst = module->addWire(NEW_ID);
+                                               module->addFf(NEW_ID, arst, past_arst);
+                                               if (cell->parameters["\\ARST_POLARITY"].as_bool())
+                                                       arst = module->LogicOr(NEW_ID, arst, past_arst);
+                                               else
+                                                       arst = module->LogicAnd(NEW_ID, arst, past_arst);
+
                                                if (cell->parameters["\\ARST_POLARITY"].as_bool())
                                                        module->addMux(NEW_ID, qval, rstval, arst, sig_q);
                                                else
index 1e32a06b5079fbecd8df06675e23d38a8fff203a..c27e30c4b99050e845d4b3c9b1ac93912acd8ab4 100644 (file)
@@ -74,7 +74,7 @@ module testbench;
                        if (q_uut !== q_syn) msg = "SYN";
                        if (q_uut !== q_prp) msg = "PRP";
                        if (q_uut !== q_a2s) msg = "A2S";
-                       // if (q_uut !== q_ffl) msg = "FFL";
+                       if (q_uut !== q_ffl) msg = "FFL";
                        $display("%6t %b %b %b %b %b %s", $time, q_uut, q_syn, q_prp, q_a2s, q_ffl, msg);
                        if (msg != "OK") $finish;
                end