• 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. Custom IC Design
  3. Save multiple values versus frequency using spectremdl for...

Stats

  • Replies 1
  • Subscribers 129
  • Views 60
  • Members are here 0

Save multiple values versus frequency using spectremdl for spectre version 2016

GM202510215619
GM202510215619 18 hours ago

I have this simple mdl code:

alias measurement ACplot{
run AC
export real ac_db  = db(V(Vout))     // Magnitude in dB
export real ac_ph  = r2d(ph(V(Vout)))// Phase in radians
}
run ACplot()
I don't understand why it only outputs one value for ac_db and ac_ph
Is there a way to save all values versus frequencies in these two exported outputs?
Thank you very much for answering.
  • Cancel
  • Sign in to reply
  • Andrew Beckett
    Andrew Beckett 8 hours ago

    Measurements are typically scalar measurements (you can also output arrays in some cases), so to do this you'd need to write a formatted report instead. This should do the job:

    alias measurement ACplot{
      input string reportFile
      run AC
      print fmt("%-15s %-15s %-15s\n","freq","ac_db","ac_ph") to=reportFile
      export real ac_db  = db(V(Vout))     // Magnitude in dB
      export real ac_ph  = r2d(ph(V(Vout)))// Phase in radians
      print fmt("%-15.12g %-15.12V %-15.12V\n",xval(ac_db),ac_db,ac_ph) addto=reportFile
    }
    
    run ACplot(reportFile="ACplot.rpt")

    The output file would then be in the file ACplot.rpt and would look like this:

    freq            ac_db           ac_ph          
    1               -218.01580272   89.9999998193  
    1.04712854805   -217.61580272   89.9999998108  
    1.09647819614   -217.21580272   89.9999998018  
    1.1481536215    -216.81580272   89.9999997925  
    1.20226443462   -216.41580272   89.9999997827  
    1.25892541179   -216.01580272   89.9999997725  
    1.31825673856   -215.61580272   89.9999997618  
    1.3803842646    -215.21580272   89.9999997505  
    1.44543977075   -214.81580272   89.9999997388  
    1.51356124844   -214.41580272   89.9999997265  
    1.58489319246   -214.01580272   89.9999997136  
    1.65958690744   -213.61580272   89.9999997001  
    1.73780082875   -213.21580272   89.9999996859  
    1.81970085861   -212.81580272   89.9999996711  
    1.90546071796   -212.41580272   89.9999996556  
    1.99526231497   -212.01580272   89.9999996394  
    2.08929613085   -211.61580272   89.9999996224  
    2.18776162395   -211.21580272   89.9999996046  
    2.29086765277   -210.81580272   89.999999586   
    2.39883291902   -210.41580272   89.9999995665  
    2.51188643151   -210.01580272   89.9999995461  
    2.6302679919    -209.61580272   89.9999995247  
    2.75422870334   -209.21580272   89.9999995023  

    and so on...

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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.

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

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