The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Simulators >> RF Simulators >> Hidden state in resettable D-FlipFlop model "dff2"??? https://designers-guide.org/forum/YaBB.pl?num=1396302674 Message started by spectrallypure on Mar 31st, 2014, 2:51pm |
Title: Hidden state in resettable D-FlipFlop model "dff2"??? Post by spectrallypure on Mar 31st, 2014, 2:51pm Hi all! For a PLL design I am using a behavioral model of a phase-and-frequency detector (PFD) built using 2 resettable D-FlipFlops and some ideal logic gates. The problem is that I am unable to run PSS/PNOISE simulations (spectre 12.1.0.457.isr8 64bit) to evaluate the phase noise due a "hidden state" issue: Code:
This seems surprising, since I am using the "dff2" model from http://www.designers-guide.org/verilogams/rf-models/dff/dff.va, which is supposed to be PSS-friendly! Am I missing something here? Is it really possible to use this model with PSS? If not, could somebody please point me to any Verilog-A model that I could use for my PFD? Thanks in advance for any help/ideas! Cheers, Jorge. |
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by spectrallypure on Mar 31st, 2014, 3:03pm BTW, I am aware of this old post http://www.designers-guide.org/Forum/?board=rfsim;action=display;num=1033687038; unfortunately, it does not deal with a resettable flip-flop model. Are resettability and and hidden-state-freedom mutually-exclusive conditions? :| |
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by Ken Kundert on Apr 2nd, 2014, 12:48pm Do not post the same message to multiple boards. Quote:
I don't know why the model no longer works as intended in Spectre. Conceptually it should. You might try using the (* instrument_module *) and (* ignore_state *) attributes. I don't remember the exact syntax for these, hopefuly you can find it by reading the manual. These attributes tell the simulator to stop complaining and just try it. If the simulator fails to converge, well you were warned. If it works, then fortune is smiling on you today and you should consider buying a lottery ticket. The Instrument Module attribute is intended to mark complex stimulus block (like a complex modulation source) and tells Spectre to ignore any hidden-state issues in the entire module. The Ignore State attribute does the same for only a particular variable. It is good for variables that maintain a value from one time step to the next, but either would not change during an RF analysis (such as a seed variable) or that does not affect the behavior of the block in any significant way (such as warning given flag). -Ken |
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by Andrew Beckett on Apr 7th, 2014, 2:31pm Ken, Looking at the two models in that file, dff is OK for hidden-state, but dff2 definitely isn't. The state variable is only updated within an @(cross(...)) block or with an @(initial_step) block. The rest of the time it is retaining state. So perhaps it's the comments at the top which are misleading as I'm guessing they only apply to the first module in the file and not the second? Regards, Andrew. |
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by spectrallypure on Apr 7th, 2014, 2:57pm Dear Ken, Andrew; thanks so much for the replies. In fact, from the comments in the header of the .va file it was not clear to me if the model dff2 is supposed to be also hidden-state free. I tried adding the (* ignore_state *) attribute to the variable "state", but the simulator still complained of a hidden state: Code:
Only defining the (* instrument_module *) attribute on the whole dff2 module makes the PSS run. However, I am still unsure if the results I am getting from my PNOISE simulation using this approach are realiable, I am currently in the process of validating them; I'll let you know what conclusion I arrive to. BTW, I had no luck finding an alternative implementation of a resettable D Flip-Flop without a hidden state. :\ Thanks again you both for your help. Cheers, Jorge. |
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by spectrallypure on Apr 7th, 2014, 4:22pm RESULTS UPDATE: when I try to run a PSS on my PLL behavioral model including a PFD model built using the "dff2" Verilog-A flip-flops, Spectre gives me the following warnings: Code:
and then the PSS does not converge. The tstab portion of the simulation seems to be OK (using the "saveinit" option I am able to see the evolution of the VCO control voltage, and it agrees with the behavior I observe in transient simulations for a successful locking of the PLL). The problem seems to appear afterwards, during the "shooting window" portion of the PSS; please find below an abridged version of my simulation log. I am not sure if the PSS convergence problem is related to the presence of the "dff2" flops or if it is a problem somewhere else with my other models or with my PSS settings. I would be really grateful if you could please point out what could be the problem (should I maybe start a dedicated post for this issue?) Thanks in advance for any help. Cheers, Jorge. |
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by spectrallypure on Apr 7th, 2014, 4:25pm Code:
|
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by spectrallypure on Apr 7th, 2014, 4:26pm Code:
|
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by spectrallypure on Apr 7th, 2014, 4:27pm Code:
|
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by Ken Kundert on Apr 8th, 2014, 12:35am Andrew, I think dff2 is okay. The variable state is ignored by the idt operator except when ActNow is nonzero, and that is only true on the time point where state is updated. So, while state may represent hidden state, from the perspective of the model it appears stateless. -Ken |
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by Ken Kundert on Apr 8th, 2014, 12:38am spectrallypure, If PSS is not converging while simulating the entire PLL, there may be any number of problems. Did you at least use strobing to assure that there is a periodic solution and that tstab is set long enough to approach it. -Ken |
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by Andrew Beckett on Apr 8th, 2014, 2:00am Ken Kundert wrote on Apr 8th, 2014, 12:35am:
Ken, Good point. I guess it's a bit hard for spectre to infer that though. spectrallypure - if you use the ignore_state attribute in current versions of the simulator, it says: WARNING (VACOMP-2351): "(* ignore_state *)<<--? integer actNow, out, state;" "dff.va", line 48: Encountered the 'ignore_state' attribute, which is obsolete and no longer supported. To ignore the state of a Verilog-A module, use the 'ignore_hidden_state' module attribute instead. So rather than putting the ignore_state attribute on individual variables, instead using: (* ignore_hidden_state *) module dff2 (clk, d, reset, q, qb); did the job. This converges fine for me in my simple testbench - as Ken said, the convergence issue is probably related to the rest of the PLL. Regards, Andrew. |
Title: Re: Hidden state in resettable D-FlipFlop model "dff2"??? Post by Ken Kundert on Apr 8th, 2014, 10:54am Quote:
Really? Because 1TΩ is a million times too small? |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |