• 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. Fprintf code errors

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 9941
  • 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

Fprintf code errors

Holz
Holz over 3 years ago

Hi,

I'm trying to expand the code in this thread, use SKILL script to save waveform and some global parameters in a file. In each file, after the waveform of signal is recorded, then record three global parameters, which are created in Monte Carlo simulation. The code is following:

(procedure (abDumpWaveform wave fileName rise_time fall_time plateau @optional (format "%g %g %f %f %f\n"))
(let (port (xVec (drGetWaveformXVec wave))
(yVec (drGetWaveformYVec wave))
(tr rise_time)
(tf fall_time)
(pl plateau)
)
(unless (setq port (outfile fileName))
(error "Could not write to file %s\n" fileName))
(for pos 0 (sub1 (drVectorLength xVec))
(fprintf port format
(drGetElem xVec pos)
(drGetElem yVec pos)

)
)
(fprintf (port "%f %f %f tr tf pl"))
(close port)
))


And the expression in ADE XL is:

(abDumpWaveform(VT("/net2") strcat(openResults() "/dump.txt") VAR("tr") VAR("tf") VAR("pw")) && 1)


However, I get errors :

ERROR (ADE-2708): Evaluation of output '(abDumpWaveform(VT("/net2") strcat(openResults() "/dump.txt") VAR("tr") VAR("tf") VAR("pw")) && 1)' failed for point:'1' test:'rvt_test:ptl_test:1'
\o Expression:'(abDumpWaveform(VT("/net2") strcat(openResults() "/dump.txt") VAR("tr") VAR("tf") VAR("pw")) && 1)'
\o because of the following error(s)
\o *Error* fprintf/sprintf: too many format specs..
\o Ensure that the definition of output is correct.

It seems like this piece of code : fprintf (port "%f %f %f tr tf pl")) is wrong, right? How can I correct it?

Thanks a lot for the help!

  • Cancel
  • mbracht
    mbracht over 3 years ago

    Hi,

    The fprintf call is in fact messy. fprintf expects at least 2 arguments, an output port and a format string. Plus - for each placeholder in the format string an additional argument must be provided. I guess what this is to supposed to look like is this:

    (fprintf port "%f %f %f" tr tf pl)

    Another thing that doesn't look right is the fprintf statement a few lines further up:

    (fprintf port format
        (drGetElem xVec pos)
        (drGetElem yVec pos))

    The format string in this statement is in a variable named format that comes in as an optional parameter with the default value being "%g %g %f %f %f\n". There are 5 placeholders in this format string but the above fprintf statement defines just two expressions. So the default value for the format parameter should be (format "%g %g\n")

    Max

    • 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