matlab中resdir,求助前辈,用Cadence仿真的图形,怎么导出用Matlab重新画

Try a Matlab code to access the Spectre result directly

=====

% There are two methods to access the Spectre simulation dataset

% method 1: select all the plotted trace in Wavescan and save to *.csv

% method 2: use the Cadence-Matlab toolbox function call to read the dataset directly

% edit by wjlee 2013/11

clear;

close all;

w=2e-6; % MOS channel width 2um

l=0.5-6; % MOS channel length 0.5um

%%%%%%%%%%%%

%% method 1(work for PC/workstation)

%%%%%%%%%%%%

%n18=importdata('n18.csv'); % import the csv file with header

%nums=length(n18.textdata); % count for plotted traces

%for i= 2:2:nums,

%y=cell2mat(n18.textdata(i)); % get variable name from header

%y = y(1:end-2);

%eval([y ' = n18.data(:,i);']);

%end

%%%%%%%%%%%%

%%%%%%%%%%%%%

%%% method 2(work for workstation with mmsim1310.066)

%%%%%%%%%%%%%

resdir='/data63/abc/simulation/t_rdp/spectre/schematic/psf'

y=cds_srr(resdir,'dcOpInfo-info','MN:id');

idn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:id');

idp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:vth');

vthn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:vth');

vthp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:gm');

gmn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:gm');

gmp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:gmbs');

gmbsn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:gmbs');

gmbsp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:gds');

gdsn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:gds');

gdsp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:cgg');

cggn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:cgg');

cggp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:cgs');

cgsn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:cgs');

cgsp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:cgd');

cgdn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:cgd');

cgdp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:cgb');

cgbn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:cgb');

cgbp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:cdd');

cddn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:cdd');

cddp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:css');

cssn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:css');

cssp=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MN:vgs');

vgsn=y.bsim3v3;

y=cds_srr(resdir,'dcOpInfo-info','MP:vgs');

vgsp=y.bsim3v3;

%%%%%%%%%%%%%

vovn=vgsn-vthn;

vovp=-1*(vgsp-vthp);

xaxn=vgsn; xlbl='Vgs';   % x axis as Vgs

xaxp=-1*(vgsp); xlbl='Vgs';   % x axis as Vgs

%xaxn=vovn; xlbl='Vov';   % x axis as Vov

%xaxp=vovp; xlbl='Vov';   % x axis as Vov

ftn=gmn./(6.28*cggn);

ftp=gmp./(6.28*cggp);

% The id/vgs/vth in PMOS is negative value, we run abs() over it to match with NMOS

%% Plot and process the collected dataset

subplot(321);

plot(xaxn,ftn,'r-');

hold on

plot(xaxp,ftp,'b-');

title(strcat('ft vs. ', xlbl)); xlabel(xlbl); grid on;

subplot(323);

plot(xaxn,gmn./idn,'r-');

hold on;

plot(xaxp,gmp./abs(idp),'b-');

title(strcat('gm/Id vs. ', xlbl)); xlabel(xlbl); grid on;

subplot(325);

plot(xaxn,idn/w,'r-');

hold on;

plot(xaxp,abs(idp)/w,'b-');

title(strcat('Id/W vs. ', xlbl)); xlabel(xlbl); grid on;

subplot(322)

plot(xaxn,ftn.*gmn./idn,'r-')

hold on;

plot(xaxp,ftp.*gmp./abs(idp),'b-')

title(strcat('ft*gm/Id vs. ', xlbl)); xlabel(xlbl);; grid on;

subplot(324)

plot(idn/w, gmn./idn,'r-')

hold on;

plot(abs(idp)/w, gmp./abs(idp),'b-')

title('gm/Id vs. Id/W'); xlabel('Id/W'); grid on;

subplot(326)

plot(ftn, gmn./idn,'r-')

hold on;

plot(ftp, gmp./abs(idp),'b-')

title('gm/Id vs. ft'); xlabel('ft'); grid on;

%save device parameter to matlab file

%save sdp

=====

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值