The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> AMS Simulators >> Scheduling a change of the time step of a simulation with AMS Simulator
https://designers-guide.org/forum/YaBB.pl?num=1260862830

Message started by Emmanuele on Dec 14th, 2009, 11:40pm

Title: Scheduling a change of the time step of a simulation with AMS Simulator
Post by Emmanuele on Dec 14th, 2009, 11:40pm

Hi to everybody.
I'm running a transient simulation using AMS Simulator.
The simulation consists in long periods in which the voltages and currents of the circuit remain unchanged, alternated with short periods in which they vary quickly.
The point is: to have a good resolution in the short periods, I have to set a small time step for the simulation; but this way I use a small time step for ALL the circuit, and the simulation takes a lot of time.
My ideal solution would be to have the possibility to schedule a change in the time step during the simulation.
In the AMS Simulator manual I read that with the function OPTION one can set scheduled changes for some simulation parameters, but not for the time step.
Any suggestions?
Thanks a lot,
Emmanuele

Title: Re: Scheduling a change of the time step of a simulation with AMS Simulator
Post by Geoffrey_Coram on Dec 15th, 2009, 5:36am

I suppose you could construct a Verilog-AMS module using $bound_step to control the timestep in particular sections:

module tcontrol();
real the_time, tmax;
analog begin
 the_time = $abstime;
 if (the_time < 1u)
  tmax = 10m;
 else if (the_time < 1.1u)
  tmax = 1p;
 else if (the_time < 2u)
  tmax = 10m;
// ...
 $bound_step(tmax);
end
endmodule

Title: Re: Scheduling a change of the time step of a simulation with AMS Simulator
Post by Emmanuele on Dec 15th, 2009, 5:47am

Thank you for your reply.
Actually I don't know what a Verilog-AMS module is.
Can I write it in Design HDL? I'm using the Cadence SPB suite.

Title: Re: Scheduling a change of the time step of a simulation with AMS Simulator
Post by Riad KACED on Dec 17th, 2009, 10:24am

Hi Emmanuele,

I like Geoofrey's solution and I would encourage you going forward with it. If you don't want using an AMS module, then you can control some analog parameters of your simulation during the simulation itself. It is a manual approach that requires running AMS Designer in interactive mode, i.e. using the Simvision GUI to control the simulation.

From the simvision console, run

Code:
ncsim> help analog

This would tell you all the analog options you can set, this includes the reltol option which defaults to 1e-3 off the top of my head.

All what you need to setup the a new value for reltol is
1. launch the simulator with a very short stop time. The aim here is to invoke the simulator. Say :

Quote:
ncsim> run 1ps

2. Run the following to see the current options:

Quote:
ncsim> analog -show

3. Alter the value of reltol for example:

Quote:
ncsim>analog -reltol 1e-5

4. Run the simulation for the desired time, say 1us

Quote:
ncsim>run 1us

5. Alter the reltol to a new value and run again.

I can't really remember whether you need to play with the 'analog -stop' option. Please give it a try as I'm offline at the minute.

Hope this helps,

Regards,
Riad.

Title: Re: Scheduling a change of the time step of a simulation with AMS Simulator
Post by Emmanuele on Dec 20th, 2009, 9:56am

Thank you too.
Unfortunately, as I told you, I'm using AMS Simulator, which is somewhat different from AMS Designer.
I don't know if I can implement one of the two proposed solutions.
Furthermore, I'd need to run a lot of analysis, so I think that a manual approach should be excluded...

Title: Re: Scheduling a change of the time step of a simulation with AMS Simulator
Post by Geoffrey_Coram on Dec 22nd, 2009, 6:34am

I don't know what "AMS Simulator" is, but if it's a simulator that supports Verilog-AMS, then my approach should work.

I've never written anything in Design HDL, so I don't know if the functions you need are available in the language.  Cadence tools generally support Verilog-AMS, you just need to learn how to take the code I've given you and make your simulator use it.

Title: Re: Scheduling a change of the time step of a simulation with AMS Simulator
Post by Andrew Beckett on Jan 3rd, 2010, 9:42am

AMS Simulator is actually PSPICE. This causes no end of confusion (within Cadence too), since PSPICE questions get directed to Application Engineers that know AMS Designer...

I'm afraid my knowledge of PSPICE is rather limited and (pretty rusty too), so you may be better off posting on this forum, say: http://www.cadence.com/community/forums/27.aspx

Regards,

Andrew.

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