From 4ddcd400401228668d219726e66c203711ee7a4d Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 19 May 2003 16:16:41 +0000 Subject: [PATCH] * sea/src/sxlib2LEF.c, sea/src/LEF_drive_sxlib.h, sea/src/LEF_drive_sxlib.c, sea/src/a2lef.sh : - Nouvelle option : il devient possible de ne pas decomposer les segments connecteurs en rectangles poses sur la grille de routage, les segments ne sont pas gardes tel quels. Ils sont mis a la largeur minimale et leurs extremites ramenees a la largeur minimale. ATTENTION : il n'y pas de verification que des segments se chevauchent. Dans ce cas il y generation de segments superposes. Option de a2lef : "-T". Option de sxlib2lef : "-t". --- alliance/src/sea/src/LEF_drive_sxlib.c | 85 ++++++++++++++++---------- alliance/src/sea/src/LEF_drive_sxlib.h | 3 +- alliance/src/sea/src/a2lef.sh | 23 ++++--- alliance/src/sea/src/sxlib2LEF.c | 4 +- 4 files changed, 72 insertions(+), 43 deletions(-) diff --git a/alliance/src/sea/src/LEF_drive_sxlib.c b/alliance/src/sea/src/LEF_drive_sxlib.c index bceb92ff..e12be47e 100644 --- a/alliance/src/sea/src/LEF_drive_sxlib.c +++ b/alliance/src/sea/src/LEF_drive_sxlib.c @@ -1,5 +1,5 @@ /* - * $Id: LEF_drive_sxlib.c,v 1.3 2003/04/04 16:23:32 xtof Exp $ + * $Id: LEF_drive_sxlib.c,v 1.4 2003/05/19 16:16:41 jpc Exp $ * * /----------------------------------------------------------------\ * | | @@ -7,7 +7,7 @@ * | S i l i c o n E n s e m b l e / A l l i a n c e | * | | * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-users@asim.lip6.fr | + * | E-mail : alliance-users@asim.lip6.fr | * | ============================================================== | * | C Module : "./LEF_drive_sxlib.c" | * | ************************************************************** | @@ -50,8 +50,11 @@ */ typedef struct eGrid_s { - long x; - long y; + long x0; + long y0; + long x1; + long y1; + long isPoint; struct eGrid_s *Next; } eGrid_t; @@ -76,9 +79,13 @@ static long getLayerExt __FP((char aLayer)); static eGrid_t *getTGrid __FP((eGrid_t **aptGrid, long aX, long aY)); -static eGrid_t *addTGrid __FP((eGrid_t **aptGrid, long aX, long aY)); -static void phseg2TGrid __FP((eGrid_t **aptGrid, - phseg_list *apPhSeg)); +static eGrid_t *addTGrid __FP((eGrid_t **aptGrid, + long aX0, + long aY0, + long aX1, + long aY2)); +static void phseg2TGrid __FP((eGrid_t **aptGrid, + phseg_list *apPhSeg)); static void TGrid2PORT __FP((ePORT_t **aplPORT, eGrid_t *aptGrid)); static char *refCon2Name __FP((char *asRefCon)); static int onGrid __FP((long aX, long aY)); @@ -148,8 +155,10 @@ static eGrid_t *getTGrid(aptGrid, aX, aY) eGrid_t *pGrid; - for(pGrid = *aptGrid; pGrid != (eGrid_t*)NULL; pGrid = pGrid->Next) - if ((pGrid->x == aX) && (pGrid->y == aY)) return(pGrid); + for(pGrid = *aptGrid; pGrid != (eGrid_t*)NULL; pGrid = pGrid->Next) { + if (!pGrid->isPoint) continue; + if ((pGrid->x0 == aX) && (pGrid->y0 == aY)) return(pGrid); + } return((eGrid_t*)NULL); } @@ -159,19 +168,27 @@ static eGrid_t *getTGrid(aptGrid, aX, aY) * Function : "addTGrid()". */ -static eGrid_t *addTGrid(aptGrid, aX, aY) +static eGrid_t *addTGrid(aptGrid, aX0, aY0, aX1, aY1) eGrid_t **aptGrid; - long aX, aY; + long aX0, aY0, aX1, aY1; { - eGrid_t *pGrid; + eGrid_t *pGrid = NULL; + long isPoint; - pGrid = getTGrid(aptGrid, aX, aY); - if (pGrid != (eGrid_t*)NULL) return(pGrid); + isPoint = (aX0 == aX1) && (aY0 == aY1); - pGrid = (eGrid_t*)malloc(sizeof(eGrid_t)); - pGrid->x = aX; - pGrid->y = aY; + if ( isPoint ) { + pGrid = getTGrid(aptGrid, aX0, aY0); + if (pGrid != (eGrid_t*)NULL) return(pGrid); + } + + pGrid = (eGrid_t*)malloc(sizeof(eGrid_t)); + pGrid->x0 = aX0; + pGrid->y0 = aY0; + pGrid->x1 = aX1; + pGrid->y1 = aY1; + pGrid->isPoint = isPoint; pGrid->Next = *aptGrid; *aptGrid = pGrid; @@ -206,8 +223,11 @@ static void phseg2TGrid(aptGrid, apPhSeg) yMin = apPhSeg->Y1; if (apPhSeg->Y1 % YGRID) yMin += YGRID - (apPhSeg->Y1 % YGRID); - for(y = yMin; y <= yMax; y += YGRID) { - addTGrid(aptGrid, apPhSeg->X1, y); + if (LV_flags & F_NO_SPLIT_TERM) { + addTGrid(aptGrid, apPhSeg->X1, yMin, apPhSeg->X1, yMax); + } else { + for(y = yMin; y <= yMax; y += YGRID) + addTGrid(aptGrid, apPhSeg->X1, y, apPhSeg->X1, y); } } else { if (!(LV_flags & F_ALLOW_OFFGRID)) { @@ -224,8 +244,12 @@ static void phseg2TGrid(aptGrid, apPhSeg) yMin = apPhSeg->X1; if (apPhSeg->X1 % XGRID) yMin += XGRID - (apPhSeg->X1 % XGRID); - for(y = yMin; y <= yMax; y += XGRID) { - addTGrid(aptGrid, y, apPhSeg->Y1); + if (LV_flags & F_NO_SPLIT_TERM) { + addTGrid(aptGrid, yMin, apPhSeg->Y1, yMax, apPhSeg->Y1); + } else { + for(y = yMin; y <= yMax; y += XGRID) { + addTGrid(aptGrid, y, apPhSeg->Y1, y, apPhSeg->Y1); + } } } } @@ -244,10 +268,10 @@ static void TGrid2PORT(aplPORT, aptGrid) for(pGrid = aptGrid; pGrid != NULL; pGrid = pGrid->Next) { m_AddPort((*aplPORT), C_PORTITEM_RECT, - m_AddRect(pGrid->x - WIDTH_CALUx / 2, - pGrid->y - WIDTH_CALUx / 2, - pGrid->x + WIDTH_CALUx / 2, - pGrid->y + WIDTH_CALUx / 2)); + m_AddRect(pGrid->x0 - WIDTH_CALUx / 2, + pGrid->y0 - WIDTH_CALUx / 2, + pGrid->x1 + WIDTH_CALUx / 2, + pGrid->y1 + WIDTH_CALUx / 2)); } /* End of "pGrid" loop. */ } @@ -610,7 +634,8 @@ static void phref2PINS() } /* Add to the list of holes in the obstacle grid. */ - addTGrid(&LV_tHolesALU1, pPhRef->XREF, pPhRef->YREF); + addTGrid(&LV_tHolesALU1, pPhRef->XREF, pPhRef->YREF, + pPhRef->XREF, pPhRef->YREF); if ((pPIN = getPIN(LV_pMACRO, sIOName)) == (ePIN_t*)NULL) { @@ -678,11 +703,9 @@ static void phseg2PINS() /* Create a new pin named from "pPhSeg->NAME". */ m_AddPin(LV_pMACRO->lPIN, pPhSeg->NAME); LV_pMACRO->lPIN->DIRECTION = MBK2DEF_locondir(pLoCon); - if (isck(pPhSeg->NAME)) - { - LV_pMACRO->lPIN->USE = C_USE_CLOCK; - } - + if (isck(pPhSeg->NAME)) + LV_pMACRO->lPIN->USE = C_USE_CLOCK; + pPIN = LV_pMACRO->lPIN; } diff --git a/alliance/src/sea/src/LEF_drive_sxlib.h b/alliance/src/sea/src/LEF_drive_sxlib.h index 94e654a8..cde5100c 100644 --- a/alliance/src/sea/src/LEF_drive_sxlib.h +++ b/alliance/src/sea/src/LEF_drive_sxlib.h @@ -1,5 +1,5 @@ /* - * $Id: LEF_drive_sxlib.h,v 1.2 2002/09/30 16:21:17 czo Exp $ + * $Id: LEF_drive_sxlib.h,v 1.3 2003/05/19 16:16:41 jpc Exp $ * * /----------------------------------------------------------------\ * | | @@ -25,6 +25,7 @@ # define F_NO_POWER_GEOM 0x00000002 # define F_POWER_ABUTMENT 0x00000004 # define F_POWER_FEEDTHRU 0x00000008 +# define F_NO_SPLIT_TERM 0x00000010 extern void lefsavesxlophfig (struct lofig *apLofig, diff --git a/alliance/src/sea/src/a2lef.sh b/alliance/src/sea/src/a2lef.sh index 73afe968..d86576cc 100644 --- a/alliance/src/sea/src/a2lef.sh +++ b/alliance/src/sea/src/a2lef.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: a2lef.sh,v 1.4 2003/04/02 14:13:13 jpc Exp $ +# $Id: a2lef.sh,v 1.5 2003/05/19 16:16:41 jpc Exp $ # # /------------------------------------------------------------------\ # | | @@ -8,7 +8,7 @@ # | S i l i c o n E n s e m b l e / A l l i a n c e | # | | # | Author : Jean-Paul CHAPUT | -# | E-mail : alliance-users@asim.lip6.fr | +# | E-mail : alliance-users@asim.lip6.fr | # | ================================================================ | # | Script : "./a2LEF.sh" | # | **************************************************************** | @@ -70,15 +70,15 @@ { echo "" echo "" - echo "Usage: a2LEF.sh [--verbose] [--very-verbose] [--help] \\" - echo " [--allow-offgrid] [--fake-power] \\" - echo " <--techno > \\" - echo " <--library [--library ]> \\" - echo " <--lef > \\" + echo "Usage: a2LEF.sh [--verbose] [--very-verbose] [--help] \\" + echo " [--allow-offgrid] [--fake-power] [--no-split-term] \\" + echo " <--techno > \\" + echo " <--library [--library ]> \\" + echo " <--lef > \\" echo " <--cell >" - echo " a2LEF.sh [-vVhop] <-t > \\" - echo " <-l [-l ]> \\" - echo " <-L > \\" + echo " a2LEF.sh [-vVhop] <-t > \\" + echo " <-l [-l ]> \\" + echo " <-L > \\" echo " <-c > " echo "" echo "Options:" @@ -86,6 +86,7 @@ echo " o [--verbose|-v] : be verbose." echo " o [--very-verbose|-V] : be very verbose :-)." echo " o [--allow-offgrid|-o] : allow terminals to be offgrid." + echo " o [--no-split-term|-T] : do not split terminals segments." echo " o [--fake-power|-p] : do not attempt to generate" echo " PORT geometries for power pins." echo " o <--techno|-t > : location of the LEF techno header." @@ -241,6 +242,7 @@ --very-verbose) VL=2;; --allow-offgrid) sx2lef_args="$sx2lef_args -o";; --fake-power) sx2lef_args="$sx2lef_args -p";; + --no-split-term) sx2lef_args="$sx2lef_args -t";; --techno) if [ $# -ge 2 ]; then @@ -302,6 +304,7 @@ V) VL=2;; o) sx2lef_args="$sx2lef_args -o";; p) sx2lef_args="$sx2lef_args -p";; + T) sx2lef_args="$sx2lef_args -t";; t) if [ $# -ge 2 ]; then techFile="$2" diff --git a/alliance/src/sea/src/sxlib2LEF.c b/alliance/src/sea/src/sxlib2LEF.c index 89eddaa0..cacb48de 100644 --- a/alliance/src/sea/src/sxlib2LEF.c +++ b/alliance/src/sea/src/sxlib2LEF.c @@ -1,5 +1,5 @@ /* - * $Id: sxlib2LEF.c,v 1.2 2002/09/30 16:21:18 czo Exp $ + * $Id: sxlib2LEF.c,v 1.3 2003/05/19 16:16:41 jpc Exp $ * * /----------------------------------------------------------------\ * | | @@ -47,6 +47,7 @@ static void printHelp() printf(" -h := Print this message.\n"); printf(" -o := Allow offgrid terminals.\n"); printf(" -p := Do not generate power PORT geometries.\n"); + printf(" -t := Do not split terminals in grid points.\n"); printf("\n" ); } @@ -85,6 +86,7 @@ extern int main(argc, argv) if (!strcmp(argv[i], "-V")) { VL = C_VerboseLevel2; continue; } if (!strcmp(argv[i], "-o")) { sxFlags |= F_ALLOW_OFFGRID; continue; } if (!strcmp(argv[i], "-p")) { sxFlags |= F_NO_POWER_GEOM; continue; } + if (!strcmp(argv[i], "-t")) { sxFlags |= F_NO_SPLIT_TERM; continue; } break; }