• 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. Exporting Sprobe Data to File

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 63
  • Views 16632
  • 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

Exporting Sprobe Data to File

mensh
mensh over 5 years ago

Hi,

Is there a way to export the data from the Sprobe component to a file (e.g. s1p)?

Thanks

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    I don't believe there's anything built-in to do this, but this code could be used after simulation has completed:

    /* abExportSprobeToS1p.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       May 26, 2020 
    Modified   
    By         
    
    If you have run an sp analysis and specified some sprobes, you can
    use this function to export to a Touchstone .s1p file. For example:
    
    abExportSprobeToS1p("I1" "./data.s1p")
    
    Where I1 is the instance name of the sprobe (note, this needs to be
    a simulator name, so I1.I2 etc rather than using schematic names with /)
    
    ***************************************************
    
    SCCS Info: @(#) abExportSprobeToS1p.il 05/26/20.15:17:29 1.1
    
    */
    
    /***************************************************************
    *                                                              *
    *      (abExportSprobeToS1p instName fileName [?port 'S1]      *
    *                     [?result 'sp_sprobe]                     *
    *                      [?resultsDir nil])                      *
    *                                                              *
    * Given an instance name (note, using simulator names with dot *
    * separator for hierarchy) and a port name (either S1 or S2),  *
    *     write a Touchstone .s1p representing the sprobe data     *
    *                                                              *
    ***************************************************************/
    
    (defun abExportSprobeToS1p (instName fileName @key (port 'S1) (result 'sp_sprobe) 
                                         resultsDir "SSSSg")
      (let (oport closeAfter sigName data (funcName (getCallingFunction 0))
                  xVec yVec len value)
        ;--------------------------------------------------------------------
        ; Bit of basic error checking
        ;--------------------------------------------------------------------
        (unless (and
                  (or (stringp port) (symbolp port))
                  (member (upperCase port) '("S1" "S2")))
          (error "%s: port must be S1 or S2 : %L\n" funcName port))
        (setq sigName (strcat instName "." (upperCase port)))
        (setq data (getData sigName ?result result ?resultsDir resultsDir))
        (unless data
          (error "%s: could not access data %s\n" funcName sigName))
        (unless (drIsWaveform data)
          (error "%s: cannot handle family waveform data for %s\n" funcName sigName))
        (setq xVec (drGetWaveformXVec data))
        (setq yVec (drGetWaveformYVec data))
        (setq len (drVectorLength xVec))
        ;--------------------------------------------------------------------
        ; Cope with fileName being a port already or a string
        ;--------------------------------------------------------------------
        (cond
          ((and (openportp fileName) (outportp fileName))
           (setq oport fileName))
          ((stringp fileName)
           (setq oport (outfile fileName))
           (unless oport
             (error "%s: cannot write to file %s\n" funcName fileName))
           (setq closeAfter t)
           )
          (t
            (error "%s: incorrect filename %L\n" funcName fileName))
          )
        ;--------------------------------------------------------------------
        ; Write the header and then the freq, real, imag data
        ;--------------------------------------------------------------------
        (fprintf oport "! Touchstone Ver. 1.0\n! Number of ports is 1\n")
        (fprintf oport "# Hz\tS\tRI\tR\t50.000000\n")
        (fprintf oport "! SCATTERING PARAMETERS  :\n")
        (for i 0 (sub1 len)
             (setq value (drGetElem yVec i))
             (fprintf oport "%.14g  %.14g  %.14g\n" 
                     (drGetElem xVec i) (real value) (imag value))
             )
        (when closeAfter
          (close oport))
        t
        )
      )
    

    • 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