T-CELL code_2

上传人:豆浆 文档编号:2049441 上传时间:2017-07-19 格式:PDF 页数:4 大小:209.15KB
返回 下载 相关 举报
T-CELL code_2_第1页
第1页 / 共4页
T-CELL code_2_第2页
第2页 / 共4页
T-CELL code_2_第3页
第3页 / 共4页
T-CELL code_2_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《T-CELL code_2》由会员分享,可在线阅读,更多相关《T-CELL code_2(4页珍藏版)》请在金锄头文库上搜索。

1、T-CELL 新建,以及简单的语句 1. 新建 T-CELL, Cell-New-在出来的对话框 General 中写好 cell name,然后选择旁边的 T-CELL Parameters.点开可以看到一个调用 t-cell 时输入数值的框 (如下图) 。这个里面有 Name(输入数值的名字,比如 L, W ,TubType ), Type(输入数值的类型 ,比如 float ,Integer, Boolean ), Default value(输入需要的数值 ,比如, 1,10,true)。也可以新建 cell 之后,右击这个 cell,选中 info,进入 cell informati

2、on 对话框,在 CELL settings里面找到 default view,并在它下面两个选项中选择 T-Cell Code,确定。再打开这个 cell 时,就打开了 t-cell编辑界面。 2. 如果是按第一种方法打开新建一个 CELL,那么确定之后就可以看到 T-CELL 编辑界面。有一些基本的 code已经存在了,这些是根据 T-Cell Parameters 里面的数据自动生成的。对应上面的数据,生成的 t-cell code如下: /* * Cell Name: test * Creator : (null) * * Revision History: * 21 Sep 2011

3、 Generated by L-Edit */ module test_code #include #include #include #include #include ldata.h /* Begin - Remove this block if you are not using L-Comp. */ #include lcomp.h /* End */ /* TODO: Put local functions here. */ void test_main(void) /* Begin DO NOT EDIT SECTION generated by L-Edit */ LCell c

4、ellCurrent = (LCell)LMacro_GetNewTCell(); double l = LAtoF(const char*)LCell_GetParameter(cellCurrent, l); double w = LAtoF(const char*)LCell_GetParameter(cellCurrent, w); double r = LAtoF(const char*)LCell_GetParameter(cellCurrent, r); bool tubpickup = (bool)LCell_GetParameter(cellCurrent, tubpicku

5、p); /* End DO NOT EDIT SECTION generated by L-Edit */ /* Begin - Remove this block if you are not using L-Comp. */ LC_InitializeState(); LC_CurrentCell = cellCurrent; /* End */ /* TODO: Put local variables here. */ /* TODO: Begin custom generator code.*/ /* End custom generator code.*/ test_main();

6、这就是一个 T-CELL 的基本框架。 之后就是需要自己 写了。首先,加入在这个程序中用到的层,比如画一个电阻,需要知道的层有:电阻主体,连接孔,金属, tub. 定义语句如下: char cont=”cont”; char m1=”m1”; 之后 需要定义层与层之间的规则, 有两种情况, 如下: LCoord contwidth = LC_GetDimension(DRCrule,layer1,layer2); LCood contwidth = LC_Microns(2); 上面两种方法都可以定义 contwidth 的大小。前一种方法是从 DRC 规则中提取 cont 的最小宽度。用这个

7、方法,需要在此之前添加一个 DRC 规则定义。例如: LCoord GetDimension(LDrcRuleType rule,char*layer1,char*layer2) LDesignRuleParam DrcParam; LDrcRule DrcRule = LDrcRule_Find(LC_CurrentFile,rule,layer1,layer2); If(!DrcRule) Char*ruletype; Switch(rule) case LMIN_WIDTH: Ruletype=”MIN_WIDTH”; Break; 后一种方法,直接写就可以了。 LC_Microns(2

8、)括号中的 2 是在 DRC 规则中规定的数值 ,这个是自己赋值 。通常 DRC 是在 tdb 里面写的可以选择引用,而 tdb 文件是单独的一个文本文档,则只能选择赋值。 记得定义方块电阻的大小,如 float resistivity=10; 最后就是电阻主体 电阻整体是由多个 box 组成的。每个 box 大小不一样。这些 box 可以用下面的语句生成。示例:LC_CreatBox(layername,LPoint lowerleft,LPoint upperright); B pt.x=0,pt.y=0 / 先定义坐标原点 ptll.x=pt.x+1; ptll.y=pt.y+0.8;

9、/定义好了 A 点坐标 ptur.x=pt.x; A ptur.y=pt.y; /定义了 B 点坐标 LC_CreatBox(M1,ptll,ptur);/以 A,B 坐标创建一个 box 说 了这么多,还是缺了一个重要的东西,那就是如何让输入的数值被识别后相互转换,只有在写电阻,电容等需要多个数值进行换算的时候用到。这个是 在 void main(void)之前 定义的 。 int HasChanged(LCell,pCell,char*param_name) char old_val1024,new_val1024; LCell_GetTCellPreviousValue(pCell),p

10、aram_name,old_val,sizeof(old_val); LCell GetTCellDefaultValue(pCell,param_name,new_val,sizeof(new_val); return strcmp(old_val,new_val); 在写电阻 ,电容的时候, 三个变量 的互联关系转换可以通过一些特殊处理来达到 。这些计算,可以在程序中写成下列的格式: char new_val1024; if(HasChanged(cellCurrent,”L”)&HasChanged(cellCurrent,”W”) R=L/W*resistivity /resistiv

11、ity 是定义好的方块电阻值。 Sprintf(new_val,”%g”,R); LCell_SetTCellDefaultValue(cellCurrent,”R”,new_val); else if(HasChanged(cellCurren,”W”) W=L/R*resistivity Sprintf(new_val,”%g”,W); LCell_SetTCellDefaultValue(cellCurrent,”W”,new_val); else L=W*R/resistivity; Sprintf(new_val,”%g”,L); LCell_SetTCellDefaultValue

12、(cellCurrent,”L”,new_val); 那么经过这样的添加之后,基本的电阻就可以组成了。而为了程序书写方便,通常我们会对输入的长宽给定一个名字。比如: LCoord Length=LC_Microns(L); LCoord Width=LC_Microns(W); 这样就完成了。但是如果想程序写的更好一些,那么需要对电阻或者其他写成 t-cell 的器件长宽进行限制。好处是这样既可以避免出现不必要的 DRC 错误,也可以让程序看起来比较清楚,明了。 由于工艺原因,每一个器件都有最小尺寸,每层之间都有最小距离。在写 T-CELL 的时候需要很好的处理这些最小的距离限制,才能在生成器件时不发生 DRC 错误。比如写 MOS 器件的时候我们限制了最小沟道长度,最小沟道宽度,比如写电阻的时候,我们限制了最小宽度以及长度。 如果沟道长度最小是 1,那么设定规则如下: LCoord channel_length=LC_Microns(1); if (Widthchannel_length) LDialog_MsgBox(LFormat(“channel too narrow . Min Width=%g ”, LC_InMicrons(channel_length); LUpi_SetReturnCode(1); return;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 电子/通信 > 综合/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号