• 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. How to run MATLAB in multi-corner sims and have it return...

Stats

  • Replies 0
  • Subscribers 143
  • Views 157
  • Members are here 0

How to run MATLAB in multi-corner sims and have it return values to ADE

BS202510263955
BS202510263955 6 days ago

Hi all,

 I have a MATLAB script that I would like to post-process some waveforms after running transient simulations.  I have been able to create matlabexpr and MATLAB *.m file that correctly runs and return the values I want, but it only works if I am running a single corner in my sims.  I expect my syntax is incorrect in how I am passing information to and from MATLAB when there are multiple corners / points being simulated, I have looked at the RAK on using MATLAB like this already.  I cannot post my code, but could someone please post code that does the following:

1) in maestro / Outputs Setup: create a normal expression output something like:   

   wave_out = lshift( clip( v("/clock" ?result "tran") 1n VAR("t_end") ) 1n )   

(this is clipping a transient waveform and left-shifting it to re-set the x-axis, where t_end is a Design Variable).

2) there are also scalar Output Setup results, say:

   num_periods = 10

   end_time = VAR("t_end") / 2

3) create a matlabexpr, per point (for every Corner being simulated) that calls for a *.m file that reads in num_periods and end_time and wave_out, does a calculation on them, and returns to ADE. 

In pseudo-code it would look something like this:

In Cadence - Outputs Setup:

 myresults = matlab_file()

 calc1 = myresults.results1

 calc2 = myresults.results2

 calc3 = myresults.results3

The *.m file, matlab_file.m, would be something like:

function results = matlab_file()

  <import required Cadence stuff>

 num_periods_matlab = <read in the Cadence output result num_periods, a scalar>

 end_time_matlab = <read in the Cadence output result end_time, a scalar>

 wave_out_matlab = <read in the Cadence output result wave_out_matlab, a Cadence-constructed waveform and not a scalar>

 results = struct('results1', end_time_matlab / num_periods_matlab, 'results2', ymax( wave_out_matlab ) / num_periods_matlab, 'results3', wave_out_matlab * wave_out_matlab )

end

My pseudo-example above is obviously not doing much, but with a posted *.m file solution here I will learn the proper syntax about loading in both scalars and constructed waveforms from Cadence to MATLAB.  This should work and evaluate properly if, in my Interactive.10 simulation, I am running over various values of t_end (5n:1n:10n), over temperatures, over ... Corners.  I believe what I have right now is incorrectly doing the first four lines of my fake function above, which leads to 'error' or 'eval error' if I run more than one Corner.  

Thanks very much in advance, 

 BS

  • Cancel
  • Sign in to reply

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