• 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. RF Design
  3. Ocean script is NOT writing into the file in the first ...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 64
  • Views 14054
  • 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 is NOT writing into the file in the first run

RFQuery
RFQuery over 13 years ago

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

  • Cancel
  • marcelpreda
    marcelpreda over 13 years ago

     Hi there,

     

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

     

    Best Regards,

    Marcel

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • RFQuery
    RFQuery over 12 years ago

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

    Thanks a lot for pointing the mistake.

    Kind regards,

    • 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