The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> vpulse doesn't work in the AMS simulation
https://designers-guide.org/forum/YaBB.pl?num=1320285440

Message started by dan_vol on Nov 2nd, 2011, 6:57pm

Title: vpulse doesn't work in the AMS simulation
Post by dan_vol on Nov 2nd, 2011, 6:57pm

HI guys
I used a vpulse for the input of the VCO model (listing 22) in the Designer's guide to verilogAMS. I modified the $bound_step to 0.05n to accommodate the period of vpulse(0.5n). But the result turned out that the vpulse didn't work at all.  VCO's output is the same as when it's fed with a vdc. And vpulse is zero all the time.

And in the config view: vpules-spectre, res-spectre, VCO-verilogams, testbench-schematic.
Stop list: symbol

Best regards
Daniel


VCO code:

`include "disciplines.vams"
`include "constants.vams"

module vco_analog (out, in);
   parameter real Vmin=0;                  // minimum input voltage (V)
   parameter real Vmax=Vmin+1 from (Vmin:inf);      // maximum input voltage (V)
   parameter real Fmin=10000k from (0:inf);            // minimum output frequency (Hz)
   parameter real Fmax=2*Fmin from (Fmin:inf);      // maximum output frequency (Hz)
   parameter real ampl=1;                  // output amplitude (V)
   input in; output out;
   voltage out, in;
   real freq, phase;

   analog begin
     // compute the freq from the input voltage
     freq = (V(in) - Vmin)*(Fmax - Fmin) / (Vmax - Vmin) + Fmin;

     // bound the frequency (this is optional)
     if (freq > Fmax) freq = Fmax;
     if (freq < Fmin) freq = Fmin;

     // phase is the integral of the freq modulo 2p
     phase = 2*`M_PI*idtmod(freq, 0.0, 1.0, -0.5);

     // generate the output
     V(out) <+ sin(phase);

     // bound the time step
     $bound_step(0.05n);
   end
endmodule

Title: Re: vpulse doesn't work in the AMS simulation
Post by Ken Kundert on Nov 2nd, 2011, 8:02pm

If vpulse is not working, why are you showing us the VCO?

-Ken

Title: Re: vpulse doesn't work in the AMS simulation
Post by dan_vol on Nov 2nd, 2011, 11:49pm


Ken Kundert wrote on Nov 2nd, 2011, 8:02pm:
If vpulse is not working, why are you showing us the VCO?

-Ken


Thanks for reply.
The vpulse is from analogLib. voltage1=0, voltage2=1. I want to show you everything about this problem, because I am not sure where it arise from.

-Daniel

Title: Re: vpulse doesn't work in the AMS simulation
Post by Ken Kundert on Nov 3rd, 2011, 9:26am

Is there more to this simulation? Is it just a voltage source driving the VCO model, or are there other components?

Is it possible that the timepoints chosen by the simulator are so loose that it is not sampling the output of the voltage source when the output is high?

-Ken

Title: Re: vpulse doesn't work in the AMS simulation
Post by boe on Nov 3rd, 2011, 10:38am

Ken,
bound_step should prevent the timestep issue.

Perhaps somewhere the "n" (for nanoseconds) is missing...?

- B O E

Title: Re: vpulse doesn't work in the AMS simulation
Post by dan_vol on Nov 3rd, 2011, 7:51pm


Ken Kundert wrote on Nov 3rd, 2011, 9:26am:
Is there more to this simulation? Is it just a voltage source driving the VCO model, or are there other components?

Is it possible that the timepoints chosen by the simulator are so loose that it is not sampling the output of the voltage source when the output is high?

-Ken


There are just 3 components. They are uploaded in the attachment. And I tested other sources like vpwl and vdc(test_source folder in the attachment), I found that only if the stoplist in the Hierarchy Editor contains spectre, the results  will be right.

But  when the stoplist of test_vco_analog example is changed to include spectre, irun would report error like the following:

ncelab: *E,CUVDNF (./netlist.vams,23|20): Could not determine discipline for this expression .
    ) I0 ( .out(net3), .in(net1));
                              |
ncelab: *E,CUVDNF (./netlist.vams,23|31): Could not determine discipline for this expression .
   net1, cds_globals.\gnd! );
      |
ncelab: *E,CUVDNF (./netlist.vams,26|7): Could not determine discipline for this expression .
resistor #(.r(1K)) R0 (net3, cds_globals.\gnd! );

I consulted to the user guide(cdshiereditor.pdf). But I don't know what it exactly means by leaf node. And what's the difference among symbol , symbol spectre and verilogams spectre in the stoplist?

-Daniel

Title: Re: vpulse doesn't work in the AMS simulation
Post by dan_vol on Nov 3rd, 2011, 7:55pm


boe wrote on Nov 3rd, 2011, 10:38am:
Ken,
bound_step should prevent the timestep issue.

Perhaps somewhere the "n" (for nanoseconds) is missing...?

- B O E


I checked again..Actually vdc and vpwl don't work either. I am going to write the source in verilogams now. But I wonder why the problem happened.

-Daniel

Title: Re: vpulse doesn't work in the AMS simulation
Post by Ken Kundert on Nov 3rd, 2011, 8:47pm

You are not going to get many people to go through the trouble of trying to open your cadence database, and even if they did you did not give enough to reproduce the problem. You'd be better served communicating with words and pictures. I will look at a netlist if you collapse it into one file, though I don't know if anyone else will.

-Ken

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