The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> problem with accuracy with Hspice Verilog-A
https://designers-guide.org/forum/YaBB.pl?num=1237627988

Message started by Dracon on Mar 21st, 2009, 2:33am

Title: problem with accuracy with Hspice Verilog-A
Post by Dracon on Mar 21st, 2009, 2:33am

Dear All,

I have a problem with proper working of clock reference signal :

     @(timer(1/(2*freq), 1/(2*freq))) begin
           clk = !clk;
     end
     
     V(out) <+ transition(clk ? vh : vl, 0, 0);

my clock is based on timer function where state 0 <-> 1 is changing on half of period.
When I want to simulate only this one simple circuit there is no issue, all transitions are exactly the same but combined with entire system variation can be as much as period. Eye diagram is a mess of crossing lines but should be ideal(I do not inoput any jitter).
Can anybody help me?
Thanks


Title: Re: problem with accuracy with Hspice Verilog-A
Post by pancho_hideboo on Mar 21st, 2009, 2:52am


Dracon wrote on Mar 21st, 2009, 2:33am:
I have a problem with proper working of clock reference signal :

     @(timer(1/(2*freq), 1/(2*freq))) begin
           clk = !clk;
     end
     
     V(out) <+ transition(clk ? vh : vl, 0, 0);

my clock is based on timer function where state 0 <-> 1 is changing on half of period.
When I want to simulate only this one simple circuit there is no issue, all transitions are exactly the same but combined with entire system variation can be as much as period. Eye diagram is a mess of crossing lines but should be ideal(I do not inoput any jitter).

I can't know your situations from the above desriptions.

You specify rise_time as 0 in transition().
Do you specify "delmax" in HSPICE ?
Or you should specify rise_time as non-zero value such as (1/freq)/20.

Title: Re: problem with accuracy with Hspice Verilog-A
Post by Dracon on Mar 21st, 2009, 3:25am

