The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design Languages >> Verilog-AMS >> frequency detector and adjustor https://designers-guide.org/forum/YaBB.pl?num=1278831839 Message started by casual on Jul 11th, 2010, 12:03am |
Title: frequency detector and adjustor Post by casual on Jul 11th, 2010, 12:03am I built a verilogA code to work as frequency detector and adjustor for my phase loop which has pretty small BW. I do not have frequency loop yet. here is the code without compilation problem. However, it has a problem to simulate due to zero diagonal Jacobian.. It is because the adjustout signal issue I think. When lock is asserted, the cell needs to follow the vctrl (adjustout signal). when lock event =1 do this --> adjust = V(adjustout); else do this V(adjustout) <+ adjust; I have tried other method like using case(lock).. it gave me the same problem the code work well if commenting out the adjust = V(adjustout). but the adjust voltage could be very different to vctrl(adjustout) Code:
|
Title: Re: frequency detector and adjustor Post by Geoffrey_Coram on Jul 12th, 2010, 6:11am supermoment wrote on Jul 11th, 2010, 12:03am:
When lock event != 1, what is the value of "adjust" ? Is is supposed to just remember the last value that it grabbed during a lock event? When lock event == 1, you have adjust = V(adjustout); V(adjustout) <+ adjust; which is circular. Perhaps you need to have an input adjustin, so that @(cross (...)) adjust = V(adjustin); // sample V(adjustout) <+ adjust; Then connect adjustout and adjustin externally (in the netlist), perhaps with a resistor. |
Title: Re: frequency detector and adjustor Post by casual on Jul 12th, 2010, 6:21am i have tried that before by adding another input port adjustin BUT it has the same warning because at the schematic level, the adjustin & adjustout is shorten when lock=1. I added an ideal switch (lock=1, connect adjustin to adjustout; else lock=0, open. the adjust value when lock!=1 is following the transistor level phase-loop. Hence i cannot use the last value. The value must be updated. i write that code to work as a frequency loop cos i do not have the schematic yet. Is there a workaround code to adjust vctrl? |
Title: Re: frequency detector and adjustor Post by Marq Kole on Jul 12th, 2010, 8:04am It really depends on what you have connected to the adjustout pin. If it is a voltage source you will get a zero diagonal problem as the value cannot be resolved by both the model and the vsource driving at the same time. Using a resistor in series with this vsource might help although you may encounter voltage loop warnings. The contribution statement inside the @(initial_step) is not necessary: there is already a similar contribution statement outside it. Marq |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |