Home > Community > Forums > RF Design > Interfacing Spectre Output to MATLAB

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Interfacing Spectre Output to MATLAB 

Last post Mon, Jan 16 2012 5:00 AM by RFQuery. 18 replies.
Started by RFQuery 11 Jan 2012 10:39 AM. Topic has 18 replies and 7270 views
Page 1 of 2 (19 items) 1 2 Next >
Sort Posts:
  • Wed, Jan 11 2012 10:39 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Interfacing Spectre Output to MATLAB Reply

     Dear All,

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

     

     

     

    • Post Points: 20
  • Wed, Jan 11 2012 10:52 AM

    Re: Interfacing Spectre Output to MATLAB Reply

    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.

    • Post Points: 20
  • Thu, Jan 12 2012 7:43 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Interfacing Spectre Output to MATLAB Reply

     Thnaks Andrew

    • Post Points: 5
  • Thu, Jan 12 2012 8:27 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Interfacing Spectre Output to MATLAB Reply

    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

    • Post Points: 20
  • Thu, Jan 12 2012 9:06 AM

    Re: Interfacing Spectre Output to MATLAB Reply

    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.

    • Post Points: 20
  • Thu, Jan 12 2012 7:25 PM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Interfacing Spectre Output to MATLAB Reply

    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

     

     

     

     

    • Post Points: 5
  • Thu, Jan 12 2012 7:25 PM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Interfacing Spectre Output to MATLAB Reply

     We are using 32-bit paltform

    • Post Points: 5
  • Thu, Jan 12 2012 9:21 PM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Interfacing Spectre Output to MATLAB Reply

     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);

    • Post Points: 20
  • Fri, Jan 13 2012 1:43 AM

    Re: Interfacing Spectre Output to MATLAB Reply

    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.

    • Post Points: 20
  • Fri, Jan 13 2012 4:02 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Interfacing Spectre Output to MATLAB Reply

     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..

     

     

    • Post Points: 20
  • Fri, Jan 13 2012 5:19 AM

    Re: Interfacing Spectre Output to MATLAB Reply

    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.

    • Post Points: 20
  • Fri, Jan 13 2012 5:50 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Interfacing Spectre Output to MATLAB Reply

    Thanks a lot Andrew.

    Your suspicion is absolutely right. ;)

    I realized that after ( also after putting the above question on the Post) doing some more investigation into the issue.

    But one more problem now I am running into is the ADE simulation is little bit slower after the upgradation.

    In the output log it is printing more lines and in that process simulation is getting slower..

     

    • Post Points: 5
  • Fri, Jan 13 2012 5:51 AM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Interfacing Spectre Output to MATLAB Reply

    I have not changed the ADE settings or anything that short after the upgradation

    • Post Points: 20
  • Fri, Jan 13 2012 5:53 AM

    Re: Interfacing Spectre Output to MATLAB Reply

    If the simulation is running slower, you should contact customer support. Hard to figure out why without seeing the details.

    Andrew.

    • Post Points: 20
  • Fri, Jan 13 2012 10:29 PM

    • RFQuery
    • Top 75 Contributor
    • Joined on Wed, Jul 20 2011
    • Posts 89
    • Points 1,270
    Re: Interfacing Spectre Output to MATLAB Reply

     Thanks Andre.

    We highly appreciate your help and patience.

    We will be contacting the customer support.

    Also I have attached the output log files. If you can have a look at it it will be really helpful and fasten the process.

    spectre_after.out:-  LOG FILE AFTER INSTALLING HOTFIX for MMSIM10.1

    spectre_before.out:-  LOG FILE BEFORE INSTALLING HOTFIX for MMSIM10.1

    The ADE setting is kept same in the above two cases.

    • Post Points: 5
Page 1 of 2 (19 items) 1 2 Next >
Sort Posts:
Started by RFQuery at 11 Jan 2012 10:39 AM. Topic has 18 replies.