wildgoat的个人空间 https://blog.eetop.cn/wildgoat [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

Analysis Spectre data with Matlab

已有 2281 次阅读| 2012-5-17 18:06 |个人分类:Cadence

Introduction

Here to introduce some techniques to perform. data analysis of Cadence Spectre simulations using MathWorks Matlab. This is very useful in situations that requires complex mathematic operations, to obtain better simulation graphs or when WaveScan/AWD can't plot data on very large simulations. Basic knowledge of Spectre and Matlab are required.

System configuration

source /afs/fe.up.pt/service/cadsw/setup/scripts/setup.mmsim.6.2
source /afs/fe.up.pt/service/cadsw/setup/scripts/setup.matlab.R2008A

Importing data

Temporal analysis

simdir = '/home/<USER>/projects/austriamicrosystems/freq_synthethizer/Sim/freq_synthethizer/spectre/schematic/psf'
datalist = cds_srr(simdir)                  % List of simulated analysis
signals = cds_srr(simdir,'tran-tran')       % List of signals of the temporal analysis
signals.V                                   % List signals to console
v = cds_srr(simdir, 'tran-tran', 'SIGNAL');  % Change 'SIGNAL' by the desired signal name

How to split large Spectre simulation files

To import and view large simulation data to Matlab it's a good practice to split the information otherwise the computer will freeze. To do this I've wrote this to Matlab scripts. To use it, just change the net names to fit your simulation.

Split data

% Microelectronics Students Group
% Faculty of Engineering of the University of Porto
% Department of Electrical and Computer Engineering
%
% Description: Generates data files from Spectre simulations
% Américo Dias, Jun 2009
 
simdir = '/home/adias/projects/austriamicrosystems/hit-kit-4.0/pll/Sim/pll/spectre/schematic/psf'
 
disp 'Loading fref...';
fref = cds_srr(simdir, 'tran-tran', 'fref');
disp 'Loading fdiv...';
fdiv = cds_srr(simdir, 'tran-tran', 'net023');
disp 'Loading charge pump output...';
cp = cds_srr(simdir, 'tran-tran', 'net033');
disp 'Loading vco output...';
ut = cds_srr(simdir, 'tran-tran', 'outp');
 
disp 'Spliting data...';
 
totalSize = numel(fref.time);
counter = 1;
block = 0;
step = 10e-6;
currentStep = step;
 
left = 1;
 
while(counter <= totalSize)
    if(fref.time(counter) > currentStep)
        currentStep = currentStep + step;
        block = block + 1;
        filename = sprintf('data_%d.dat', block);
        disp(sprintf('Creating %s', filename));
 
        data = [fref.time(left:counter), fref.V(left:counter), fdiv.V(left:counter), cp.V(left:counter), out.V(left:counter)];
        save(filename, 'data', '-ascii');
        left = counter;
    end
    counter = counter + 1;
end
 
disp 'Done!';

Display data

% Microelectronics Students Group
% Faculty of Engineering of the University of Porto
% Department of Electrical and Computer Engineering
%
% Description: Generates graphs directly from data files
% Américo Dias, Jun 2009
 
nBlocks = 26;  % Change this to the number of blocks you have
 
for j=1:nBlocks,
    disp(sprintf('Block %d...', j));
    filename = sprintf('data_%d.dat', j);
    data = load(filename, '-ASCII');
    figure(1);
 
    subplot(4,1,1); plot(data(:,1), data(:,2));
    axis([data(1,1) data(end,1) 0 3.3]);
    subplot(4,1,2); plot(data(:,1), data(:,3));
    axis([data(1,1) data(end,1) 0 3.3]);
    subplot(4,1,3); plot(data(:,1), data(:,4));
    axis([data(1,1) data(end,1) 0 3.3]);
    subplot(4,1,4); plot(data(:,1), data(:,5));
    axis([data(1,1) data(end,1) 0 3.3]);
 
    pause;
end
 
disp 'Done!';
 

点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 122

    粉丝
  • 42

    好友
  • 274

    获赞
  • 118

    评论
  • 22104

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-12 01:18 , Processed in 0.015899 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部