How to export Cadence plot data into MATLAB

From EDA Wiki
Revision as of 22:29, 3 February 2011 by Teyork (talk | contribs)
Jump to navigationJump to search

This will describe how to do a Parametric Analysis in Cadence, as well as how to export the data from that analysis into MATLAB for further processing.

The goal of this simulation is to measure the drain current of an NMOS as a function of Vgs for different values of Vds. We will use the circuit shown below. Make sure to enter "Vds" as the value of the DC voltage field for the drain's voltage source.

SchematicForMATLAB.png

Next, click "Launch → ADE L" to launch the simulator. In the simulator, select a DC analysis, sweeping Vgs from 0 to 3V. Add the drain current as the output. Next, click on "Variables → Edit" to bring up the variable editor. Enter Vds as the name and click add. Don't worry about the Value, this will be set when the parametric sweep is initialized. It should look like this:

VariableEditorWindow.png

Say OK to close the editor window. Now, click "Tools → Parametric Analysis" to bring up the parametric analysis setup. In the variable name, put Vds. In the range, put From 1 to 3. As the Step Control, select Linear Steps and put a Step Size of 1. The window should look like this:

ParametricAnalysisSetup.png

Now, click "Analysis &rarr Start", and this will begin the simulation. Parametric analysis runs the DC simulation for changing Vgs from 0 to 3, but it runs it one time each for Vds = 1, 2, and 3V. The output from Cadence will look like this:

ParametricAnalysisOutput.png

To export the data into MATLAB, click on "Trace &rarr Select All". This will select all of the waveforms. Next, click "Trace &rarr Save". This will bring up a file dialog. Select your location, select the file type to be "Comma Separated Value (.csv)", and give it a name of filename.csv (Make sure to put the .csv as part of the filename. This creates a plaintext version of all the X,Y pairs from the Cadence plot. If there are multiple waveforms, the first column is the X value of the first waveform, the second column is the Y value of the first waveform, the third column is the X value of the second waveform, the fourth column is the Y value of the second waveform, and so on.