The following example shows how I would like to model
the cell. It is correct except that the output
does NOT go to X when notify toggles due to a setup
violation. I suspect this is because there are two
lines that can apply (if D is 0), lines 2 and 7.
If line 2 is processed last, the output goes to 0
instead of X.
This must be a common problem for anyone using
UDPs as described in the Verilog-XL reference
manual. Does anyone have any suggestions on how
to fix this? (Incidentally, I can make changes
to the table so setup works, but these changes
cause other functional problems.)
primitive dffUDP(qi, CLK, D, notify);
input CLK, D, notify;
output qi;
reg qi;
table
//CLK D notify : Qp : Q ;
f ? ? : 0 : 0 ;
r 0 ? : ? : 0 ;
? 0 ? : 0 : 0 ;
f ? ? : 1 : 1 ;
r 1 ? : ? : 1 ;
? 1 ? : 1 : 1 ;
? ? * : ? : x ;
? * ? : ? : - ;
endtable
endprimitive
Thanks,
-Greg Haynes
UTMC
So, notify reg toggling should happen at the end of time-step, when all
other signals changes have already been evaluated and scheduled. Because
of intertial scheduling, the notify register schedule should then
over-ride all other previous schedules.
Which simulator are you using?
-Ashutosh
--
Ashutosh Varma Axis Systems
Senior Application Specialist 209 Java Drive
Email: as...@axiscorp.com Sunnyvale, CA 94089
Phone: (408)588-2000 x143 Fax: (408)588-1662
module my_flop (Q, D, CLK);
output Q;
input D, CLK;
reg notifier;
dffUDP i0 (QT, D, CLK, timing_err);
buf i1 (Q, QT);
// This buffer helps insure that the UDP outputs an "X" when a
// timing error occurs. Without this buffer, the UDP will have
// multiple inputs changing within a simulation event (the
// signals that generated the timing error, plus the notifier
// signal...)
buf #0.01 tim1 (timing_err, notifier);
specify
// Setup test
specparam Tsu = 1;
specparam Th = 1;
$setuphold(posedge CLK, D, Tsu, Th, notifier);
// Path Delays
specparam Tco = (2,2);
(CLK => Q) = Tco;
endspecify
endmodule
Hope this helps!
Dave Allen
========================================================================
David A. Allen, Account Manager
Hewlett-Packard, Colorado Springs Technology Center
email: dav...@col.hp.com
Phone: (719) 590-3792
Fax : (719) 590-3525
========================================================================
~