• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Mixed-Signal Design
  3. DC sweep and transient at same time

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 64
  • Views 12322
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DC sweep and transient at same time

atulkumar245
atulkumar245 over 3 years ago

simulator lang=spectre
include "bsim3v3.lib"
ahdl_include "VO2.va"
ahdl_include "capacitor.va"
Vc (v 0) vsource type=pulse val0=0 val1=6 delay=0 rise=0.05n fall=0.05n width=180us period=220us
//Vc(v 0) vsource dc=0.6
Vg(vg 0) vsource dc=6
Hb (v x 350 1 300) VO2_device
C1 (x 0) cap1 c=40pF
m1 (x vd 0 0) nmos l=0.5u w=2u

doTran tran stop=180us
saveOptions options save=allpub

simulator lang=spice
.measure tran t1 when x=3 cross=2
.measure tran t2 when x=3 cross=4
.measure tran freq param '1/(t2-t1)'

//analysisDCswp1 sweep param=dc dev=Vg start=1 stop=20 step=1

This is the code for a circuit that is oscillating for a given vd value. So I have used doTran to capture oscillation. And used the  .measure  to calculate frequency. But this can be done for only 1 vg value. But I need to plot frequency vs Vg plot . How I can do that??

Thanks,

Atul

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    Atul,

    It's just putting the sweep in the right place:

    analysisDCswp1 sweep param=dc dev=Vg start=1 stop=20 step=1 {
      doTran tran stop=180us
    }

    saveOptions options save=allpub

    simulator lang=spice
    .measure tran t1 when V(x)=3 cross=2
    .measure tran t2 when V(x)=3 cross=4
    .measure tran freq param '1/(t2-t1)'

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • atulkumar245
    atulkumar245 over 3 years ago in reply to Andrew Beckett

    Thanks a lot, Sir. It worked 

    I used this way to calculate frequency because oscillation was crossing 3 every time.( First calculating t1 , t2 and then frequency)

    Is there any better alternative??

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to atulkumar245

    Seems reasonable - it probably depends on what your expected threshold voltage would be in whatever the oscillator is driving.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • atulkumar245
    atulkumar245 over 3 years ago in reply to Andrew Beckett

    Thanks, sir for helping me out. When I vary Vg, some of the Vg frequency is coming to NaN. The reason for that can be that for different Vg, crossing value changes and so I have to change accordingly. How will I implement this in Verilog A? Please help me out.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • atulkumar245
    atulkumar245 over 3 years ago in reply to Andrew Beckett

    Thanks, sir for helping me out. When I vary Vg, some of the Vg frequency is coming to NaN. The reason for that can be that for different Vg, crossing value changes and so I have to change accordingly. How will I implement this in Verilog A? Please help me out.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to atulkumar245

    I don't really see what Verilog-A has to do with altering a .measure statement. I'm not sure what you're varying (maybe it's different from the original example above) or how you determine the threshold - the threshold in the .measure statements could be another node voltage in the design, so if you can arrange to have a voltage source in the circuit that also changes you could use that.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information