• 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 SKILL
  3. Writing Test result data on a .txt file

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 144
  • Views 14734
  • 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

Writing Test result data on a .txt file

Boyan
Boyan over 7 years ago

Hello all ,

Im trying to save test results for a simulation into a txt file.

I have the following code:

definitionFile(
    "$PRJ_HOME/global_src/model/models.scs"
)
analysis('ac ?start "1"  ?stop "100M"  ?dec "20"  )
desVar(      "Vsweep" 1    )
envOption(
    'analysisOrder  list("stb" "dc" "ac")
)
temp( 27 )
run()
selectResult( 'ac )
plot(getData("/Output") getData("/net5") )

var = VF("/net04")   



hardCopyOptions(?hcOutputFile "testFile.png" ?hcTmpDir "/home/bshabans" )
hardCopy()
data = ocnPrint(var)
/*sprintf(data "%t" data)*/
summaryFile = outfile("testFile.txt")
printf(summaryFile "data %s %n " temp() ocnPrint(var))
close(summaryFile)

The problems is that printf wont acept what is in data and doesnt want to write it on the txt
Error I am getting : Error* printf: argument #1 should be a string (type template = "tg") at line 32 of file 

  • Cancel
  • mschw
    mschw over 7 years ago

    Hi,

    you have to use fprintf  instead of printf.

    Kind regards,

    Matthias

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 7 years ago

    Hi Boyan,

    Also it is worth noting that ocnPrint can accept a port object for the ?output argument, so it can print directly to the file.

    Best regards,

    Lawrence.

    • 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