The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design Languages >> Verilog-AMS >> Turning on white_noise in a switch https://designers-guide.org/forum/YaBB.pl?num=1208337794 Message started by DaffyDuck on Apr 16th, 2008, 2:23am |
Title: Turning on white_noise in a switch Post by DaffyDuck on Apr 16th, 2008, 2:23am Hi All, I am trying to model the white noise due to the switch resistance with the following statements: if ( V(ps,ns) > thresh ) V(p,n) <+ ron * I(p,n) + white_noise(4*`P_K*$temperature*ron, "thermal"); // (A) else I(p,n) <+ 0; Got the "error" message - analog operator embedded in conditionally executed statement or expression. I tried to do an assignment to a real var, eg. noise = white_noise(4*..... ), and then add "noise" to the contribution statement (A) in place of the lengthy white_noise expression. But I got the error message to the effect that small-signal functions cannot be assigned. What's the way to do it? :o |
Title: Re: Turning on white_noise in a switch Post by Stefan on Apr 16th, 2008, 2:40am Add white noise to an isolated electrical node. Take the voltage from that node and add it to your desired variable/statement/whatsoever. |
Title: Re: Turning on white_noise in a switch Post by DaffyDuck on Apr 17th, 2008, 1:22am Hi Stefan, Thank you! That works. :D |
Title: Re: Turning on white_noise in a switch Post by Geoffrey_Coram on Apr 17th, 2008, 11:09am Another approach would be this: V(p,n) <+ white_noise(4*`P_K*$temperature*ron, "thermal"); // (A) if ( V(ps,ns) > thresh ) V(p,n) <+ ron * I(p,n); // (A) else I(p,n) <+ 0; Verilog-A's value-retention rules say that, if you contribute to the flow (I), then all potential contributions are discarded. Now your white_noise call is not inside the if() statement. BTW: I personally believe the error from your simulator is incorrect. white_noise is *not* an analog operator along the lines of idt() or absdelay(); it appears in "4.5 Analysis dependent funtions" rather than "4.4 Analog operators" in the Verilog-AMS language reference manual (2.2). |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |