视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
Cadence 教程
2025-09-25 23:04:31 责编:小OO
文档
Cadence 教程

在本教程中会介绍到以下两个工具:

∙Virtuoso Schematic for schematic capture. 

∙Analog Artist (Spectre) for simulation. 

计算机的设置

在这里你得有某些基本的UNIX基础知识,当然你也可以向别人求助。(注:在这个教程中使用的工艺库是特许半导体(chartered)的0.25um的工艺) 如果你没有工艺库,那么在安装完Cadence ic后还是有一些工艺文件的,对于学习Cadence工具是可以的。在安装完Cadence IC后到安装目录(比如/usr/cadence)下找到一个名字为le的目录,可以shell窗口通过以下命令找到它:

   Find /usr/cadence  –name le

然后把它下面的cell_design目录考到你的登录目录下。

CADENCE及附加工具的环境设置 

Cadence 工具的环境变量可以通过打开命令行窗口(xterm window,通常你都会通过这个窗口来运行Cadence工具),然后在.bashrc或者.cshrc文件(这里要看你用的shell的类型,这个文件在你的登陆目录下。比如你用root登陆,那么输入cd /root 就可以找到改文件。另外如果你把以“.”开头的文件设置为可见,你也可以在图形界对这个文件进行编辑)中添加环境变量。当然Cadence的环境变量一般上是已经设置好的,但在新安装或者有些环境变量设置不正确时,你必须进行手工的设置,不然程序会出现一些奇怪的错误,甚至无法运行。可以通过以下方法来查看你的机器的环境变量的设置,输入:

env 

在这个教程中,要求把环境变量 “CDS_Netlisting_Mode”设置为 Analog( 请注意拼写) , LANG设置为 en_US 。以下命令可以用来查看“CDS_Netlisting_Mode”变量的设置:

env | grep CDS_Netlisting_Mode

 另外在你的登陆目录下应该还存在以下文件: .simrc( 在这个教程中你可能用不上这个文件,但如果你要运行diva lvs, 你必须在这个文件中进行准确的设置), .cdsinit(这个文件中包含了很多你的环境的自定义设置,比如快捷键,通常这个文件的默认设置就可以用的), .cdsenv(这个文件是仿真工具的设置)。 

如何打开Cadence工具

到现在开始运行Cadence工具。请别在登陆主目录下运行Cadence程序,因为它会生成很多文件,使得登录目录显得很乱。先建立一个目录(比如 test),然后再运行Cadence 程序。可以在Xterm下进行如下操作: 

mkdir test

cd test

icfb &

icfb & 命令会在后台启动Cadence程序,然后可以忽略的"update"信息窗口,接下来就可以得到icfb 命令解释窗口 (CIW),如下所示: 

也许还会得到一个"Cadence Update"窗口,这里就不讨论了,只管把它关闭。 有了 CIW 窗口,就可以运行一些其它的Cadence工具和管理库文件。最好不要用Unix命令(如cp,mv)来移动Cadence设计文件,以防出现一些奇怪的错误。对于Cadence工具中各种各样的问题的详细信息请参考相应的用户手册。一般的可以通过在Cadence的窗口运行Help -> Cadence Documentation 来打开用户手册(前提是你的Netscape安装正确),当然也可以打开安装目录的DOC目录来查找需要地帮助文件。另外还可以打开Cadence的在线帮助,在Xterm窗口运行下面的命令: 

cdsdoc & (或者 openbook)

运行结果如下图所示:(仔细阅读这些帮助,你将会更好的了解Cadence ic) 

同时,还可以得到库管理器窗口: 

如果这个窗口没有打开,可以通过在CIW窗口运行Tools -> Library Manager 来打开它。

现在开始建立自己的工程(在工程中保存电路设计),在Library Manager窗口运行File -> New -> Library打开新建工程对话框。然后在对话框中输入新建工程的名字(比如 tutorial),工程的默认保存路径就是运行icfb的目录,当也可以设置工程保存路径。点击 Attach to existing tech library 然后在选项框中选择csm25rf , 点击 OK. (如果选择的是 Compile ,可以通过一个ASSCII文件来生成技术库)

