The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 29th, 2024, 12:51am
Pages: 1
Send Topic Print
Verilog-A analysis() not working as expected (Read 3596 times)
danmc
Community Member
***
Offline



Posts: 35
Boston
Verilog-A analysis() not working as expected
Jan 05th, 2015, 1:49pm
 
Hello,

I am trying to implement a filter which has a sinc(f) frequency response or in otherwords, a rectangular pulse impulse response.  I have implemented this with

Code:
module myflt(in, out)
  output out;
  input in;
  electrical in, out;
  
  parameter tflt=10n;

  electrical integ, dly;
  analog begin
    V(integ) <+ idt(V(in), 0.0, 0, Voltage)/tflt;
    V(dly) <+ absdelay( V(integ), tflt);
    V(out) <+ V(integ, dly);
  end

endmodule
  
 



This works fine for transient analysis.  However for PSS analysis (spectreRF) I get hidden state complaints.  So I tried adding

Code:
(* instrument_module *)
 



before the module line.  That got rid of the complain and gave non-convergence.  Then I tried adding:

Code:
if( ! analysis("pss") ) begin
  // original contribution statements here
end

 



because I really don't care if this module is active during PSS but it is nice to not have to change netlists between PSS and transient sims.  However, that also fails with a zero jacobian at the integ node (integrator output).  That says to me that the analysis() bit isn't really doing what I thought.

Any suggestions?

Thanks
-Dan
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Verilog-A analysis() not working as expected
Reply #1 - Jan 7th, 2015, 5:28am
 
When you say "that also fails with a zero jacobian" is that during the PSS or transient?

I'm guessing it's during PSS, when analysis("pss") is true, and your module has no contributions in that case.  Is there a dc path from the integrator output through the rest of the circuit in that case?  Or could you add contributions to force V(out) to zero for PSS, if you don't care what it does?
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Verilog-A analysis() not working as expected
Reply #2 - Jan 7th, 2015, 5:36am
 
I do have to say: I avoid absdelay() and analysis() -- they make no sense for compact modeling, which is most of what I do with Verilog-A.  And I prefer ddt() to idt().

analysis() is tricky: what does analysis("pss") return if you're in the initial transient (tstab) of a PSS?  And you'd need to handle qpss and hb also -- there's no generic string like "any pss-like analysis" to get all the analyses that care about hidden state without listing them individually.

Also, absdelay() is probably expensive to implement correctly.  Each time the module is evaluated, you get a new value for V(integ), so each point in the delay line has a different delay and the simulator has to track all of them.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Verilog-A analysis() not working as expected
Reply #3 - Jan 7th, 2015, 5:38am
 
Geoffrey_Coram wrote on Jan 7th, 2015, 5:28am:
Or could you add contributions to force V(out) to zero for PSS, if you don't care what it does?


Actually, it must be the two internal nodes:
Code:
electrical integ, dly; 


which have no contributions at all during pss, and thus are just floating.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
danmc
Community Member
***
Offline



Posts: 35
Boston
Re: Verilog-A analysis() not working as expected
Reply #4 - Jan 30th, 2015, 6:27am
 
Geoff, you're right.  It was the lack of contributions in pss mode.  That fixed this model.  Thanks!

-Dan
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.