Magic源码阅读(四)——DRC检查的实现(上)

当我们从版图文件中读取数据并生成我们基于角勾链的数据模式后,下一步就是在我们的版图上进行DRC(设计规则检查),接下来让我们看一下magic是如何进行常用的DRC的。

DRC部分涉及的源码主要有以下几个源文件

drc.h			#declaration of the main interface, defination of global variables

DRCarray.c		#implementation of array related design rule check

DRCbasic.c		#implementation of basic design rule check method
				#including interatcion, overlap, distance, etc...
				
DRCcif.c		#maybe related to the cif format layout file

DRCcontin.c		#implementation of continuously design rule check method

DRCextend.c		#implementation of extend design rule check method
				#including angle, length, width, rect size, etc...
				
DRCmain.c		#implementation of main interface and command

DRCprint.c		#some additional function related printing

DRCsubcell.c	#implementation of subcell design rule check method
				#including interaction, overlap, flat, etc...
				
DRCtech.c		#Technology initialization for the DRC module

先从DRCmain.c看起。

首先是一系列全局变量的定义,这些全局变量用来存储DRC发现的错误数据,magic将DRC检查DRCBasicCheck与错误的打印drcPrintError和绘制drcPrintError解耦为不同的方法,用全局变量来传递数据。

DRCKeep *DRCStyleList = NULL;

DRCStyle *DRCCurStyle = NULL;

/* Used by both routines: */

int DRCErrorCount;		/* Incremented by each call to either routine.
				 */

/* Used by drcPaintError: */

CellDef *DRCErrorDef;		/* Place to paint error tiles. */
TileType DRCErrorType;		/* Type of error tile to paint. */

/* Used by drcPrintError: */

int *DRCErrorList;		/* List of DRC error type counts */
HashTable DRCErrorTable;	/* Table of DRC errors and geometry */

/* Global variables used by all DRC modules to record statistics.
 * For each statistic we keep two values, the count since stats
 * were last printed (in DRCstatXXX), and the total count (in
 * drcTotalXXX).
 */

int DRCstatSquares = 0;		/* Number of DRCStepSize-by-DRCStepSize
				 * squares processed by continuous checker.
				 */
int DRCstatTiles = 0;		/* Number of tiles processed by basic
				 * checker.
				 */
int DRCstatEdges = 0;		/* Number of "atomic" edges processed
				 * by basic checker.
				 */
int DRCstatRules = 0;		/* Number of rules processed by basic checker
				 * (rule = one constraint for one edge).
				 */
int DRCstatSlow = 0;		/* Number of places where constraint doesn't
				 * all fall in a single tile.
				 */
int DRCstatInteractions = 0;	/* Number of times drcInt is called to check
				 * an interaction area.
				 */
int DRCstatIntTiles = 0;	/* Number of tiles processed as part of
				 * subcell interaction checks.
				 */
int DRCstatCifTiles = 0;	/* Number of tiles processed as part of
				 * cif checks.
				 */
int DRCstatArrayTiles = 0;	/* Number of tiles processed as part of
				 * array interaction checks.
				 */

接下来的drcPrintErrordrcPrintError就不多说了,分别是对应的错误打印和窗口UI的更新的实现,我们继续往下看:

/*
 * 找出某个给定区域内的所有错误并打印所有不同类型的违背的规则
 */

void
DRCWhy(dolist, use, area) 
    bool dolist;			/*
					 * Generate Tcl list for value
					 */
    CellUse *use;			/* Use in whose definition to start
					 * the hierarchical check.
					 */
    Rect *area;				/* Area, in def's coordinates, that
					 * is to be checked.
					 */
{
   
    SearchContext scx;
    Rect box;
    int i;
    extern int drcWhyFunc();		/*
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值