• 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 Design
  3. ADE-XL and matlab debugging

Stats

  • Locked Locked
  • Replies 17
  • Subscribers 126
  • Views 22682
  • 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

ADE-XL and matlab debugging

danmc91
danmc91 over 10 years ago

I came across a limitation in the waveform calculator recently and decided to  try out using matlab for processing some simulation results.  I've had some successes and at least as many failures and am hoping to get the failures resolved.

matlab version:  2012B

IC version:  6.1.6.500.6

MMSIM version: 13.11.078

Platform:  RHEL 5.5

  1. Simulate with ADE-L, look at results in matlab.  After using addpath() twice in matlab or setting MATLABPATH to include both .../tools/spectre/matlab and .../tools/spectre/matlab/64bit I was able to read results using cds_srr(), run my analysis, etc.
    1. Is there a way in ADE-L (not -XL) to include a matlab measure in the outputs or launch matlab to produce some plots? 
    2. The documentation seemed to miss me needing to add the .../tools/spectre/matlab/64bit part to MATLABPATH and I was failing to find cds_innersrr at first.
  2. Launch matlab from the CIW window:  shell("matlab &").  Weird.  doesn't seem to work.  I think DISPLAY may not be set but shell("xterm -e matlab &") launches matlab with the gui, no problem.
  3. Simulate in ADE-XL, use a matlab output.  Here is where I totally crash and burn. 
    1. ERROR (ADEXL-4031): Matlab script directory.  It doesn't like a colon in my ADE-XL file structure and I'm told to use:  envSetVal("adexl.setup" "useNMPForMapping" 'boolean t).  However the adexl.setup partition doesn't exist.  adexl.setupdb does exist but making this setting does not make the error go away.
    2. WARNING (ADEXL-4010): No outputs specified in the Matlab script.  Scalar outputs can be specified in 'axlResult' in Matlab script..  But I *do* have axlResult=3.7; in my script (just put in a number to rule out other issues.
    3. I can't find any log of any sort at all related to the matlab script running.  If I watch the output of 'top' I see a matlab process start and then end.  I've tried making my matlab script only open up a text file for writing, printing out "hello, world" to the file and closing it.  Even that doesn't happen.
    4. Then I tried envSetVal("adexl.gui" "copyMeasurementScripts" 'boolean nil) to avoid having the matlab script end up in a directory with ":" in the name.  I put that envSetVal in my .cdsinit and restarted virtuoso and ADE-XL.  Same result as before (script got copied to ADE-XL directory with a ":" in the name and I got a ERROR (ADEXL-4031): Matlab script directory).
    5. If I ever get past this, can I return a waveform (or multiple waveforms) back to ADE-XL from matlab?

This seems very close but close is not good enough.  The lack of any sort of log that I can find is perhaps the most frustrating.  I don't know how ADE-XL is launching matlab, what arguments it may be giving to matlab, what environment it may be giving to matlab, etc.  It makes it very hard to debug.

Thanks

-Dan

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Hi Dan,

    The most useful way to debug things is to enter:

    axlDebugFlag=t

    in the CIW before starting ADE XL and running the simulation. In addition to some other verbiage, it also tells you about the interaction between ADE XL and Matlab. It's invaluable for debugging problems with this interface.

    Some answers to your questions:

    1. I never use addpath in my scripts - all I do is setenv MATLABPATH to `cds_root spectre`/tools/spectre/matlab/64bit (I only use 64-bit Matlab, as that's the only supported version these days, if I remember rightly)
      1. No, matlab outputs are only supported in ADE XL, not ADE L
      2. I think this is covered in the MMSIM documentation for the Matlab toolbox. Ah, I see - it doesn't mention the 64bit part... (looks like it hasn't been updated for a while)
    2. That's odd. It works for me. I don't think it can be $DISPLAY, since that should be set before virtuoso runs. Maybe something in your environment is not getting the path set correctly, but that seems unlikely.
    3. ADE XL stuff:
      1. Note that the useNMPForMapping will only help for new ADE XL views. Existing ADE XL views don't get influenced by this variable. However, the case where it causes problems is where you have a ":" in your testname (which is unfortunately the default in ADE XL). You can solve that by just renaming the test (click on the name twice and rename it )
      2. Hopefully the debug flag will get to the bottom of this. All ADE XL does is launch "axlMatlab" (which is in <ICInstDir>/tools/dfII/bin and pass envGetVal("adexl.simulation" "matlabRunArguments") to it (which defaults to "-nodesktop -nosplash")
      3. The debug flag will help here
      4. The point in a should help here. The other thing you have to be careful about is having an OCEAN script with the same name in the working directory. I believe that Matlab always looks in the working directory first for a script regardless of the path (we do an addpath to add the scripts directory to the path). In general I'd probably leave the copyMeasurementScripts at its default value (t).
      5. No, the script can only output a single scalar number. You can get it to dump data somewhere or even output a plot, but outputting a waveform is not possible. There are enhancement requests related to this if I remember rightly.

    (note my letters a-e correspond to your sub-numbers 1-5 etc).

    Once you have got this working, it does work fairly smoothly - but the lack of good error reporting is one of the things that tends to make this a challenge to set up.

    Hope that helps!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Hi Dan,

    The most useful way to debug things is to enter:

    axlDebugFlag=t

    in the CIW before starting ADE XL and running the simulation. In addition to some other verbiage, it also tells you about the interaction between ADE XL and Matlab. It's invaluable for debugging problems with this interface.

    Some answers to your questions:

    1. I never use addpath in my scripts - all I do is setenv MATLABPATH to `cds_root spectre`/tools/spectre/matlab/64bit (I only use 64-bit Matlab, as that's the only supported version these days, if I remember rightly)
      1. No, matlab outputs are only supported in ADE XL, not ADE L
      2. I think this is covered in the MMSIM documentation for the Matlab toolbox. Ah, I see - it doesn't mention the 64bit part... (looks like it hasn't been updated for a while)
    2. That's odd. It works for me. I don't think it can be $DISPLAY, since that should be set before virtuoso runs. Maybe something in your environment is not getting the path set correctly, but that seems unlikely.
    3. ADE XL stuff:
      1. Note that the useNMPForMapping will only help for new ADE XL views. Existing ADE XL views don't get influenced by this variable. However, the case where it causes problems is where you have a ":" in your testname (which is unfortunately the default in ADE XL). You can solve that by just renaming the test (click on the name twice and rename it )
      2. Hopefully the debug flag will get to the bottom of this. All ADE XL does is launch "axlMatlab" (which is in <ICInstDir>/tools/dfII/bin and pass envGetVal("adexl.simulation" "matlabRunArguments") to it (which defaults to "-nodesktop -nosplash")
      3. The debug flag will help here
      4. The point in a should help here. The other thing you have to be careful about is having an OCEAN script with the same name in the working directory. I believe that Matlab always looks in the working directory first for a script regardless of the path (we do an addpath to add the scripts directory to the path). In general I'd probably leave the copyMeasurementScripts at its default value (t).
      5. No, the script can only output a single scalar number. You can get it to dump data somewhere or even output a plot, but outputting a waveform is not possible. There are enhancement requests related to this if I remember rightly.

    (note my letters a-e correspond to your sub-numbers 1-5 etc).

    Once you have got this working, it does work fairly smoothly - but the lack of good error reporting is one of the things that tends to make this a challenge to set up.

    Hope that helps!

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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