接下来我们关注一下DRC更为底层的实现,DRCWhy
调用的是DRCInteractionCheck
和DRCArrayCheck
函数,以及处理DRCCheckThis
函数所添加的list中区域的DRCCheckTile
函数。
DRCInteractionCheck
在DRCsubcell.c
源文件下,是进行subcell interaction检查的顶层方法,这个方法会检查所有违背interaction规则的错误,并调用传进的函数参数进行处理。
int
DRCInteractionCheck(def, area, erasebox, func, cdarg)
CellDef *def; /* Definition in which to do check. */
Rect *area; /* Area in which all errors are to be found. */
Rect *erasebox; /* Smaller area containing DRC check tiles */
void (*func)(); /* Function to call for each error. */
ClientData cdarg; /* Extra info to be passed to func. */
{
int oldTiles, count, x, y, errorSaveType;
Rect intArea, square, cliparea, subArea;
PaintResultType (*savedPaintTable)[NT][NT];
void (*savedPaintPlane)();
struct drcClientData arg;
SearchContext scx;
drcSubFunc = func;
drcSubClientData = cdarg;
oldTiles = DRCstatTiles;
count = 0;
/* Divide the area to be checked up into squares. Process each
* square separately.
*/
x = (area->r_xbot/DRCStepSize) * DRCStepSize;
if (x > area->r_xbot) x -= DRCStepSize;
y = (area->r_ybot/DRCStepSize) * DRCStepSize;
if (y > area->r_ybot) y -= DRCStepSize;
for (square.r_xbot = x; square.r_xbot < area->r_xtop;
square.r_xbot += DRCStepSize)
// traverse all squares
for (square.r_ybot = y; square.r_ybot < area->r_ytop;
square.r_ybot += DRCStepSize)
{
square.r_xtop = square.r_xbot + DRCStepSize;
square.r_ytop = square.r_ybot + DRCStepSize;
/* Limit square to erasebox. Otherwise, a huge processing */