The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 3:31pm
Pages: 1
Send Topic Print
vpulse doesn't work in the AMS simulation (Read 5417 times)
dan_vol
New Member
*
Offline



Posts: 4
US
vpulse doesn't work in the AMS simulation
Nov 02nd, 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
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: vpulse doesn't work in the AMS simulation
Reply #1 - Nov 2nd, 2011, 8:02pm
 
If vpulse is not working, why are you showing us the VCO?

-Ken
Back to top
 
 
View Profile WWW   IP Logged
dan_vol
New Member
*
Offline



Posts: 4
US
Re: vpulse doesn't work in the AMS simulation
Reply #2 - 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
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: vpulse doesn't work in the AMS simulation
Reply #3 - 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
Back to top
 
 
View Profile WWW   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: vpulse doesn't work in the AMS simulation
Reply #4 - Nov 3rd, 2011, 10:38am
 
Ken,
bound_step should prevent the timestep issue.

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

- B O E
Back to top
 
 
View Profile   IP Logged
dan_vol
New Member
*
Offline



Posts: 4
US
Re: vpulse doesn't work in the AMS simulation
Reply #5 - 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
Back to top
 
View Profile   IP Logged
dan_vol
New Member
*
Offline



Posts: 4
US
Re: vpulse doesn't work in the AMS simulation
Reply #6 - 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
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: vpulse doesn't work in the AMS simulation
Reply #7 - 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
Back to top
 
 
View Profile WWW   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.