From 7770fa70e1662e92be8f793af28ffde1cb816d81 Mon Sep 17 00:00:00 2001 From: Chun Lin Min Date: Thu, 4 Jul 2024 05:20:22 -0700 Subject: [PATCH] fix cells_sim.v --- techlibs/mchp/cells_sim.v | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/techlibs/mchp/cells_sim.v b/techlibs/mchp/cells_sim.v index a89f17843..a1f7ae6b8 100644 --- a/techlibs/mchp/cells_sim.v +++ b/techlibs/mchp/cells_sim.v @@ -166,15 +166,20 @@ module MCHP_SYNC_SET_DFF( input En, output Q); parameter [0:0] INIT = 1'b0; // unused + + reg q_ff; + always @(posedge CLK) begin if (En == 1) begin if (Set == 0) - Q <= 1; + q_ff <= 1; else - Q <= D; + q_ff <= D; end end + assign Q = q_ff; + specify $setup(D , posedge CLK &&& En && Set, 0); // neg setup not supported? $setup(En, posedge CLK, 109); @@ -192,15 +197,20 @@ module MCHP_SYNC_RESET_DFF( input En, output Q); parameter [0:0] INIT = 1'b0; // unused - always @(posedge C) begin + + reg q_ff; + + always @(posedge CLK) begin if (En == 1) begin if (Reset == 0) - Q <= 0; + q_ff <= 0; else - Q <= D; + q_ff <= D; end end + assign Q = q_ff; + specify $setup(D , posedge CLK &&& En && Reset, 0); // neg setup not supported? $setup(En, posedge CLK, 109);