Home > Community > Forums > RF Design > Ocean script is NOT writing into the file in the first run

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Ocean script is NOT writing into the file in the first run 

Last post Sun, Sep 23 2012 5:30 AM by RFQuery. 2 replies.
Started by RFQuery 29 Aug 2012 11:41 AM. Topic has 2 replies and 1216 views
Page 1 of 1 (3 items)
Sort Posts:
  • Wed, Aug 29 2012 11:41 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Ocean script is NOT writing into the file in the first run Reply

    Dear all,

    I have written a code which actually does SP analysis and also DC analysis for each corner.

    I am writing the S21 wave using ocnPrint( ) for each corner into separate file.

    I am also writing two MOS transistor "vds"  into two files  using  fprintf() command.

    However, while  ocnPrint( ) is writing into file in the first run of the ocean script, the  fprintf() comand writing into the files after the 2nd RUN

    In the first run  the files are created but they are empty. They are filledonly after 2nd run.

    Can anybody please tell why this is happening.

     My OCEAN codeis as below:--

     

     

    envSetVal("spectre.envOpts" "simOutputFormat" 'string "psfbin")
    ocnWaveformTool( 'wavescan )
    simulator( 'spectre )
    design(     "/home/../.../spectre/schematic/netlist/netlist")
    resultsDir( "/home/../simulation/../spectre/schematic" )


    myCors = list("tt" "ss" "ff" )  ;;; Available corners


    out0 = outfile("MOS_OPERATING_M0.txt" "w")
    out1 = outfile("MOS_OPERATING_M1.txt" "w")
    fprintf( out0 " %s  \n"  "vds_M0" )
    fprintf( out1 " %s \n" "vds_M1" )


    foreach(myModelSec myCors

    myResultsDir = strcat("/home/../simulation/..spectre/schematic/")

    resultsDir(myResultsDir)

    modelFile(
    '("/home/manas/work_cad/LNA_CORNER_dc.scs" "")
    '..................


    '.......................  
      
     list("/home/../MOS_MODEL.scs" myModelSec)
       
      )


    analysis('sp ?ports list("/PORT1" "/PORT2")  ?start "4G"  ?stop "10G"  
            ?lin "10"  ?donoise "yes"  ?oprobe "/PORT2"  ?iprobe "/PORT1"  )
    analysis('dc ?saveOppoint t ?oppoint "rawfile" )
    desVar(      "input_power" 0    )
    desVar(      "f1" 5.38G    )
    desVar(      "f2" "f1+4M"    )
    option(    'temp  "27.0"
    )
    ocnPrint(?output strcat("/home/../../S21_" myModelSec ".dat") ?numberNotation 'scientific s21_db20)

    selectResult( 'dcOpInfo )
    vds_M0=pv("/I42/M0" "vds")
    vds_M1=pv("/I42/M1" "vds")

    fprintf( out0 " %e \n" vds_M0)
    fprintf( out1 " %e \n" vds_M1)


    plot(db20(S21) ?expr list(strcat("S21_" myModelSec))


    );;; End of Script

    • Post Points: 20
  • Sat, Sep 1 2012 12:40 AM

    • marcelpreda
    • Top 150 Contributor
    • Joined on Tue, Jan 19 2010
    • Bucharest, Romania
    • Posts 44
    • Points 715
    Re: Ocean script is NOT writing into the file in the first run Reply

     Hi there,

     

    I do not see any close() call, you need to close the file handlers.

     

    Best Regards,

    Marcel

    • Post Points: 20
  • Sun, Sep 23 2012 5:30 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Ocean script is NOT writing into the file in the first run Reply

    O Sorry. I have forgotten to add close().

    Thanks a lot for pointing the mistake.

    Kind regards,

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by RFQuery at 29 Aug 2012 11:41 AM. Topic has 2 replies.