• 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. Interfacing Spectre Output to MATLAB

Stats

  • Locked Locked
  • Replies 18
  • Subscribers 63
  • Views 23102
  • 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

Interfacing Spectre Output to MATLAB

RFQuery
RFQuery over 13 years ago

 Dear All,

Can anybody tell me how to interface Spectre (ADE) output (like waveform) to MATLAB for further processing

 

 

 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Search in the MMSIM documentation (cdnshelp) for "Matlab Toolbox". It's in the  Virtuoso Spectre Circuit Simulator RF Theory manual.

    Also there are app notes in <MMSIMinstDir>/tools/spectre/examples/SpectreRF_workshop/ which explain how to use this.

    Andrew.

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

     Thnaks Andrew

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

    Dear Andrew,

    I went through the documents. 

    But I am NOT able to configure the MATLAB tool-box.

    MATLAB is unable to recognise the Spectre-Matlab ToolBOX command.

    Can you please tell me what I should to do.

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Which version of MMSIM (spectre -W) are you using, and which version of Matlab? Which platform are you running on?

    In my case, I ensure that I have spectre in my path, and do this (for csh; for bash you'd use "export MATLABPATH=...")

    setenv MATLABPATH `cds_root spectre`/tools/spectre/matlab/64bit
    setenv LD_LIBRARY_PATH `cds_root spectre`/tools/dfII/lib:`cds_root spectre`/tools/lib/64bit:$LD_LIBRARY_PATH

    I'm running a 64-bit Linux OS, and running 64 bit Matlab, so as you can see I've ensured that I'm pointing at the 64 bit versions of the shared libraries.

    That's all I need to do. 

    Note that there was a problem in the early MMSIM10.1 versions (it was fixed in MMSIM10.1 ISR5) where there was a compiler incompatibility as described in solution 11699006

    Regards,

    Andrew.

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

    Dear Andrew,

    Thanks for your reply.

     

    I did spectre  -W

    I Got:-

    sub-version 10.1.1.017

    ----------------------------------------

    MATLAB Version we are using 7.12.0

    Platform- RHEL5.5

    In my "cadence.cshrc" file  the following is :-

    -------------------------------------------------------------------------------------------------------------------------------------

    setenv INSTALL_DIR /home/....../srv/install

    setenv CADENCE_DIR $INSTALL_DIR/cadence

    setenv MMSIM $CADENCE_DIR/mmsim10

    setenv CDS_INST_DIR $CADENCE_DIR/IC5141

    setenv LD_LIBRARY_PATH

    set  LD_LIBRARY_PATH=($CDS_INST_DIR/tools/lib $LD_LIBRARY_PATH)

    setenv MATLABPATH /home/....../srv/install/cadence/mmsim10/tools/spectre/matlab

    setenv SPECTRE_FEATURE_FILE $MMSIM/tools/spectre/etc/files/spectre.dat

    set path=($MMSIM/tools/spectre/bin $path)

    ----------------------------------------------------------------------------------------------------------------------------------

    The issue I suspect is that MATLAB is not recognising the spectre commands like 'cds_srr' ..etc.

    So how matlab can know about spectre. ?

    I am confused...

    Is there anything more to be added to the above .cshrc file ?

    Thanks

     

     

     

     

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

     We are using 32-bit paltform

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

     The error I am getting while 'cds_srr' command in MATLAB window is:-

     ??? Invalid MEX-file '/home/manas/Cadence_install/srv/install/cadence/mmsim10/tools/spectre/matlab/cds_innersrr.mexglx': libvirtuos_sh.so: cannot open
    shared object file: No such file or directory

    Error in ==> cds_srr at 16
        sig = cds_innersrr(dirname);

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    That version (MMSIM10.1 Update release) is older than ISR5, and MMSIM10.1 versions prior to ISR5 had the problem you describe, due to the fact that the matlab toolbox was built using the Cadence supported compiler version, which was unfortunately incompatible with the supported compiler version for Matlab.

    So you need to use a newer hotfix of the MMSIM10.1 release (or MMSIM11.1). From doing some tests, the newer toolbox no longer requires LD_LIBRARY_PATH to be set to the <MMSIM>/tools/lib dir - because it doesn't use those shared libraries (they would also have compiler incompatibility) - it doesn't do any harm if it's set, but it isn't required.

    Regards,

    Andrew.

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

     Thanks Andrew.

    It did work with MMSIM11.1.

    But the RF workshop documents you have referred is all baout RF plot .

    But in my case I did simple ac analysis.  and I want to plot some ac signal in MATLAB.

     When I did signals = cds_srr(resdir,'ac-ac') in matlab, most of the AC signals are not being shown.

    When I did :-

    cds_plotsig(V4:p, '', '', db20)
    ??? Undefined function or variable 'V4'.

    Can you tell me or refer to some document which actually gives some example for plotting/processing AC signals..

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    The <MMSIMinstDir>/tools/spectre/examples/SpectreRF_workshop/MatlabAN.pdf is less RF-centric (the toolbox was developed by the SpectreRF team, hence the RF focus of many of the examples).

    To access AC results, you can do this:

    % access the info about all the signals in the results
    signals=cds_srr(resdir,'ac-ac')
    % show the Voltage signal names
    signals.V
    % show the Current signal names
    signals.I
    % get the V4:p signal
    V4_p=cds_srr(resdir,'ac-ac','V4:p')
    % look at the details
    V4_p.I
    V4_p.freq
    % plot the signal
    cds_plotsig(V4_p,'','freq','db20')

    for example.

    I suspect that when you did the signals=cds_srr(...) it did list all the signals, but note that you probably got a horizontal scrollbar and may not have seen then all. However, looking at signals.I and signals.V should show everything. You certainly should see the same signals that you'd see in the results browser in ADE - and if they're missing there it would be because you didn't save the signals from the simulator.

    Note that you could also plot the waveform directly yourself using:

    plot(V4_p.freq,abs(V4_p.I))

    this is the equivalent of using 'mag' instead of 'db20' in the cds_plotsig, except it doesn't label the axes and so on.

    Hope that helps!

    Regards,

    Andrew.

    • 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