I am new to AMS language and design and I am trying to model an oscillator with the following features :
a. The oscillator operates at a default freq of say 32Khz, with tuning applicability from 20Khz to 50Khz.
b. The oscillator operates in two power domains, one of 3.3v and other of 1.2v.
c. When the 1.2 v domain is off, the model latches the entire state of the oscillator and keeps oscillating in that state. Any new input provided at that time will have no effect.
d. When the 3.3v domain is off, the model stops to oscillate and any latched state gets cleared.
e. The model can have a fault mechanism, wherein, any out of range freq generated, sets a fault flag, that remains latched as an output high, until cleared externally. During this state, the oscillator block will generate the high freqeuncy but at the output, the clock will get blocked until fault gets cleared.
Please can anybody here help me out with code snippets and guide me through the design ? Thanks in advance