现在通过Library Manager 窗口就可以看到新建的tutorial库。接下来就可以开始新建逻辑电路图了。 

SCHEMATIC CAPTURE(逻辑电路图窗口介绍)

在Library Manager 窗口选择tutorial库,然后File -> New -> Cell View(同样也可以在CIW窗口中File -> New -> Cell View来完成,唯一的不同是要自己在LibraryName里选择tutorial库) ,得到新建单元(CELL)对话框,在cell name 输入 IVcurves(这里我们要画一组IV曲线), view name 处选择schematic(即建立逻辑电路图), 在tool处选择 Composer - Schematic ,其它的采用默认,如下图。然后点击 OK. 

到这里就可以得到 Virtuoso Schematic Editing 窗口(逻辑电路图编辑窗口)。首先花一点时间观察一下这个窗口。在窗口的左边有好多常用命令的快捷按钮 ,比如:添加器件( placing component instances ,这个按钮看起来象一个IC), 添加连线(drawing wires),添加管脚( placing ports),拉伸( stretching),复制( copying),放大缩小( zooming in and out),保存( saving)等等。如果把鼠标放到这些快捷按钮上会得到该按钮的提示帮助信息。同样也可以通过菜单来完成各个命令的功能。在这里不可能介绍 Virtuoso Schematic 的所有的各个功能,这些东西在cdsdoc(在前面已经介绍过怎么使用) 的on-line user manuals都有介绍。 

好,现在开始设计一个能够画出IV曲线的逻辑电路图。点击添加器件按钮 (或者在菜单上选择Add -> Instance),弹出两个小窗口,其中一个是器件浏览窗口,在这个窗口的第一栏选择csm25rf库,然后在第二栏点击Mos,再在第三栏点击nmos_tk(即Nmos,是厚栅的),最后在第四栏点击symbol。(每个NMOS 晶体管都有四个端口: G, S, D, B)

前面的那些选择会被自动地添加到弹出的另外一个叫做添加器件(Add Instance)窗口的相应位置中,当然这个窗口的各个选项也是可以直接输入的。然后如果把鼠标移到Virtuoso Schematic 窗口上,就可以看到一个晶体管的轮廓(或者说影子),这时还可以移动或者旋转它,直到满意为止,然后点击鼠标左键在逻辑电路图的编辑窗口添加一个NMOS管。利用同样的方法可以添加更多的管子。但是如果在添加管子之前就知道自己要添加多少个管子(这些管子必须是同种类型,而且相同的尺寸),还可以一次添加多个管子来(在添加器件的窗口中设置Rows和 Columns,另外在CadenceIC中命令会自动重复的,你只需多点击几次鼠标来添加多个管子)。在例子中会用到5个晶体管,所以在Rows中输入5,在Columns输入1。

               添加器件窗口

现在只需在逻辑电路图编辑窗口点击鼠标来添加5个晶体管。在编辑过程的任何时候都可以通过Edit -> Undo 来取消当前的操作,而通过安ESC键来取消命令的执行或者推出某个命令执行模式。如下图,添加了5个晶体管。 

添加完成后还可以进行移动或者删除器件等操作,这些得靠自己去探索,在犯错误后进行改正,然后取得进步。现在还有添加管脚,连线和电源 。这里先添加地,点击添加器件按钮,在器件浏览窗口选择analogLib库(这是Cadence安装完成后自带的库),在CELL中输入gnd,如下图所示在各个输入框中输入相应的值。然后在 5 晶体管的下面点击鼠标添加地。 

然后通过类似的方法添加连线(添加连线的时候不用进行一些参数的设置,只需在逻辑电路图的编辑窗口点击鼠标来完成连线的添加)来把各个晶体管的源极和衬底接地。如下图

接下来要添加6个直流电压源(类似添加地),其中一个作为 VDS, 其它的5个分别作为各个管子的输入 VGS,然后用连线把它们和各个晶体管连接起来。 另外还得5个多余(dummy)电压源(它们的值为0V),这样才能画出晶体管的电流曲线来。

在添加各个直流电压源的时候修改各个VGS的电压值分别为5 V, 4 V, 3 V, 2 V, 1 V。

最后把5个dummy电压源(0V)和各个管子的漏极串联起来,而Vds的值设为5V。 如果某个VDC的值设置不对,可以通过选中该器件,然后Edit -> Properties -> Objects(或者双击该器件),在弹出的器件编辑窗口中对该器件的各个参数进行编辑。如下图。 

最后的完整的逻辑电路图如下:

接下来就是对设计进行检查和保存 (可以通过鼠标点击快捷按钮的最上面的那个按钮或者在菜单栏选择 Design -> Check and Save来完成)。请关注一下CIW窗口,保证那里没有错误信息输出后电路设计才没有语法错误。 如果有错误或者警告信息输出,就得重新检查并改正错误。一般的,当CIW窗口有错误或者警告信息输出,在逻辑电路图编辑窗口的逻辑电路图的相应位置会被显亮标示出来。另外对于某些告警是可以将它设置为不告警。

如果逻辑电路图已经没有了问题,就可以进行逻辑电路图的仿真了。 

仿真

在Virtuoso Schematic窗口,执行 Tools -> Analog Environment. 在 "What's New" 窗口之后就是Analog Design Environment窗口,如下图。在 design 栏中可以看到Library 是tutorial,Cell 是IVcurves,View 是schematic 。如果不是可以通过Setup菜单重新载入。

首先要选择仿真工具,这里将会使用Spectre。在菜单栏选择Setup -> Simulator/Directory/Host, 然后在弹出窗口中的Simulator中选择 spectre( 这个是默认的仿真工具,所以这一步可以不做。不过如果要选择其它的仿真工具,比如Hspice,就可以在这里设置) 点击OK。 

还要设置Model文件的位置,在菜单栏 Setup -> Model Libraries 。会看到一个Model文件列表,因为在先前建立库的时候选择连接到一个现有的工艺库,结果软件可以自动找到所需的Model文件,所以这一步也不是必需的。直接点击 OK。 

现在还要选择仿真类型,通过 Analyses -> Choose..来进行设置。这里选择的是 dc(即做直流分析),在sweep variable栏,先选中component parameter选项,然后点击 Select Component, 接下来软件自动转到之前设计好的逻辑电路图上,选择VDS,同时在弹出的Select Component Parameter窗口中选择dc,点击 OK。如下图: 

然后在sweep range栏,选择 Start-Stop, start 处输入0, stop 处输入5 ,同时sweep type设置为automatic 然后点击OK. 

接下来,在仿真工具菜单选择 Outputs -> Save All,在signals to save选中 allpub (默认已经选中)。一般,对于大型的逻辑电路图,为了节省计算机资源,只会选择保存其中的某些信号的输出,而不是全部。但是这里先前设计的逻辑电路的规模很小,所以可以只管选择全部。其它参数默认,点击 OK。

然后终于可以进行仿真了!在仿真工具面板单击右边的 Netlist and Run 按钮 (象绿灯的那个按钮) 或者在菜单栏选择 Simulation -> Netlist and Run。在欢迎窗口中点击OK就开始仿真。如果没有遇到什么错误,将会得到如下所示的结果:

运行过程窗口:

 

输出的网表文件:

如果有错误就得回过头来改正,如果对逻辑电路图进行修改还得运行 Simulation -> Netlist -> Recreate 来重新生成网表文件。 

注意:当对逻辑电路图进行编辑之后必须进行保存和检查。 

假如没有遇到错误,现在就可以查看仿真结果了。在仿真工具面板选择 Results -> Direct Plot -> DC ,然后逻辑电路图会自动变成当前页。通过鼠标在逻辑电路图中选择需要查看波形的节点,可以选择多个。这里要观察的是5个晶体管的漏极电流的波形图。在选择的过程必须通过点击串联在各个管子漏极的(dummy)电压源的正极的小红色方块来完成。请务必保证选择的是代表电流的红色小方块,而且5个都选中,如下图。当正确选中某个管脚时,那个管脚的周围会生成一个圆圈。

现在只要按一下键盘上的 ESC  (即结束选择信号) ,就可以得到我们想要的仿真图形来,5条明亮的IV曲线。 

