Thursday, 23 October 2014

digital logic - Metastability simulation


I am trying to observe the metastability by simulating (LTSpice) a chain of inverters and probe the signals in between.


The oscillation never happens (I put more than 5 inverters to ensure enough propagation delay.) The signal just stay at 50% of VDD.


The moment that I change another unconnected signal (to the inverter chain) the chain of invrters starts to oscillate but it never shows any metastability and it always starts from 0 then 1 then 0 and so on. I expect that the initial point sometimes starts from 0 and sometimes from 1, but I does not.


How can I simulate a circuit with real metastability in place?




Answer



Metastability is generally not oscillation, but the signal from a latch, not an inverter, hovering around 50% of rail for an extended period of time before settling to one or other state.


Just a few weeks ago, I successfully observed metastability in an LtSpice simulation. I googled for a transistor level model of a d-latch, and then used a binary search for the exact input voltage that would make it metastable.


If you look carefully at the latch, you'll see it is a pair of inverters 'hugging each other', with two transmission gates, one to break/enable their feedback loop, the other to connect an input signal in, driven by anti-phase clock signals.


You need those transmission gates, or at least something like it, to set the initial conditions required to get the inverters into the metastability region. As an alternative, you could simply use a pair of inverters, with a low value capacitor to one node, say 1fF, and set the cap's initial conditions parameter to force the initial voltage. However, doing it with transmission gates like this is more realistic, it's what is actually inside a d-latch.


enter image description here


enter image description here


These FET models I found are from a very fast process, hence the low voltage. The normal propagation delay was around 50pS, here you can see the delay has increased to around 600pS, with an extended flat portion before the flop decides which way to settle. I couldn't get it any longer, as I've run out of precision for setting the initial voltage, and LtSpice internally probably only uses double precision.


The models were downloaded from CMOSedu.com, though I can't find the latch model yet, the cmosedu_models.txt should be easier to find. I can post my .asc file if you like and if that's possible.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...