• 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. ocean script - data print to file

Stats

  • Locked Locked
  • Replies 27
  • Subscribers 128
  • Views 23561
  • 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

ocean script - data print to file

jugemu1234
jugemu1234 over 16 years ago

Hi,

I am very new to SKILL or ocean script . I have problems with following script. Firstly I created this ocean.ocn by ADE>Session>Save ocean script... Then added some lines to output data to file. However it ends up outputing error after successful simulation but I do not know what is wrong with this then tried to figure out by myself but couldnt.

I am sure this would be easy thing to do for some people. Hope someone help me out at the earliest oppotunity.

Thanks in advance.

---------------------------------
ocnWaveformTool( 'awd )
simulator( 'spectre )
design( "/netlist")
resultsDir( "/MydfII/simulation/sim_osc2/spectre/schematic" )
path( "/multiplelib" )
modelFile(
'("active_thin.scs" "tt")
)
analysis('tran ?stop "1.1u" ?errpreset "conservative" ?write "spectre.ic"
?writefinal "spectre.fc" ?annotate "status" ?finalTimeOp t ?maxiters "5"
?threshold "0.0" ?detail "node" ?sort "name" )
desVar( "Lvar" 1 )
save( 'v "/net019" "/dvss!" "/dvdd!" )
temp( 27 )
out = outfile("results.txt" "a")
run()

results()
selectResults('tran)
outputs()
ocnPrint(?output out frequency(clip(VT("/net019"),1u,1.1u)) )

close(out)


 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    Nothing obviously wrong in the script. I tried your expression (changed the net name something correct for my example) and it worked fine.

    It would help if you posted the error message - it might have given some pointers! Also it would be useful to know what tool version you're using - please type getVersion(t) in the CIW or ocean prompt and report what it says.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jugemu1234
    jugemu1234 over 16 years ago

    Hi Andrew,

    Thanks for your reply.

    CIW reply for getVersion(t) is "sub-version 5.10.41.500.6.132"

    Error message in CDS.log is as follows.

    --------------------------------------------------------------

    \e *Error* clip: can't handle clip(nil 1e-06 1.1e-06)
    \e
    \e
    \a hiResizeWindow(window(1) list(213:88 938:558))
    \r t
    \e *Error* frequency: can't handle frequency(nil)
    \e
    \e
    \a hiResizeWindow(window(1) list(213:88 938:558))
    \r t
    \e *Error* clip: can't handle clip(nil 1e-06 1.1e-06)
    \e
    \e
    \a hiResizeWindow(window(1) list(213:88 938:558))
    \r t
    \e *Error* frequency: can't handle frequency(nil)
    \e
    \e
    \a hiResizeWindow(window(1) list(213:88 938:558))
    \r t
    \e *Error* clip: can't handle clip(nil 1e-06 1.1e-06)

     -------------------------------------------------------------------

    Thank you very much for your help.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    Does outputs() show that "/net019" is in the outputs from the simulator? It suggests from the error that the signal is not there - and VT("/net019") is returning nil - indicating no data. You could also try v("/net019") instead, but I don't see why that would work and VT not work. So can you show the result of outputs() - you could put pprint(outputs()) in your script.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jugemu1234
    jugemu1234 over 16 years ago

    You r right. My appology for trying printing wrong net. It works now.

    Btw, if I wrote two or more ocnPrint command, output file "results.txt" always has 2 redundant lines additionally between in two ocnPrint. How can I avoid this?


    ------results.txt-------------------------

    nominal_freq       1G

    <unnecessary line here>

    <unnecessary line here>

    nominal_I           100u

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 16 years ago
    ocnPrint is more intended for printing waveforms, and so normally writes column headings when it does it. In this case you have scalars, and so there's not really any column headings, so you just get space instead.

    If it was me, I'd use fprintf instead:

    nominal_freq=...
    fprintf(out "nominal_freq. %g\n" nominal_freq)

    Or if you want the suffix notation (ie things like m,k,G,u etc as multipliers) you can use:

    fprintf(out "nominal_freq. %s\n" aelSuffixNotation(nominal_freq))

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • starsky
    starsky over 16 years ago

     Hello All,

    I am new to ocean script for nmos transistor, I am trying to write a script which runs tran analysis, and at three different time periods i.e. "5e-9" "10e-9" "50e-9".

     What I want is to get values of current at each of these 3 time period in return.

     

    analysis('tran ?stop "50n"  ?errpreset "conservative"  ?infotimes list("5e-9" "10e-9" "50e-9") )

    desVar(      "tr" 1n    )
    -----


    envOption(
        'spp  "Y"
    )
    saveOption( 'currents "all" )
    temp( 27 )
    run()
    selectResult( 'tran )
    plot(getData("/vin") )
    of=outfile(resultsFile)

    sub=0
    dyn=0

    selectResult( '"tran_info-tran_info" )
    region = OPT( "n1" "region" )
    ;println( region )
    ids = OPT( "n1" "ids" )
    print( ids )

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    You didn't actually say what the question was, but my guess is that what you've done failed because ids ends up being a waveform, with the x-axis being the three times, and the y-axis being the ids at each time?

    I would probably use the "aliased" name of the result, selectResult('tran_info) , but it shouldn't matter, especially if you're using OPT...

    If so, you could do:

    ocnPrint(ids)

    or:

    ; or could use OPT - this is just to show the alternative
    ids=pv("n1" "ids")
    printf("IDS at 5n: %g\n" value(ids 5n))
    printf("IDS at 10n: %g\n" value(ids 10n))
    printf("IDS at 50n: %g\n" value(ids 50n))

    BTW, if you're using an MMSIM version of spectre (which you should be), I wouldn't think you should need to use spp - it's obsolete, as spectre can natively read SPICE netlists without pre-processing first, and the coverage is far higher with the in-built parser.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • starsky
    starsky over 16 years ago

    Hi Andrew,

     WOW! It worked.Thanks a lot.

    I am sorry for not putting up my question direct. What I am trying to do now is, seperate dynamic and subthreshold currents. In order to do that I used this code

    sub=0

    dyn=0

    ids=pv("n1" "ids")
    printf("IDS at 5n: %g\n" value(ids 5n))
    printf("IDS at 10n: %g\n" value(ids 10n))
    printf("IDS at 50n: %g\n" value(ids 50n))

    region=pv("n1" "region")
    printf("region at 5n: %g\n" value(region 5n))
    printf("region at 10n: %g\n" value(region 10n))
    printf("region at 50n: %g\n" value(region 50n))

     

    if( (region==0) sub=sub+ids)

    println( "subthreshold current is: ")

    print( sub )

     

    if( (region==2) dyn=dyn+ids)

    println( "dynamic current is: ")

    print( dyn )

    ______________________

    with your help, I got the value of ids & regions...now I need to put these values in equations (for that I have written for loop in above code) so that I get subthreshold and dynamic currents seperately. But I get nil values when I run. What might be the problem in this loop / code?

    Thanks in advance 

    Regards,

    starsky.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    Starsky,

    It's not that clear what exactly your problem is. You say "for that I have written for loop in above code" but there's no for loop! Similarly the code can't print nil. It would still print srrWave:12344 or drWave:22234 type output. I presume you'd want something like:

    foreach(time '(5n 10n 50n)
      currentIds=value(ids time)
      currentRegion=value(region time)
      ; do something with currentIds and currentRegion
    )

    Perhaps you just posted the wrong code?

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • starsky
    starsky over 16 years ago

    Hi Andrew,

    This worked :)

    Yes, you are right I posted the wrong code line.. ( I wrote if loop and mentioned for loop)

    1) What I want is the output should print ids at these three times that is 5n, 10n and 50n and alongwith this, it should also print regions of the same time period.

     2) What if we dont give these three time periods and want to know ids & regions for all time periods on the whole for nmos?

    Thanks & sorry for bugging you

    Regards,

    starsky

    • 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