It's a good idea to save the state of your simulation before you exit the simulation window. You can do that by going to Session -> Save State. This will be helpful if you want to redo any of the simulations without having to re-enter everything from scratch. 

PRINTING AND PLOTTING( usually we don’t need to do this,since we don’t have a printer)

To print the schematic in Virtuoso Schematic from the menu bar along the top, go to Design -> Plot -> Submit. On this menu there are a lot of options, so you can print a lot of ways. Click on help for more details. What I usually do is to write the schematic to a postscript file, then print, in this way you can have access to the file in the future without having to start Cadence:

1.uncheck Plot With header (if checked) 

2.click on plot options - another form pops up 

3.check Center Plot 

4.click on Fit To Page 

5.check Send Plot Only to File, enter a file path, e.g., ./schem.ps 

6.uncheck Mail Log To (if checked) 

7.click OK on the second window, click OK on the first window 

You can look at you postscript before printing by: 

1.at the command prompt: ghostview filepath/filename &, e.g., ghostview ./schem.ps 

Now you can use the ps file in any soft document you create, or you can print a hardcopy: 

1.at the command prompt: lpr -Pprintername filename, e.g., lpr -Pthn_l1 ./schem.ps 

If your plot doesn't come out as you want it, click help on both windows for a more detailed explanation. 

To print a Waveform, on the waveform viewer menu do Window->Hardcopy. Same as above, create a postscript, then print it.

1.uncheck header 

2.change Paper Size to 8x8 inches 

3.check Send Plot Only to File, enter a file path, e.g., ./sim.ps 

4.uncheck Mail Log To 

5.click OK on the window 

then do the same as you did for the schematic to print the hardcopy. 

PARAMETRIC SIMULATION

After this long and tedious way to do things you will learn a faster way to do the same type of simulation as before. The idea is to understand that as an engineer you have many choices about how to achieve a desired result, and having more knowledge in general helps with finding a faster solution! 

Until now we used multiple devices (5) in order to obtain the family of IV curves. We can achieve the same results by using a single transistor for which we change the voltage VGS. Close the Analog Environment and the IVcurves schematic and let's start another schematic, IVparam. 

Instead of starting from scratch we will start from the IVcurves old schematic. In the Library Manager window right mouse click on the IVcurves cell and choose Copy... Fill in IVparam as the name of the destination cell in the Copy Cell pop-up window. 

Click on the IVparam Cell and then double click on the schematic view of the IVparam cell, a schematic should pop-up which is identical to the IVcurves schematic. Let's delete the bottom 4 transistors and their connections, as well as the bottom 4 VGS and dummy power supplies (Go to Edit -> Delete or click on the "pencil" shaped button, then on the item that you want to delete, you can also delete entire areas by clicking and keeping down the mouse button while you draw a rectangle). Also change the value of the VGS power supply to "parameter" (this will be just a variable that we will have to define later). Finally move the gnd higher and reconnect it, the final schematic should look like this:

Check and Save your schematic, making sure there are no errors! 

Now start the Analog Environment and choose Spectre as the simulator by going to Setup -> Simulator/Directory/Host and choosing Spectre. Now you can load the state that you previously saved Session -> Load State (how convenient!). You will have to change the name of the cell to "IVcurves" since the previous state was saved for that cell. 

Go to Variables -> Edit.. and add the variable parameter with a value of 5. Click on Add and then on OK.

You can try now to simulate (Simulation -> Netlist and Run) to make sure there are no problems. After this, instead of the usual simulation we are going to do a parametric simulation (practically this means multiple simulations with a variable as the parameter, our parameter will be the one called parameter). Go to Tools -> Parametric Analysis in the Analog Environment. Fill in parameter as the variable name, 1 as the From value, 5 as the To value, Linear Steps as Step Control with a Step Size of 1.

Go to Analysis -> Start in the Parametric Analysis window. When the simulation is complete go to Results -> Direct Plot -> DC and then click on the terminal of the dummy supply in the drain of the transistor, then hit ESC. Now you should again get a nice family of IV curves.

Now, this is the end of Tutorial1. 下载本文

显示全文
专题