I did not specify DELMAX :). I have added  .option accurate to my netlist and it seems to help a lot but increased my simulation time a lot too :( I will have to live with that. Thanks for your reply, I will check delmax, however I need to read hspice manual first because I have already started working with that tool and do not familiar with its syntax.
Thanks

Title: Re: problem with accuracy with Hspice Verilog-A
Post by pancho_hideboo on Mar 21st, 2009, 3:36am


Dracon wrote on Mar 21st, 2009, 3:25am:
I did not specify DELMAX :).
I have added  .option accurate to my netlist and it seems to help a lot but increased my simulation time a lot too :(.

See http://www.designers-guide.org/Forum/YaBB.pl?num=1235309563/1#1
delmax is equivalent to maxstep in Cadence Spectre.


Dracon wrote on Mar 21st, 2009, 3:25am:
I will have to live with that.

Try to specify rise_time as non-zero value such as (1/freq)/20 without setting delmax.


Title: Re: problem with accuracy with Hspice Verilog-A
Post by Ken Kundert on Mar 21st, 2009, 6:36pm

While technically true that HSpice's delmax and Spectre's maxstep set the same thing, it is important to recognize there use in the two simulators is very different. In HSpice the ability to control the timestep using reltol is limited, and so users have used delmax to control the simulator to get accurate answers. This is problematic in that since delmax sets the maximum timestep, one often has to set it very small to affect the timesteps that are causing the errors. Unfortunately doing so causes the timestep to be small over the whole simulation interval, meaning that if there times when the small timestep is not needed then this approach is inefficient, and often very inefficient. Spectre, on the other hand, is considerably more sophisticated in its timestep control, and so only in very few circumstances needs for maxstep to be set.

I mention this, because users that transition from HSpice to Spectre often overuse maxstep, and as a result their simulations are much slower than they need to be. In general, if you want more accuracy in Spectre, you are much better served by tightening reltol than maxstep. The reason being is that tightening reltol shrinks the timestep proprotionally, where maxstep just puts an upper bound on the timestep.

-Ken

Title: Re: problem with accuracy with Hspice Verilog-A
Post by pancho_hideboo on Mar 21st, 2009, 9:01pm


Ken Kundert wrote on Mar 21st, 2009, 6:36pm:
Spectre, on the other hand, is considerably more sophisticated in its timestep control,
and so only in very few circumstances needs for maxstep to be set.

I always feel Cadence Spectre tend to do undersampling, if I don't set maxstep and do use same reltol as HSPICE.

And startup behaviors of VCO are fairly different between Cadence Spectre and HSPICE, if I don't set maxstep and do use same reltol as HSPICE.
Amplitude of steady state is almost same between Spectre and HSPICE. But phase is different between them.
About startup behavior, a result of HSPICE is reasonable.
I think this is due to difference of timestep during VCO startup.

In these cases, we have to set maxstep or tight accuracy in Spectre.

Spectre tend to be less accurate when we don't set maxstep and use same reltol as HSPICE.
Zoom up waveforms of Spectre and HSPICE. You can find out smoothness of HSPICE result.
On the other hand, you will see waveform change like staircase in Spectre's result.
Note : I set "strobeperiod" in Spectre instead of tstep of HSPICE.

Position of HSPICE as Golden Standard Simulator is very stable.

Title: Re: problem with accuracy with Hspice Verilog-A
Post by John O Donovan on Mar 22nd, 2009, 12:01am

If you are using strobeperiod and want to see all the simulated points, not just the sampled points that you are specifying using strobeperiod, then you can set the parameter strobeoutput=all. Then you will have the actual simulated timepoints and the sampled points saved.

Regards,
 John

Title: Re: problem with accuracy with Hspice Verilog-A
Post by pancho_hideboo on Mar 22nd, 2009, 1:16am


John O Donovan wrote on Mar 22nd, 2009, 12:01am:
you can set the parameter strobeoutput=all. Then you will have the actual simulated timepoints and the sampled points saved.
Thanks for advice.

Usually I don't specify strobeperiod in Cadence Spectre.
But in HSPICE we have to specify tstep.
Cadence Spectre tend to do undersampling, so simulated timepoints which are saved points as PSF data  are often less than HSPICE results.
This tendency of undersampling of Cadence Spectre is favorable for circuit simulation which behave gently.
But this tendency of Cadence Spectre often could give wrong simulation results especially for RF circuits, e.g. VCO startup which I described in this thread.

Anyway waveform of Spectre results are not smooth compared to HSPICE when they are zoomed up.


Title: Re: problem with accuracy with Hspice Verilog-A
Post by Ken Kundert on Mar 23rd, 2009, 11:18pm

Boy, your experiences and my experiences are very very different, both with Spectre and with HSPICE. In generally I have found Spectre to render waveforms very well. However, I will say that one of the few times I will use maxstep is when simulating the startup behavior of a resonant oscillator. There are two reasons for this. First, at the beginning, the waveform is very small, and given that tolerances are relative, Spectre, and any simulator really, will not do as well rendering the points during this phase. Second, unlike switching circuits, resonant or high-Q oscillators tend to force the simulator to take relatively evenly sized time steps, so there is not a huge penalty from tightening maxstep (when compared to reltol). In this case, the fact that maxstep tends to make all timesteps the same size is beneficial.

By the way, are you playing with the options or tolerances at all? Do you have behavioral models in your circuit?

-Ken

Title: Re: problem with accuracy with Hspice Verilog-A
Post by Ken Kundert on Mar 23rd, 2009, 11:24pm

Back to the original question, Pancho's suggestion to set the transition time of the transition filter to be non-zero is the key here. Delmax would be a second order effect. If you are concerned about simulation time, try making the rise time larger.

-Ken

Title: Re: problem with accuracy with Hspice Verilog-A
Post by Dracon on Mar 24th, 2009, 10:01am

Thanks to All for the advices.

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.