Home Import data from cadence to matlab
Post
Cancel

Import data from cadence to matlab

Export data from cadence

In ADE window, Tools -> Results Browser. Go to ViVA window, select signals and hit right mouse button. Select table as follows. avatar

In the table window, select File -> Export

Import data to matlab

1. normal simulation data

Normal transient simulation (without corner) data format is like this:

timesignal1signal2
t1s1_value1s2_value1
t2  s1_value2s2_value2

Use the following MATLAB code to export the raw data (.csv) to MATLAB.

1
2
3
4
5
6
7
8
9
clear;clc;
addpath('/home/Div6/research/zhangray16/sim_results/diffusion');
A = importdata('diffusion_32x24_4x4_0_900mV.csv');
% A = importdata('diffusion_32x24_16x8.csv');
D = A.data;
[N,M] = size(D);
Data = D(2:N,2:M);
Time = D(2:N,1);
[N,M] = size(Data);

2. corner simulation data

Corner transient simulation data format is like this:

timesignal1signal2
:–::–:    :–:    
t1  s1_value1s2_value1
t2  s1_value2s2_value2
…    …    

Use the following MATLAB code to export the raw data (.csv) to MATLAB.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
clear;clc;
addpath('/home/Div6/research/zhangray16/sim_results/diffusion');
A = importdata('diffusion_32x24_4x4_1_600_800_1000mV.csv');

% corner = 0;
corner = 0.6:0.2:1; % set corner as 0 if the importdata is not a corner simulation results
num_corner = size(corner,2);

Data = cell(1, num_corner);
D = A.data;
[N,M] = size(D);
Time = D(2:N,1);
Data{1} = D(2:N,2:M);
[N,M] = size(Data{1});
if num_corner > 1 %for corner simulation data
    Data_true = cell(1,num_corner);
    for i_corner = 1:num_corner
        for i_data = 2*i_corner-1:2*num_corner:M
            Data_true{i_corner} = [Data_true{i_corner}, Data{1}(:,i_data)];
        end
    end
    Data = Data_true;
    [N,M] = size(Data{1});
end
This post is licensed under CC BY 4.0 by the author.

Record results as an animation or video for demo

Generate Legends for Figures Plotted in Loops