• 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 23563
  • 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
  • jugemu1234
    jugemu1234 over 16 years ago

     Hi andrew,

    Thanks for being supportive. It helps me a lot.

    Now I have again faced unknown errors as a result of following script.

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

    ;;;Loop starts here
    foreach(myModelthin '("tt" "ff" "ss" "snfp" "fnsp")
    foreach(myModelthick '("tt" "ff" "ss" "snfp" "fnsp")
    foreach(myModelhv '("tt" "ff" "ss" "snfp" "fnsp")
    foreach(myTemp '("-40" "27" "125")
    foreach(myDvdd '("1.5" "1.4")

    modelFile(
        '("monte.scs" "stat")
        list("active_thin.scs" myModelthin)
        list("active_thick.scs" myModelthick)
        '("active_rem.scs" "tt")
        '("bipolar.scs" "bip_tt")
        list("hv.scs" buildString list("hv_" myModelhv) "")
        '("monte_passive.scs" "pass_nom")
    )
    desVar(   "dvdd" myDvdd )
    temp( myTemp)
    ;resultsDir( sprintf(nil, "%s", myTemp))
    resultsDir(buildString( list("./simulation/sim_osc_only/spectre/schematic/" myModelthin "_" myModelthick "_" myModelhv "_" myTemp "_" myDvdd ) ""))

    out = outfile("myResults/testout.ocn" "a")

    run()

    results()
    selectResults('tran)
    outputs()
    iave=average(clip(IT("/R0/PLUS"),0.15u,0.25u))
    fosc=equency(clip(VT("/OUT"),0.15u,0.25u))
    ;ivalue=value(IDC("/I6/N4/D") -40 )
    cornerName = buildString( myModelthin "_" myModelthick "_" myModelhv "_" myTemp "_" myDvdd  "")

    fprintf(out "%-10s%10g%10g\n","","fosc","iave")
    fprintf(out "%-10s%10g%10g\n",cornerName fosc iave)
    close(out)

    )
    )
    )
    )
    )

     ----------error message--------

    \e *Error* eval: unbound variable - buildString
     

    I do not follow what makes "buildString" considered as error.

    Much appreciated if anybody can suggest me.

    Thanks in advance.

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

    Hi,

    Apologies for not checking this earlier - I really needed to do this from a computer where I could paste your code into a text editor to look properly.

    Anyway, the problem is in this line:

         list("hv.scs" buildString list("hv_" myModelhv) "")

    I'm guessing you meant to put:

         list("hv.scs" buildString(list("hv_" myModelhv) ""))

    So in other words you missed out the parentheses for the buildString function call, and so it treated it as a variable. Rather than using buildString, it would be cleaner to use:

         list("hv.scs" strcat("hv_" myModelhv))

    Best Regards,

    Andrew.

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

    starsky said:

    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

    A reply to this one - it seems the threads have got mixed up. Anyway, you can do this (point 2):

    1. Create a file, say "save.scs", containing the following:

    //
    save *:ids *:region sigtype=dev

    2. Reference this file as a "model library" (using modelFiles() in OCEAN). You could also just put "save *:oppoint sigtype=dev" in the file.

    3. Make sure the output format is PSF. In IC613 you can change this on the Save->Save Options form, or in IC5141 use: envSetVal("spectre.envOpts" "simOutputFormat" 'string "psfbin") before starting ADE or put this at the beginning of your OCEAN script.

    4. After  simulation, you should be able to do:

    selectResult('tran)
    getData("I1.M1:region")

    and similar for ids. These are waveforms versus time, and so you can just plot them, or calculate with them, or do whatever you want. You can use the value() function to pick a value at a particular time.

    Best Regards,

    Andrew.

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

    Andrew,

     I really appreciate your response & for the kind help you have provided. 

    Will work on it & get back.

    Thanks a lot,

    Regards,

    Starsky.

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

    Hello Andrew,

    I hope you remember me. If you can please help me with this, I made the changes and tried running the script as you told me.

    When I save and run this: save *:ids *:region sigtype=dev

    But it is giving me error which says syntax error. Is it because the spectre which I am using IC5141 (I even tried MMSIM62) doesnt support star (*) signs.

    Please help,

    Thanks & regards,

    starsky

     

     

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

    Hi Starsky,

    Well, MMSIM62 does support wildcards, so I don't know why this doesn't work. Posting the error message might help explain this. I'm assuming you specifed this in an included file rather than directly in the OCEAN script (which wouldn't work, because this is spectre, not OCEAN syntax).

    Regards,

    Andrew.

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

    Hi Andrew,

    What I am doing is...I created a file and named it as abcd.scs in which I wrote the script as:

    simulator lang=spectre

    save *:ids sigtype=dev

    this file is added as and in model library.

    The error which I am getting is this:

    Error found by spectre during circuit read-in.

    "/usr2/home/..../abcd.scs: Unexpected operator " * ". Expected end of file or end of line.

    spectre terminated prematurely due to fatal error.

    Due to this problem, I am not able to go further in my research work, I would be really grateful if you can guide me.

    Thanks and regards,

    Starsky.

     

     

     

     

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

    Hi Starsky,

    That's the error I'd expect if you're using spectre from IC5141; wildcards were not supported then. With MMSIM62 you should not get this (I tried, and it did not give this error for me).

    However, I did find that even if I tried MMSIM62, it didn't actually save the ids currents. There seems to be some bugs with the wildcard support in those releases. If however I used an MMSIM71 Hotfix, it worked perfectly.

    So that would be the solution; use an MMSIM71 Hotfix.

    Regards,

    Andrew.

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

    Hi Andrew,

    Yes, the code works with MMSIM71 Hotfix. However, I am not able to see the values of ids or region. What should be the command or function used? I think the values are getting stored somwhere but I neet to see them.

    Here is the code of my ocean script:

    save ( *:ids *:region sigtype=dev )

    selectResult('tran)

    getData("n1:ids")

    selectResult('tran)

    getData("n1:region")

    plot(getData("/vin"))

    Thanks for your help,

    Starsky

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago
    Hi Starsky,

    Why have you got save(*:ids ...) in your OCEAN script? That is not OCEAN syntax - it needs to be in an include file as you said before.

    Best thing is to look in the results browser and see how the output shows up. Or do:

    selectResult('tran)
    outputs()

    In the CIW or ocean prompt and see what is listed. It's probably getData("M1:ids") as you've done, but presumably you'd want to plot it - your script was just doing a getData but not doing anything with the result.

    Regards,

    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