ICCAP导入说明.doc

上传人:最*** 文档编号:1605238 上传时间:2019-10-30 格式:DOC 页数:14 大小:1.25MB
返回 下载 相关 举报
ICCAP导入说明.doc_第1页
第1页 / 共14页
ICCAP导入说明.doc_第2页
第2页 / 共14页
ICCAP导入说明.doc_第3页
第3页 / 共14页
点击查看更多>>
资源描述
一、 单文本(TXT格式)的读取范例:读取如下txt文件数据并进行图形显示:注意:头三行为注释,共5列数据,每列针对一个VGS,每列的每个数据对应不同的VDS。VGS从0.9V变化到3.3V,步进为600mV,共5个点;VDS从0,变化到15.3V,步进为150mV,共103个点。显然,如上有两个扫描变量。一个是VDS是主变量,一个是VGS是次变量。于是,在ICCAP中设置步骤如下:1、 新建一个DUT。2、 在Measure/Simulate中,设置Input,如上分析有两个变量,设置如下图,这步设置是为了程序编程和POLT显示做准备的。 VD的Sweep Order设为1,即主参数;VG的Sweep Order设为2,即次参数。3、 程序编写:先新建一个程序文件,如图:点击右边的Browse,会跳出如图的对话框,选PEL-Program即可。确定则为如下:Execute是程序的执行按钮,而View则可看程序返回值。代码如下:UPDATE_EXPLICIT! this PEL program reads data from a mdif formatted file! with the columnsLINPUT enter path of file you want,mdiffile,mdiffileLINPUT enter headline,head_line,head_linepath2setup=/read_mdif/mdif_3/readsweep1 = USERC_num_of_points(1,path2setup)sweep2 = USERC_num_of_points(2,path2setup)!This is to define the correct data size for this Setup, !for later copy2paste Therefore, update the data sizeICCAP_FUNC(VD,Redisplay)COMPLEX tmp_idssweep1 * sweep2r_stream = USERC_open(VAL$(mdiffile),r)!skip the header linesi=0WHILE i head_line! replace by the number of lines to skip dummy = USERC_readstr(r_stream,0,%*n%*1n,string) i = i + 1END WHILEICCAP_FUNC(/,Status Window) ! brings status window to top leveli = 0WHILE i sweep1 k = 0 WHILE k sweep2 tmp_idssweep1*k+i = USERC_readnum(r_stream, 0, %lf) PRINT reading line ;sweep1*k+i;, i.e. ids = ;tmp_idssweep1*k+i k = k + 1 END WHILE i = i + 1END WHILEdummy = USERC_close(r_stream)!avoid unnecessary data behind this transformRETURN tmp_ids语句说明:1 LINPUT enter path of file you want,mdiffile,mdiffile此语句是跳出对话框,要求需要加载数据的文件路径,把输入的路径值赋给mdiffile,而前一个mdiffile会记录这个路径,把它变为默认值,下次输入则不再需要重新输入路径了。2 path2setup=/read_mdif/mdif_3/read此语句是把工程路径赋给path2setup,为了便于后面sweep1,sweep2的取值。这个路径来源于上图的标题栏红线标注的值。3 sweep1 = USERC_num_of_points(1,path2setup)此语句将工程的Sweep Order为1的Input 的步长赋给sweep1,这里也就是VD。4 r_stream = USERC_open(VAL$(mdiffile),r)此语句是打开mdiffile所指文件,并将文件的id赋给r_stream,以代表这一文件。这里的r,是指用只读方式打开,下面的例子还会设计到以写的方式打开。5 WHILE i head_line! replace by the number of lines to skip dummy = USERC_readstr(r_stream,0,%*n%*1n,string) i = i + 1END WHILE此语句是读文本中的注释信息。6 WHILE i sweep1 k = 0 WHILE k sweep2 tmp_idssweep1*k+i = USERC_readnum(r_stream, 0, %lf) PRINT reading line ;sweep1*k+i;, i.e. ids = ;tmp_idssweep1*k+i k = k + 1 END WHILE i = i + 1END WHILE此语句用于数据的读取,是整个程序的核心。7 tmp_idssweep1*k+i = USERC_readnum(r_stream, 0, %lf)此语句用于数据的读取,遇到空格,本数据读取结束;遇到回车,本数据读取结束并换行。8 dummy = USERC_readstr(r_stream,0,%*n%*1n,string)此语句用于读取字符串,注意string必须要在Setup Variables中定义。9 RETURN tmp_ids此语句是返回tmp_ids的值。4、 Setup Variables设置设置如下:5、 PLOT设置点击Display Plot,显示图形如下:注:对于单文本s2p格式的读取,如上,代码不变。二、 多文本(S2P格式)的读取范例:读取如下文件的多个文件数据:步骤如下:1、 使用文件转换软件,将文件路径转换为文本格式:(在同文件夹中)输入要转换的文件路径。转换后如下:可以在C:下生成switchdialog_result.txt,记录了文件的路径。2、 在ICCAP中设置简略如下: 代码如下:UPDATE_EXPLICIT! this PEL program reads data from a mdif formatted file! with the columns! freq REAL(S11) IMAG(S11) REAL(S21) IMAG(S21) REAL(S12) IMAG(S12) REAL(S22) IMAG(S22)LINPUT enter path of txt recording path,mdiffile,mdiffileLINPUT enter head lines,head_line,head_line!This is to define the correct data size for this Setup, !for later copy2paste Therefore, update the data sizeICCAP_FUNC(freq,Redisplay)COMPLEX tmp_r.22sweep1COMPLEX tmp_i.22sweep1COMPLEX tmp_a.22sweep2*sweep1path2setup=/read_mdif/mdif_1/readsweep1 = USERC_num_of_points(1,path2setup)sweep2 = USERC_num_of_points(2,path2setup)r_stream1 = USERC_open(VAL$(mdiffile),r)!PRINT r_stream1 = ; r_stream1!skip the 7 header linescout_f = 0WHILE cout_f sweep2PRINT r_stream1 = ; r_stream1dummy = USERC_readstr(r_stream1, 0, %s, string)PRINT dummy = ; dummyPRINT string = ; stringr_stream = USERC_open(VAL$(string),r)PRINT r_stream =; r_streami=0WHILE i head_line! replace 7 by the number of lines to skip dummy = USERC_readstr(r_stream,0,%*n%*1n,string) i = i + 1END WHILEICCAP_FUNC(/,Status Window) ! brings status window to top leveli=0WHILE i sweep1 tmp = USERC_readnum(r_stream, 0, %lf) PRINT reading line ;i;, i.e. freq = ;tmp tmp_r.11i = USERC_readnum(r_stream, 0, %lf) tmp_i.11i = USERC_readnum(r_stream, 0, %lf) tmp_r.12i = USERC_readnum(r_stream, 0, %lf) tmp_i.12i = USERC_readnum(r_stream, 0, %lf) tmp_r.21i = USERC_readnum(r_stream, 0, %lf) tmp_i.21i = USERC_readnum(r_stream, 0, %lf) tmp_r.22i = USERC_readnum(r_stream, 0, %lf) tmp_i.22i = USERC_readnum(r_stream, 0, %lf*n%*1n) !Note: if you also want to read DC biases etc., ! simply define another data field with a COMPLEX ! statement, and apply more USERC_readnums here. i = i + 1END WHILEd = 0WHILE d sweep1 tmp_a.11cout_f*sweep1+d = tmp_r.11d +j*tmp_i.11d tmp_a.12cout_f*sweep1+d = tmp_r.12d +j*tmp_i.12d tmp_a.21cout_f*sweep1+d = tmp_r.21d +j*tmp_i.21d tmp_a.22cout_f*sweep1+d = tmp_r.22d +j*tmp_i.22d d =d + 1END WHILE dummy = USERC_close(r_stream) cout_f = cout_f + 1END WHILEdummy = USERC_close(r_stream1)!avoid unnecessary data behind this transformRETURN tmp_a显示如下:三、 单文本(TXT格式)的导出其他类同,代码如下:UPDATE_EXPLICIT! this PEL program reads data from a mdif formatted file! with the columns! freq REAL(S11) IMAG(S11) REAL(S21) IMAG(S21) REAL(S12) IMAG(S12) REAL(S22) IMAG(S22)mdiffile = c:export.txt!This is to define the correct data size for this Setup, !for later copy2paste Therefore, update the data sizeICCAP_FUNC(freq,Redisplay)COMPLEX tmp_vgsnr_ptsCOMPLEX tmp_idsnr_ptsVTO = 1r_stream = USERC_open(VAL$(mdiffile),w)!PRINT r_stream = ; r_stream!skip the 7 header linesi = 0!testWHILE i nr_pts tmp_vgsi = i tmp_idsi = nr_pts*i i = i +1 END WHILE!end testi = 0WHILE i nr_pts write_result = USERC_write(r_stream,0,vgs=&VAL$(tmp_vgsi) write_result = USERC_write(r_stream,0, ) write_result = USERC_write(r_stream,0,ids=&VAL$(tmp_idsi) write_result = USERC_write(r_stream,0,rn) i = i + 1END WHILEdummy = USERC_close(r_stream)!avoid unnecessary data behind this transformRETURN tmp_vgs
展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 模板表格


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!