Port gscr/src from Alliance 4 to restore 2 metal routing capabilities.
* New: Ported gscr/src placer and channel router for 2 metal only technologies (for Hibikino & Make::LSI project). * Bug: In rfmaccess.c, do not draw rectangle when both size are too small instead of only one of them.
This commit is contained in:
parent
e2db4908a9
commit
58012f54fb
|
@ -73,7 +73,7 @@ dirs="$newdirs documentation"
|
|||
order="mbk \
|
||||
aut rds elp abl bdd log btr vex ctl ctp abe abt \
|
||||
abv fsm fks fvh ftl rtn rtd scl vpn vbh pat gcp \
|
||||
druc beh bhl bvl"
|
||||
druc beh bhl bvl gscr"
|
||||
ordered_dirs=""
|
||||
for lib in $order; do
|
||||
if echo "$dirs" | grep $lib > /dev/null ; then
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = src
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
AC_INIT(src/apr.h)
|
||||
|
||||
APR_CUR=1
|
||||
APR_REV=3
|
||||
APR_REL=0
|
||||
|
||||
APR_VERSION=$APR_CUR.$APR_REV
|
||||
APR_DLL_VERSION=${APR_CUR}:${APR_REV}:${APR_REL}
|
||||
|
||||
AC_SUBST(APR_CUR)
|
||||
AC_SUBST(APR_REV)
|
||||
AC_SUBST(APR_REL)
|
||||
AC_SUBST(APR_DLL_VERSION)
|
||||
|
||||
AM_INIT_AUTOMAKE(apr, $APR_VERSION)
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_CC
|
||||
AC_HEADER_STDC
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_VFORK
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AM_ALLIANCE
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
src/Makefile
|
||||
])
|
|
@ -0,0 +1,19 @@
|
|||
AM_CFLAGS = @ALLIANCE_CFLAGS@ \
|
||||
-I$(top_srcdir)/mbk/src \
|
||||
-DMAXLINE=500 -DMAXCOL=1000 -O4
|
||||
|
||||
lib_LTLIBRARIES = libApr.la
|
||||
include_HEADERS = apr.h
|
||||
|
||||
libApr_la_SOURCES = gscr_greedy.h gscr_StaticUtil.h scp_inits.h scp_modif.h scp_time.h \
|
||||
gscr_AllowFree.c gscr_GreedyRout.c gscr_SymbChanRout.c scp_main.c \
|
||||
scp_placer.c scp_types.h gscr_AllowFree.h gscr_GreedyRout.h \
|
||||
gscr_SymbChanRout.h scp_main.h scp_placer.h sx2sc.c gscr_DataBase.h \
|
||||
scp_channel.c scp_mbk2scp.c scp_scp2mbk.c gscr_DynamicUtil.c \
|
||||
gscr_main.h scp_channel.h scp_mbk2scp.h scp_scp2mbk.h gscr_DynamicUtil.h \
|
||||
gscr_StaticUtil.c scp_inits.c scp_modif.c scp_time.c
|
||||
|
||||
#libApr_la_LDFLAGS = -version-info @APR_DLL_VERSION@
|
||||
|
||||
libApr_la_LIBADD = -lMut -lMph -lMlo
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Automatic Router and Placer library */
|
||||
/* File : @(#) */
|
||||
/* Contents : */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : El housseine REJOUAN Date : 06/10/1993 */
|
||||
/* Modified by : Date : ../../.... */
|
||||
/* Modified by : Date : ../../.... */
|
||||
/* Modified by : Date : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
/*############################################################################*/
|
||||
/* Symbolic Channel Router */
|
||||
/*############################################################################*/
|
||||
# define BOOLEAN int
|
||||
# define NONET ((long ) 0)
|
||||
# define PITCH_X ((long )(/*6*/5 * SCALE_X))
|
||||
# define PITCH_Y ((long )(5 * SCALE_X))
|
||||
# define NORTHOFFSET ((long )((L3MODE?5:4) * SCALE_X))
|
||||
# define SOUTHOFFSET ((long )((L3MODE?0:4) * SCALE_X))
|
||||
# define WESTOFFSET (PITCH_X /* / 2 */)
|
||||
# define EASTOFFSET (0 /* PITCH_X / 2 */)
|
||||
# define LAYER1WIDTH ((long) 2 * SCALE_X)
|
||||
# define LAYER2WIDTH ((long) 2 * SCALE_X)
|
||||
|
||||
/******************************************************************************/
|
||||
typedef struct SCR_ConnectorList
|
||||
{
|
||||
struct SCR_ConnectorList *NextCon;
|
||||
long ConName ;/* index signal */
|
||||
long Mark ;/* number of the column */
|
||||
}ConnectorList;
|
||||
|
||||
typedef struct SCR_SegmentList
|
||||
{
|
||||
struct SCR_SegmentList *NextSeg;
|
||||
char *SegName;
|
||||
long X1Seg ;
|
||||
long Y1Seg ;
|
||||
long X2Seg ;
|
||||
long Y2Seg ;
|
||||
}SegmentList;
|
||||
|
||||
typedef struct SCR_ViasList
|
||||
{
|
||||
struct SCR_ViasList *NextVia;
|
||||
long XVia ;
|
||||
long YVia ;
|
||||
} ViasList;
|
||||
|
||||
/******************************************************************************/
|
||||
extern BOOLEAN SymbolicChannelRouter();
|
||||
|
||||
/*############################################################################*/
|
||||
/* Symbolic Placer */
|
||||
/*############################################################################*/
|
||||
|
||||
typedef struct CaracCon
|
||||
{
|
||||
struct CaracCon *NEXT;
|
||||
char *NAME; /* nom du connecteur a place */
|
||||
long USER; /* ordre du connecteur a place sur une */
|
||||
/* face donnee (concerne pour scr) */
|
||||
/* numero du slice dans lequel le */
|
||||
/* connecteur doit etre place (concerne */
|
||||
/* pour dpr) */
|
||||
} CaracConList;
|
||||
|
||||
typedef struct PlaceCon
|
||||
{
|
||||
CaracConList *NORTH_CON;
|
||||
CaracConList *SOUTH_CON;
|
||||
CaracConList *WEST_CON;
|
||||
CaracConList *EAST_CON;
|
||||
long VER_FEED; /* pour scr, ce champs designe le nombre de transparences verticales */
|
||||
long HOR_FEED; /* pour scr, ce champs designe le nombre de transparences horizontales */
|
||||
} PlaceConList;
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
includes
|
||||
\---------------------------------------------------------*/
|
||||
#include <mut.h>
|
||||
#include <mlo.h>
|
||||
#include <mph.h>
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
typedefs
|
||||
\---------------------------------------------------------*/
|
||||
typedef struct cell_struct
|
||||
{
|
||||
struct cell *cell;
|
||||
struct cell_struct *next;
|
||||
} cells_of_net;
|
||||
typedef struct
|
||||
{
|
||||
long coeff;
|
||||
cells_of_net *first;
|
||||
} net_list;
|
||||
|
||||
typedef struct net_struct
|
||||
{
|
||||
net_list *net;
|
||||
struct net_struct *next;
|
||||
} nets_of_cell;
|
||||
typedef struct cell
|
||||
{
|
||||
struct cell *next;
|
||||
struct cell *prev;
|
||||
int width;
|
||||
int x;
|
||||
int y;
|
||||
int row;
|
||||
loins_list *ins;
|
||||
void *first;
|
||||
} cell_list;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
cell_list *head;
|
||||
cell_list *tail;
|
||||
long length;
|
||||
} row_elt;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
row_elt *Rows;
|
||||
long NbRows;
|
||||
cell_list *Cells;
|
||||
long NbCells;
|
||||
} placement_fig;
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les prototypes
|
||||
\---------------------------------------------------------*/
|
||||
extern void sx2sc ();
|
||||
extern placement_fig *Place();
|
||||
extern phfig_list *OpenVerticalChannel();
|
||||
|
||||
/*############################################################################*/
|
|
@ -0,0 +1,314 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* STANDARD CELLS ROUTER */
|
||||
/* FILE : SCR_AllowFree.c LAST MODIFICATION : JUL/8/1991 */
|
||||
/******************************************************************************/
|
||||
|
||||
# include "gscr_DataBase.h"
|
||||
# include "apr.h"
|
||||
# include <mut.h>
|
||||
# include <mlo.h>
|
||||
# include <mph.h>
|
||||
|
||||
/******************************************************************************/
|
||||
/* ALLOCATION D'UNE PISTE */
|
||||
/******************************************************************************/
|
||||
StaticPoint *SCR_AllowOneTrack(Width)
|
||||
|
||||
long Width;
|
||||
|
||||
{
|
||||
StaticPoint *LeadTrack = NULL;
|
||||
StaticPoint *CurrentPoint = NULL;
|
||||
StaticPoint *PrevCurrentPoint = NULL;
|
||||
long Size = 0;
|
||||
|
||||
LeadTrack = (StaticPoint *) mbkalloc (sizeof(StaticPoint));
|
||||
LeadTrack->NextPoint = NULL;
|
||||
LeadTrack->RightPoint = NULL;
|
||||
LeadTrack->PointName = ((long ) 0);
|
||||
LeadTrack->Via = FALSE;
|
||||
LeadTrack->Layer1 = NOP;
|
||||
LeadTrack->Layer2 = NOP;
|
||||
PrevCurrentPoint = LeadTrack;
|
||||
for (Size = 1; Size < Width; Size++) {
|
||||
CurrentPoint = (StaticPoint *) mbkalloc (sizeof(StaticPoint));
|
||||
PrevCurrentPoint->RightPoint = CurrentPoint;
|
||||
PrevCurrentPoint = CurrentPoint;
|
||||
CurrentPoint->NextPoint = NULL;
|
||||
CurrentPoint->RightPoint = NULL;
|
||||
CurrentPoint->PointName = ((long ) 0);
|
||||
CurrentPoint->Via = FALSE;
|
||||
CurrentPoint->Layer1 = NOP;
|
||||
CurrentPoint->Layer2 = NOP;
|
||||
}
|
||||
return(LeadTrack);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* ALLOCATION D'UN ENSEMBLE DE PISTES */
|
||||
/******************************************************************************/
|
||||
StaticPoint *SCR_AllowSetTrack(Density, Width)
|
||||
|
||||
long Density;
|
||||
long Width;
|
||||
|
||||
{
|
||||
StaticPoint *LeadSetTrack = NULL;
|
||||
StaticPoint *CurrentTrack = NULL;
|
||||
StaticPoint *NewTrack = NULL;
|
||||
StaticPoint *PrevCurrentTrack = NULL;
|
||||
long Size = 0;
|
||||
|
||||
LeadSetTrack = SCR_AllowOneTrack(Width);
|
||||
PrevCurrentTrack = LeadSetTrack;
|
||||
for (Size = 1; Size < Density; Size++) {
|
||||
for (NewTrack = CurrentTrack = SCR_AllowOneTrack(Width); CurrentTrack;
|
||||
CurrentTrack = CurrentTrack->RightPoint,
|
||||
PrevCurrentTrack = PrevCurrentTrack->RightPoint)
|
||||
PrevCurrentTrack->NextPoint = CurrentTrack;
|
||||
PrevCurrentTrack = NewTrack;
|
||||
}
|
||||
return(LeadSetTrack);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* ALLOCATION DE COLONNE SANS POINTs */
|
||||
/******************************************************************************/
|
||||
StaticColumn *SCR_AllowColumn(Width)
|
||||
|
||||
long Width;
|
||||
|
||||
{
|
||||
StaticColumn *LeadColumn = NULL;
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
StaticColumn *PrevCurrentColumn = NULL;
|
||||
long Size = 0;
|
||||
|
||||
LeadColumn = (StaticColumn *) mbkalloc (sizeof(StaticColumn));
|
||||
LeadColumn->NextCol = NULL;
|
||||
LeadColumn->PrevCol = NULL;
|
||||
LeadColumn->NorthCon = ((long ) 0);
|
||||
LeadColumn->SouthCon = ((long ) 0);
|
||||
LeadColumn->PointList = NULL;
|
||||
PrevCurrentColumn = LeadColumn;
|
||||
for (Size = 1; Size < Width ; Size++) {
|
||||
CurrentColumn = (StaticColumn *) mbkalloc (sizeof(StaticColumn));
|
||||
PrevCurrentColumn->NextCol = CurrentColumn;
|
||||
CurrentColumn->PrevCol = PrevCurrentColumn;
|
||||
PrevCurrentColumn = CurrentColumn;
|
||||
CurrentColumn->NextCol = NULL;
|
||||
CurrentColumn->NorthCon = ((long ) 0);
|
||||
CurrentColumn->SouthCon = ((long ) 0);
|
||||
CurrentColumn->PointList = NULL;
|
||||
}
|
||||
return(LeadColumn);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* ALLOCATION D'UN CANAL */
|
||||
/******************************************************************************/
|
||||
StaticColumn *SCR_AllowChannel(LeadStaticDataBase, Density, Width)
|
||||
|
||||
StaticColumn *LeadStaticDataBase;
|
||||
long Density;
|
||||
long Width;
|
||||
|
||||
{
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
StaticPoint *CurrentSetTrack = NULL;
|
||||
|
||||
CurrentSetTrack = SCR_AllowSetTrack(Density, Width);
|
||||
for (CurrentColumn = LeadStaticDataBase; CurrentColumn;
|
||||
CurrentColumn = CurrentColumn->NextCol,
|
||||
CurrentSetTrack = CurrentSetTrack->RightPoint)
|
||||
CurrentColumn->PointList = CurrentSetTrack;
|
||||
return(LeadStaticDataBase);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Les fonctions d'allocation suivantes seront utlisees au cas ou */
|
||||
/* il faut ajouter une nouvelle colonne */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/******************************************************************************/
|
||||
/* ALLOCATION D'UNE LISTE DE POINTs */
|
||||
/******************************************************************************/
|
||||
StaticPoint *SCR_AllowStaticPoint(Density)
|
||||
|
||||
long Density;
|
||||
|
||||
{
|
||||
StaticPoint *LeadStaticPoint = NULL;
|
||||
StaticPoint *CurrentPoint = NULL;
|
||||
StaticPoint *PrevCurrentPoint = NULL;
|
||||
long Size = 0;
|
||||
|
||||
LeadStaticPoint = (StaticPoint *) mbkalloc (sizeof(StaticPoint));
|
||||
LeadStaticPoint->NextPoint = NULL;
|
||||
LeadStaticPoint->RightPoint = NULL;
|
||||
LeadStaticPoint->PointName = ((long ) 0);
|
||||
LeadStaticPoint->Via = FALSE;
|
||||
LeadStaticPoint->Layer1 = NOP;
|
||||
LeadStaticPoint->Layer2 = NOP;
|
||||
PrevCurrentPoint = LeadStaticPoint;
|
||||
for (Size = 1; Size < Density; Size++) {
|
||||
CurrentPoint = (StaticPoint *) mbkalloc (sizeof(StaticPoint));
|
||||
PrevCurrentPoint->NextPoint = CurrentPoint;
|
||||
PrevCurrentPoint = CurrentPoint;
|
||||
CurrentPoint->NextPoint = NULL;
|
||||
CurrentPoint->RightPoint = NULL;
|
||||
CurrentPoint->PointName = ((long ) 0);
|
||||
CurrentPoint->Via = FALSE;
|
||||
CurrentPoint->Layer1 = NOP;
|
||||
CurrentPoint->Layer2 = NOP;
|
||||
}
|
||||
return(LeadStaticPoint);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* ALLOCATION D'UNE COLONNE AVEC POINTs */
|
||||
/******************************************************************************/
|
||||
StaticColumn *SCR_AllowOneColumn(Density)
|
||||
|
||||
long Density;
|
||||
{
|
||||
StaticColumn *Column = NULL;
|
||||
|
||||
Column = (StaticColumn *) mbkalloc (sizeof(StaticColumn));
|
||||
Column->NextCol = NULL;
|
||||
Column->PrevCol = NULL;
|
||||
Column->NorthCon = ((long ) 0);
|
||||
Column->SouthCon = ((long ) 0);
|
||||
Column->PointList = SCR_AllowStaticPoint(Density);
|
||||
return(Column);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* LIBERATION DE LA MEMOIRE */
|
||||
/******************************************************************************/
|
||||
void SCR_FreeDataBase(LeadDataBase)
|
||||
|
||||
StaticColumn *LeadDataBase;
|
||||
|
||||
{
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
StaticColumn *AfterCurrentColumn = NULL;
|
||||
StaticPoint *CurrentPoint = NULL;
|
||||
StaticPoint *AfterCurrentPoint = NULL;
|
||||
|
||||
CurrentColumn = LeadDataBase;
|
||||
AfterCurrentColumn = LeadDataBase->NextCol;
|
||||
while(CurrentColumn->NextCol) {
|
||||
CurrentPoint = CurrentColumn->PointList;
|
||||
AfterCurrentPoint = CurrentPoint->NextPoint;
|
||||
while (CurrentPoint->NextPoint) {
|
||||
mbkfree(((void * ) CurrentPoint));
|
||||
CurrentPoint = AfterCurrentPoint;
|
||||
AfterCurrentPoint = CurrentPoint->NextPoint;
|
||||
}
|
||||
mbkfree(((void * ) CurrentPoint));
|
||||
mbkfree(((void * ) CurrentColumn));
|
||||
CurrentColumn = AfterCurrentColumn;
|
||||
AfterCurrentColumn = CurrentColumn->NextCol;
|
||||
}
|
||||
mbkfree(((void * ) CurrentColumn));
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* ALLOCATION MEMOIRE POUR LA LISTE DES SEGMENTs */
|
||||
/******************************************************************************/
|
||||
SegmentList *SCR_AllowSegmentList()
|
||||
|
||||
{
|
||||
SegmentList *LeadSegmentList = NULL;
|
||||
|
||||
LeadSegmentList = (SegmentList *) mbkalloc (sizeof(SegmentList));
|
||||
LeadSegmentList->NextSeg = NULL;
|
||||
LeadSegmentList->SegName = '\0';
|
||||
LeadSegmentList->X1Seg = ((long ) 0);
|
||||
LeadSegmentList->Y1Seg = ((long ) 0);
|
||||
LeadSegmentList->X2Seg = ((long ) 0);
|
||||
LeadSegmentList->Y2Seg = ((long ) 0);
|
||||
return (LeadSegmentList);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* ALLOCATION MEMOIRE POUR LA LISTE DES VIAs */
|
||||
/******************************************************************************/
|
||||
ViasList *SCR_AllowViasList()
|
||||
|
||||
{
|
||||
ViasList *LeadViaList = NULL;
|
||||
|
||||
LeadViaList = (ViasList *) mbkalloc (sizeof(ViasList));
|
||||
LeadViaList->NextVia = NULL;
|
||||
LeadViaList->XVia = ((long ) 0);
|
||||
LeadViaList->YVia = ((long ) 0);
|
||||
return (LeadViaList);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* FREE OF SEGMENT DATA BASE */
|
||||
/******************************************************************************/
|
||||
void SCR_FreeSegmentList(LeadSegList)
|
||||
|
||||
SegmentList *LeadSegList;
|
||||
|
||||
{
|
||||
SegmentList *CurrentSeg = NULL;
|
||||
SegmentList *AfterCurrentSeg = NULL;
|
||||
|
||||
CurrentSeg = LeadSegList;
|
||||
AfterCurrentSeg = LeadSegList->NextSeg;
|
||||
while (CurrentSeg->NextSeg) {
|
||||
mbkfree(((void * ) CurrentSeg));
|
||||
CurrentSeg = AfterCurrentSeg;
|
||||
AfterCurrentSeg = CurrentSeg->NextSeg;
|
||||
}
|
||||
mbkfree(((void * ) CurrentSeg));
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* FREE OF VIA DATA BASE */
|
||||
/******************************************************************************/
|
||||
void SCR_FreeViasList(LeadViaList)
|
||||
|
||||
ViasList *LeadViaList;
|
||||
|
||||
{
|
||||
ViasList *CurrentVia = NULL;
|
||||
ViasList *AfterCurrentVia = NULL;
|
||||
|
||||
CurrentVia = LeadViaList;
|
||||
AfterCurrentVia = LeadViaList->NextVia;
|
||||
while(CurrentVia->NextVia) {
|
||||
mbkfree(((void * ) CurrentVia));
|
||||
CurrentVia = AfterCurrentVia;
|
||||
AfterCurrentVia = CurrentVia->NextVia;
|
||||
}
|
||||
mbkfree(((void *) CurrentVia));
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
extern StaticPoint *SCR_AllowOneTrack();
|
||||
extern StaticPoint *SCR_AllowSetTrack();
|
||||
extern StaticColumn *SCR_AllowColumn();
|
||||
extern StaticColumn *SCR_AllowChannel();
|
||||
extern StaticPoint *SCR_AllowStaticPoint();
|
||||
extern StaticColumn *SCR_AllowOneColumn();
|
||||
extern void SCR_FreeDataBase();
|
||||
extern SegmentList *SCR_AllowSegmentList();
|
||||
extern ViasList *SCR_AllowViasList();
|
||||
extern void SCR_FreeSegmentList();
|
||||
extern void SCR_FreeViasList();
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
# define MAX(a,b) ((a>b) ? a:b)
|
||||
# define BOOLEAN int
|
||||
# define FALSE ((int ) 0)
|
||||
# define TRUE ((int ) 1)
|
||||
# define NOP ((char )'0')
|
||||
# define HOR ((char )'H')
|
||||
# define VER ((char )'V')
|
||||
|
||||
typedef struct SCR_StaticPoint
|
||||
{
|
||||
struct SCR_StaticPoint *NextPoint ;
|
||||
struct SCR_StaticPoint *RightPoint;
|
||||
long PointName ;
|
||||
BOOLEAN Via ;
|
||||
char Layer1 ;
|
||||
char Layer2 ;
|
||||
}StaticPoint;
|
||||
|
||||
typedef struct SCR_StaticColumn
|
||||
{
|
||||
struct SCR_StaticColumn *NextCol ;
|
||||
struct SCR_StaticColumn *PrevCol ;
|
||||
long NorthCon ;
|
||||
long SouthCon ;
|
||||
struct SCR_StaticPoint *PointList;
|
||||
}StaticColumn;
|
||||
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* STANDARD CELLS ROUTER */
|
||||
/* FILE : DynamicUtility.c LAST MODIFICATION : JUL/16/1991 */
|
||||
/******************************************************************************/
|
||||
|
||||
# include <stdio.h>
|
||||
# include "gscr_DataBase.h"
|
||||
# include "gscr_greedy.h"
|
||||
|
||||
char car;
|
||||
char string[10];
|
||||
int i=0;
|
||||
|
||||
/******************************************************************************/
|
||||
/* LOAD DYNAMIC DATA BASE */
|
||||
/******************************************************************************/
|
||||
long U_ReadNumber(ptfich)
|
||||
|
||||
FILE *ptfich;
|
||||
|
||||
{
|
||||
long Number = 0;
|
||||
i = 0;
|
||||
car = getc(ptfich);
|
||||
while ((car != ' ') && (car != ',') && (car != '}')) {
|
||||
if (car != '\n') string[i++] = car;
|
||||
car = getc(ptfich);
|
||||
}
|
||||
string[i] = '\0';
|
||||
Number = atol(string);
|
||||
return (Number);
|
||||
}
|
||||
/******************************************************************************/
|
||||
|
||||
void U_GetDynamicDataBase(FichName, Density)
|
||||
|
||||
char *FichName;
|
||||
long Density;
|
||||
|
||||
{
|
||||
long Line = 0;
|
||||
FILE *ptfich;
|
||||
|
||||
ptfich = fopen(FichName,"r");
|
||||
while ((car = getc(ptfich)) != '\n') string[i++] = car;
|
||||
string[i] = '\0';
|
||||
for (; Line <= Density + 1; Line++) {
|
||||
car = getc(ptfich);
|
||||
PREVHNET(Line) = U_ReadNumber(ptfich);
|
||||
HNET(Line) = U_ReadNumber(ptfich);
|
||||
SPLIT(Line) = U_ReadNumber(ptfich);
|
||||
SFRT(Line) = U_ReadNumber(ptfich);
|
||||
VNET(Line) = U_ReadNumber(ptfich);
|
||||
car = getc(ptfich);
|
||||
}
|
||||
fclose(ptfich);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* PRINT COLUMN */
|
||||
/******************************************************************************/
|
||||
void U_PrintDynamicDataBase(Density)
|
||||
|
||||
long Density;
|
||||
|
||||
{
|
||||
long Column = 0;
|
||||
long Line = 0;
|
||||
printf(" P \n");
|
||||
printf(" R \n");
|
||||
printf(" E W \n");
|
||||
printf(" V S E C \n");
|
||||
printf(" H H P S I V O \n");
|
||||
printf(" N N L F G N M \n");
|
||||
printf(" E E I R H E B \n");
|
||||
printf(" T T T T T T I \n\n");
|
||||
|
||||
for (Line = 0; Line <= Density + 1; Line++) {
|
||||
for (Column = 0; Column <= EndPattern; Column++)
|
||||
printf("%2ld ", TabRout[Column][Line]);
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
extern long U_ReadNumber();
|
||||
extern void U_getDynamicDataBase();
|
||||
extern void U_PrintDynamicDataBase();
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
extern BOOLEAN SCR_BelongInWindow();
|
||||
extern void SCR_InitSplit();
|
||||
extern void SCR_SplitNet();
|
||||
extern void SCR_SFRT_Net();
|
||||
extern void SCR_WeightTracks();
|
||||
extern void SCR_InsertNewLine();
|
||||
extern void SCR_UpDateDataBase();
|
||||
extern void Step1();
|
||||
extern void Step2();
|
||||
extern void Step3();
|
||||
extern void Step4();
|
||||
extern void Step5();
|
||||
extern void Step6();
|
||||
extern void SCR_EndingNotCollapsingNets();
|
||||
extern void SCR_GreedyRouter();
|
|
@ -0,0 +1,543 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Symbolic Channel Router */
|
||||
/* File : @(#) */
|
||||
/* Contents : */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : El housseine REJOUAN Date : ../../.... */
|
||||
/* Modified by : El housseine REJOUAN Date : 29/07/1992 */
|
||||
/* Modified by : Date : ../../.... */
|
||||
/* Modified by : Date : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <mut.h>
|
||||
# include <mlo.h>
|
||||
# include <mph.h>
|
||||
# include "apr.h"
|
||||
# include "gscr_main.h"
|
||||
# include "gscr_DataBase.h"
|
||||
|
||||
int L3MODE;
|
||||
|
||||
/***********************************************************************/
|
||||
/* CHARGEMENT DES LISTES NORTH, SOUTH, WEST ET EAST */
|
||||
/***********************************************************************/
|
||||
ConnectorList *U_GetConList(ptfich)
|
||||
|
||||
FILE *ptfich;
|
||||
|
||||
{
|
||||
ConnectorList *LeadConList = NULL;
|
||||
ConnectorList *CurrentList = NULL;
|
||||
ConnectorList *PrevCurrentList = NULL;
|
||||
long Mark = 1;
|
||||
char car;
|
||||
char string[10];
|
||||
int i=0;
|
||||
|
||||
|
||||
if ((car = getc(ptfich)) == '{')
|
||||
if ((car = getc(ptfich)) != '}') {
|
||||
while ((car != ' ') && (car != ',') && (car != '}')) {
|
||||
if (car != '\n') string[i++] = car;
|
||||
car = getc(ptfich);
|
||||
}
|
||||
string[i] = '\0';
|
||||
LeadConList = (ConnectorList *) mbkalloc (sizeof(ConnectorList));
|
||||
PrevCurrentList = LeadConList;
|
||||
LeadConList->NextCon = NULL;
|
||||
LeadConList->ConName = atol(string);
|
||||
LeadConList->Mark = Mark;
|
||||
Mark++;
|
||||
|
||||
while (car != '}') {
|
||||
i = 0;
|
||||
car = getc(ptfich);
|
||||
while ((car != ' ') && (car != ',') && (car != '}')) {
|
||||
if (car != '\n') string[i++] = car;
|
||||
car = getc(ptfich);
|
||||
}
|
||||
string[i] = '\0';
|
||||
CurrentList = (ConnectorList *) mbkalloc (sizeof(ConnectorList));
|
||||
PrevCurrentList->NextCon = CurrentList;
|
||||
PrevCurrentList = CurrentList;
|
||||
CurrentList->NextCon = NULL;
|
||||
CurrentList->ConName = atol(string);
|
||||
CurrentList->Mark = Mark;
|
||||
Mark++;
|
||||
}
|
||||
}
|
||||
else LeadConList = NULL;
|
||||
car = getc(ptfich);
|
||||
return (LeadConList);
|
||||
}
|
||||
/******************************************************************************/
|
||||
/* Function : U_GetChannel() */
|
||||
/******************************************************************************/
|
||||
void U_GetChannel(FichName, LeadNorthList, LeadSouthList,
|
||||
LeadWestList, LeadEastList)
|
||||
|
||||
char *FichName;
|
||||
ConnectorList **LeadNorthList;
|
||||
ConnectorList **LeadSouthList;
|
||||
ConnectorList **LeadWestList;
|
||||
ConnectorList **LeadEastList;
|
||||
|
||||
{
|
||||
FILE *ptfich;
|
||||
|
||||
if ((ptfich = fopen(FichName,"r")) == NULL) {
|
||||
fprintf(stdout,"fichier inexistant \n");
|
||||
exit(0);
|
||||
}
|
||||
else {
|
||||
*LeadNorthList = U_GetConList(ptfich);
|
||||
*LeadSouthList = U_GetConList(ptfich);
|
||||
*LeadWestList = U_GetConList(ptfich);
|
||||
*LeadEastList = U_GetConList(ptfich);
|
||||
fclose(ptfich);
|
||||
}
|
||||
}
|
||||
/******************************************************************************/
|
||||
/* VISUALISATION DE LA LISTE DES CONNECTEURS */
|
||||
/******************************************************************************/
|
||||
void U_PrintList(LeadConList)
|
||||
|
||||
ConnectorList *LeadConList;
|
||||
|
||||
{
|
||||
ConnectorList *CurrentConList;
|
||||
CurrentConList = LeadConList;
|
||||
|
||||
if (LeadConList)
|
||||
while (CurrentConList) {
|
||||
fprintf(stderr, "ConName= %ld \t Mark= %ld \n", CurrentConList->ConName,
|
||||
CurrentConList->Mark);
|
||||
CurrentConList = CurrentConList->NextCon;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* VISUALISATION DE LA LISTE DES COLONNES */
|
||||
/******************************************************************************/
|
||||
void U_PrintColumn(LeadColumn)
|
||||
|
||||
StaticColumn *LeadColumn;
|
||||
{
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
|
||||
CurrentColumn = LeadColumn;
|
||||
while (CurrentColumn) {
|
||||
fprintf(stderr, "NorthCon = %ld \t SouthCon = %ld \n",CurrentColumn->NorthCon,
|
||||
CurrentColumn->SouthCon);
|
||||
CurrentColumn = CurrentColumn->NextCol;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* LARGEUR DU CANAL */
|
||||
/******************************************************************************/
|
||||
long U_ChannelWidth(LeadNorth, LeadSouth)
|
||||
|
||||
StaticColumn *LeadNorth;
|
||||
StaticColumn *LeadSouth;
|
||||
|
||||
{
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
long NorthWidth = 0;
|
||||
long SouthWidth = 0;
|
||||
|
||||
for (CurrentColumn = LeadNorth; CurrentColumn;
|
||||
CurrentColumn = CurrentColumn->NextCol, NorthWidth++);
|
||||
for (CurrentColumn = LeadSouth; CurrentColumn;
|
||||
CurrentColumn = CurrentColumn->NextCol, SouthWidth++);
|
||||
return(MAX(NorthWidth, SouthWidth));
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* VISUALISATION DE LA BASE DE DONNEE STATIQUE */
|
||||
/******************************************************************************/
|
||||
void U_PrintStaticDataBase(LeadColumn)
|
||||
|
||||
StaticColumn *LeadColumn;
|
||||
|
||||
{
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
StaticPoint *CurrentPoint = NULL;
|
||||
|
||||
for (CurrentColumn = LeadColumn;CurrentColumn;
|
||||
CurrentColumn = CurrentColumn->NextCol) {
|
||||
fprintf(stderr, "NorthCon = %ld \t SouthCon = %ld \n",CurrentColumn->NorthCon,
|
||||
CurrentColumn->SouthCon);
|
||||
for (CurrentPoint = CurrentColumn->PointList; CurrentPoint;
|
||||
CurrentPoint = CurrentPoint->NextPoint)
|
||||
fprintf(stderr, "Via = %d \t Layer1 = %c \t Layer2 = %c \t Name = %ld \n",
|
||||
CurrentPoint->Via, CurrentPoint->Layer1, CurrentPoint->Layer2,
|
||||
CurrentPoint->PointName);
|
||||
}
|
||||
}
|
||||
/******************************************************************************/
|
||||
/* VISUALISATION DE LA LISTE DES SEGMENTS */
|
||||
/******************************************************************************/
|
||||
void U_PrintSegmentList(LeadList)
|
||||
|
||||
SegmentList *LeadList;
|
||||
|
||||
{
|
||||
SegmentList *CurrentList = NULL;
|
||||
|
||||
for (CurrentList = LeadList; CurrentList; CurrentList = CurrentList->NextSeg) {
|
||||
fprintf(stderr,"Name = %s \t X1Seg = %3ld \t Y1Seg = %3ld \t ",
|
||||
CurrentList->SegName, CurrentList->X1Seg, CurrentList->Y1Seg);
|
||||
fprintf(stderr,"X2Seg= %3ld \t Y2Seg= %3ld \n",
|
||||
CurrentList->X2Seg, CurrentList->Y2Seg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* VISUALISATION DE LA LISTE DES SEGMENTS */
|
||||
/******************************************************************************/
|
||||
void U_PrintViasList(LeadList)
|
||||
|
||||
ViasList *LeadList;
|
||||
|
||||
{
|
||||
ViasList *CurrentList = NULL;
|
||||
|
||||
for (CurrentList = LeadList; CurrentList; CurrentList = CurrentList->NextVia)
|
||||
fprintf(stderr,"XVia = %ld \t YVia = %ld \t \n",
|
||||
CurrentList->XVia, CurrentList->YVia);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : */
|
||||
/* */
|
||||
/* Description : */
|
||||
/* */
|
||||
/* Input parameters : */
|
||||
/* Input global Variables : */
|
||||
/* Output parameters : */
|
||||
/* Output global Variables : */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
void gscr2mbk(FigName,LeadHorSeg,LeadVerSeg,LeadVia,
|
||||
LeadNorthCon,LeadSouthCon,LeadWestCon,
|
||||
LeadEastCon,ChannelWidth,ChannelHeight)
|
||||
char *FigName;
|
||||
SegmentList *LeadHorSeg;
|
||||
SegmentList *LeadVerSeg;
|
||||
ViasList *LeadVia;
|
||||
ConnectorList *LeadNorthCon;
|
||||
ConnectorList *LeadSouthCon;
|
||||
ConnectorList *LeadWestCon;
|
||||
ConnectorList *LeadEastCon;
|
||||
long ChannelWidth;
|
||||
long ChannelHeight;
|
||||
|
||||
{
|
||||
phfig_list *ptFigure = NULL;
|
||||
SegmentList *CurrentSeg = NULL;
|
||||
ViasList *CurrentVia = NULL;
|
||||
ConnectorList *CurrentCon = NULL;
|
||||
long X1Symbolic = 0;
|
||||
long X2Symbolic = 0;
|
||||
long Y1Symbolic = 0;
|
||||
long Y2Symbolic = 0;
|
||||
long X1Segment = 0;
|
||||
long X2Segment = 0;
|
||||
long Y1Segment = 0;
|
||||
long Y2Segment = 0;
|
||||
long Xab1 = 0;
|
||||
long Xab2 = 0;
|
||||
long Yab1 = 0;
|
||||
long Yab2 = 0;
|
||||
long ConName = 0;
|
||||
char Buffer[10];
|
||||
|
||||
ptFigure = addphfig(FigName);
|
||||
Xab1 = Yab1 = ptFigure->XAB1 = ptFigure->YAB1 = 0;
|
||||
Xab2 = ptFigure->XAB2 =
|
||||
((ChannelWidth - 1) * PITCH_X) + WESTOFFSET + EASTOFFSET;
|
||||
Yab2 = ptFigure->YAB2 =
|
||||
((ChannelHeight - 1) * PITCH_Y) + SOUTHOFFSET + NORTHOFFSET;
|
||||
|
||||
/******************************************************************************/
|
||||
/* SAVING HORIZONTAL SEGMENT */
|
||||
/******************************************************************************/
|
||||
for (CurrentSeg = LeadHorSeg; CurrentSeg; CurrentSeg = CurrentSeg->NextSeg) {
|
||||
if ((X1Symbolic = CurrentSeg->X1Seg) == 0)
|
||||
X1Segment = Xab1;
|
||||
else
|
||||
X1Segment = ((X1Symbolic - 1) * PITCH_X) + WESTOFFSET;
|
||||
if ((X2Symbolic = CurrentSeg->X2Seg) == (ChannelWidth + 1))
|
||||
X2Segment = Xab2;
|
||||
else
|
||||
X2Segment = ((X2Symbolic - 1) * PITCH_X) + WESTOFFSET;
|
||||
Y1Segment = Y2Segment = (((CurrentSeg->Y1Seg - 1) * PITCH_Y) + SOUTHOFFSET);
|
||||
addphseg(ptFigure, ((char )ALU1), LAYER1WIDTH, X1Segment, Y1Segment,
|
||||
X2Segment , Y2Segment, CurrentSeg->SegName);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* SAVING VERTICAL SEGMENT */
|
||||
/******************************************************************************/
|
||||
for (CurrentSeg = LeadVerSeg; CurrentSeg; CurrentSeg = CurrentSeg->NextSeg) {
|
||||
if ((Y1Symbolic = CurrentSeg->Y1Seg) == 0)
|
||||
Y1Segment = Yab1;
|
||||
else
|
||||
Y1Segment = ((Y1Symbolic - 1) * PITCH_Y) + SOUTHOFFSET;
|
||||
if ((Y2Symbolic = CurrentSeg->Y2Seg) == ChannelHeight + 1)
|
||||
Y2Segment = Yab2;
|
||||
else
|
||||
Y2Segment = ((Y2Symbolic - 1) * PITCH_Y) + SOUTHOFFSET;
|
||||
X1Segment = X2Segment = ((CurrentSeg->X1Seg - 1) * PITCH_X) + WESTOFFSET;
|
||||
addphseg(ptFigure, ((char )ALU2), LAYER2WIDTH, X1Segment, Y1Segment,
|
||||
X2Segment, Y2Segment, CurrentSeg->SegName);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* SAVING VIA */
|
||||
/******************************************************************************/
|
||||
for (CurrentVia = LeadVia; CurrentVia; CurrentVia = CurrentVia->NextVia) {
|
||||
addphvia(ptFigure, ((char ) CONT_VIA),
|
||||
((CurrentVia->XVia - 1) * PITCH_X) + WESTOFFSET,
|
||||
((CurrentVia->YVia - 1) * PITCH_Y) + SOUTHOFFSET,0,0,NULL);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* SAVING CONNECTOR */
|
||||
/******************************************************************************/
|
||||
for (CurrentCon = LeadNorthCon; CurrentCon; CurrentCon = CurrentCon->NextCon) {
|
||||
if ((ConName = CurrentCon->ConName) != NONET) {
|
||||
sprintf(Buffer,"%ld",ConName);
|
||||
addphcon(ptFigure, NORTH, Buffer,
|
||||
((CurrentCon->Mark - 1) * PITCH_X) + WESTOFFSET,
|
||||
Yab2, ((char ) ALU2), LAYER2WIDTH);
|
||||
}
|
||||
}
|
||||
for (CurrentCon = LeadSouthCon; CurrentCon; CurrentCon = CurrentCon->NextCon) {
|
||||
if ((ConName = CurrentCon->ConName) != NONET) {
|
||||
sprintf(Buffer,"%ld",ConName);
|
||||
addphcon(ptFigure, SOUTH, Buffer,
|
||||
((CurrentCon->Mark - 1) * PITCH_X) + WESTOFFSET,
|
||||
Yab1, ((char ) ALU2), LAYER2WIDTH);
|
||||
}
|
||||
}
|
||||
for (CurrentCon = LeadWestCon; CurrentCon; CurrentCon = CurrentCon->NextCon) {
|
||||
sprintf(Buffer,"%ld",CurrentCon->ConName);
|
||||
addphcon(ptFigure, WEST, Buffer, Xab1,
|
||||
((CurrentCon->Mark - 1) * PITCH_Y) + SOUTHOFFSET,
|
||||
((char ) ALU1), LAYER1WIDTH);
|
||||
}
|
||||
for (CurrentCon = LeadEastCon; CurrentCon; CurrentCon = CurrentCon->NextCon) {
|
||||
sprintf(Buffer,"%ld",CurrentCon->ConName);
|
||||
addphcon(ptFigure, EAST, Buffer, Xab2,
|
||||
((CurrentCon->Mark - 1) * PITCH_Y) + SOUTHOFFSET,
|
||||
((char ) ALU1), LAYER1WIDTH);
|
||||
}
|
||||
/******************************************************************************/
|
||||
/* SAVING FIGURE */
|
||||
/******************************************************************************/
|
||||
savephfig(ptFigure);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* SAUVEGARDE DU RESULTAT DE ROUTAGE */
|
||||
/******************************************************************************/
|
||||
void U_SaveChannel(
|
||||
FigName, LeadH_Segment, LeadV_Segment,
|
||||
LeadVia, Width, Height,
|
||||
LeadWestList, LeadEastList
|
||||
)
|
||||
|
||||
char *FigName;
|
||||
SegmentList *LeadH_Segment;
|
||||
SegmentList *LeadV_Segment;
|
||||
ViasList *LeadVia;
|
||||
long Width;
|
||||
long Height;
|
||||
ConnectorList *LeadWestList;
|
||||
ConnectorList *LeadEastList;
|
||||
|
||||
{
|
||||
phfig_list *ptfig = NULL;
|
||||
SegmentList *CurrentSegment = NULL;
|
||||
SegmentList *CurrentSeg = NULL;
|
||||
ViasList *CurrentVia = NULL;
|
||||
long Layer1Length = 0;
|
||||
long Layer2Length = 0;
|
||||
long ViasNumber = 0;
|
||||
long X1Symbolic = 0;
|
||||
long X2Symbolic = 0;
|
||||
long Y1Symbolic = 0;
|
||||
long Y2Symbolic = 0;
|
||||
long X1Segment = 0;
|
||||
long X2Segment = 0;
|
||||
long Y1Segment = 0;
|
||||
long Y2Segment = 0;
|
||||
long Xab1 = 0;
|
||||
long Xab2 = 0;
|
||||
long Yab1 = 0;
|
||||
long Yab2 = 0;
|
||||
|
||||
ptfig = addphfig(FigName);
|
||||
|
||||
fprintf(stdout,"Width = %ld \n",Width);
|
||||
fprintf(stdout,"Height = %ld \n",Height);
|
||||
|
||||
Xab1 = Yab1 = ptfig->XAB1 = ptfig->YAB1 = ((long ) 0);
|
||||
/*
|
||||
ptfig->XAB2 = ((Width + 1) * PITCH_X);
|
||||
ptfig->YAB2 = ((Height + 1 ) * PITCH_Y);
|
||||
*/
|
||||
|
||||
Xab2 = ptfig->XAB2 = ((Width - 1) * PITCH_X) + WESTOFFSET + EASTOFFSET;
|
||||
Yab2 = ptfig->YAB2 = ((Height - 1) * PITCH_Y) + SOUTHOFFSET + NORTHOFFSET;
|
||||
|
||||
fprintf(stderr,"XAB1 = %ld \n",ptfig->XAB1);
|
||||
fprintf(stderr,"XAB2 = %ld \n",ptfig->XAB2);
|
||||
fprintf(stderr,"YAB1 = %ld \n",ptfig->YAB1);
|
||||
fprintf(stderr,"YAB2 = %ld \n",ptfig->YAB2);
|
||||
|
||||
fflush(stderr);
|
||||
|
||||
/******************************************************************************/
|
||||
/* SAVING HORIZONTAL SEGMENT */
|
||||
/******************************************************************************/
|
||||
for (CurrentSeg = LeadH_Segment; CurrentSeg; CurrentSeg = CurrentSeg->NextSeg) {
|
||||
if ((X1Symbolic = CurrentSeg->X1Seg) == 0)
|
||||
X1Segment = Xab1;
|
||||
else
|
||||
X1Segment = ((X1Symbolic - 1) * PITCH_X) + WESTOFFSET;
|
||||
if ((X2Symbolic = CurrentSeg->X2Seg) == (Width + 1))
|
||||
X2Segment = Xab2;
|
||||
else
|
||||
X2Segment = ((X2Symbolic - 1) * PITCH_X) + WESTOFFSET;
|
||||
Y1Segment = Y2Segment = (((CurrentSeg->Y1Seg - 1) * PITCH_Y) + SOUTHOFFSET),
|
||||
addphseg(ptfig, ((char )ALU1), LAYER1WIDTH, X1Segment,
|
||||
Y1Segment, X2Segment , Y2Segment, CurrentSeg->SegName);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/*
|
||||
for (CurrentSegment = LeadH_Segment; CurrentSegment;
|
||||
CurrentSegment = CurrentSegment->NextSeg) {
|
||||
addphseg(ptfig, ((char ) ALU1), LAYER1WIDTH,
|
||||
((CurrentSegment->X1Seg) * PITCH_X),
|
||||
((CurrentSegment->Y1Seg) * PITCH_Y),
|
||||
((CurrentSegment->X2Seg) * PITCH_X),
|
||||
((CurrentSegment->Y2Seg) * PITCH_Y),
|
||||
CurrentSegment->SegName);
|
||||
Layer1Length = Layer1Length + (CurrentSegment->X2Seg - CurrentSegment->X1Seg);
|
||||
}
|
||||
Layer1Length = Layer1Length * PITCH_X;
|
||||
*/
|
||||
|
||||
for (CurrentSegment = LeadV_Segment; CurrentSegment;
|
||||
CurrentSegment = CurrentSegment->NextSeg) {
|
||||
addphseg(ptfig, ((char ) ALU2), LAYER2WIDTH,
|
||||
((CurrentSegment->X1Seg) * PITCH_X),
|
||||
((CurrentSegment->Y1Seg) * PITCH_Y),
|
||||
((CurrentSegment->X2Seg) * PITCH_X),
|
||||
((CurrentSegment->Y2Seg) * PITCH_Y),
|
||||
CurrentSegment->SegName);
|
||||
Layer2Length = Layer2Length + (CurrentSegment->Y2Seg - CurrentSegment->Y1Seg);
|
||||
}
|
||||
Layer2Length = Layer2Length * PITCH_Y;
|
||||
|
||||
for (CurrentVia = LeadVia; CurrentVia; CurrentVia = CurrentVia->NextVia) {
|
||||
addphvia(ptfig, ((char ) CONT_VIA),
|
||||
((CurrentVia->XVia) * PITCH_X),
|
||||
((CurrentVia->YVia) * PITCH_Y),0,0,NULL);
|
||||
ViasNumber = ViasNumber + 1;
|
||||
}
|
||||
|
||||
for (CurrentSegment = LeadV_Segment; CurrentSegment;
|
||||
CurrentSegment = CurrentSegment->NextSeg) {
|
||||
if (CurrentSegment->Y1Seg == 0)
|
||||
addphcon(ptfig, SOUTH, CurrentSegment->SegName,
|
||||
((CurrentSegment->X1Seg) * PITCH_X),
|
||||
((CurrentSegment->Y1Seg) * PITCH_Y),
|
||||
((char ) ALU2), (LAYER2WIDTH));
|
||||
if (CurrentSegment->Y2Seg == (Height + 1))
|
||||
addphcon(ptfig, NORTH, CurrentSegment->SegName,
|
||||
((CurrentSegment->X2Seg) * PITCH_X),
|
||||
((CurrentSegment->Y2Seg) * PITCH_Y),
|
||||
((char ) ALU2), (LAYER2WIDTH));
|
||||
}
|
||||
|
||||
if (LeadWestList && LeadEastList) {
|
||||
for (CurrentSegment = LeadH_Segment; CurrentSegment;
|
||||
CurrentSegment = CurrentSegment->NextSeg) {
|
||||
if (CurrentSegment->X1Seg == 0)
|
||||
addphcon(ptfig, WEST, CurrentSegment->SegName,
|
||||
((CurrentSegment->X1Seg) * PITCH_X),
|
||||
((CurrentSegment->Y1Seg) * PITCH_Y),
|
||||
((char ) ALU1), (LAYER1WIDTH));
|
||||
if (CurrentSegment->X2Seg == (Width - 1))
|
||||
addphcon(ptfig, EAST, CurrentSegment->SegName,
|
||||
((CurrentSegment->X2Seg) * PITCH_X),
|
||||
((CurrentSegment->Y2Seg) * PITCH_Y),
|
||||
((char ) ALU1), (LAYER1WIDTH));
|
||||
}
|
||||
}
|
||||
else
|
||||
if (LeadWestList) {
|
||||
for (CurrentSegment = LeadH_Segment; CurrentSegment;
|
||||
CurrentSegment = CurrentSegment->NextSeg)
|
||||
if (CurrentSegment->X1Seg == 0)
|
||||
addphcon(ptfig, WEST, CurrentSegment->SegName,
|
||||
((CurrentSegment->X1Seg) * PITCH_X),
|
||||
((CurrentSegment->Y1Seg) * PITCH_Y),
|
||||
((char ) ALU1), (LAYER1WIDTH));
|
||||
}
|
||||
else
|
||||
if (LeadEastList) {
|
||||
for (CurrentSegment = LeadH_Segment; CurrentSegment;
|
||||
CurrentSegment = CurrentSegment->NextSeg)
|
||||
if (CurrentSegment->X2Seg == (Width - 1))
|
||||
addphcon(ptfig, EAST, CurrentSegment->SegName,
|
||||
((CurrentSegment->X2Seg) * PITCH_X),
|
||||
((CurrentSegment->Y2Seg) * PITCH_Y),
|
||||
((char ) ALU1), (LAYER1WIDTH));
|
||||
}
|
||||
|
||||
fprintf(stdout,"Layer1 Length = %ld \n",Layer1Length);
|
||||
fprintf(stdout,"Layer2 Length = %ld \n",Layer2Length);
|
||||
fprintf(stdout,"ViasNumber = %ld \n",ViasNumber);
|
||||
savephfig(ptfig);
|
||||
}
|
||||
/******************************************************************************/
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
extern ConnectorList *U_GetConList();
|
||||
extern void U_Get_NSWE_List();
|
||||
extern void U_PrintList();
|
||||
extern void U_PrintColumn();
|
||||
extern void U_PrintStaticDataBase();
|
||||
extern void U_PrintSegmentList();
|
||||
extern void U_PrintViasList();
|
||||
extern void U_SaveChannel();
|
||||
extern void gscr2mbk();
|
|
@ -0,0 +1,813 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* STANDARD CELLS ROUTER */
|
||||
/* FILE : SymbChanRout.c LAST MODIFICATIOIN : JUL/25/1991 AT 9:23 */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
# include <mut.h>
|
||||
# include <mlo.h>
|
||||
# include <mph.h>
|
||||
# include "gscr_DataBase.h"
|
||||
# include "apr.h"
|
||||
# include "gscr_main.h"
|
||||
# include "gscr_AllowFree.h"
|
||||
# include "gscr_StaticUtil.h"
|
||||
# include "gscr_GreedyRout.h"
|
||||
|
||||
StaticColumn *Lead_NS_Column = NULL;
|
||||
StaticColumn *End_NS_Column = NULL;
|
||||
StaticColumn *LeadEastColumn = NULL;
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
void EliminateOnlyCon(LeadList1,LeadList2,LeadList3,LeadList4)
|
||||
|
||||
ConnectorList **LeadList1;
|
||||
ConnectorList **LeadList2;
|
||||
ConnectorList **LeadList3;
|
||||
ConnectorList **LeadList4;
|
||||
|
||||
{
|
||||
ConnectorList *ptList = NULL;
|
||||
ConnectorList *ptList1 = NULL;
|
||||
ConnectorList *ptList2 = NULL;
|
||||
ConnectorList *ptList3 = NULL;
|
||||
ConnectorList *ptList4 = NULL;
|
||||
ConnectorList *PrevList1 = NULL;
|
||||
ConnectorList *ptEliminate = NULL;
|
||||
long ConName = 0;
|
||||
|
||||
ptList1 = PrevList1 = *LeadList1;
|
||||
while (ptList1) {
|
||||
ConName = ptList1->ConName;
|
||||
for (ptList = *LeadList1; ptList; ptList = ptList->NextCon)
|
||||
if ((ptList != ptList1) && (ConName == ptList->ConName)) break;
|
||||
|
||||
if (ptList == NULL)
|
||||
for (ptList2 = *LeadList2; ptList2; ptList2 = ptList2->NextCon)
|
||||
if (ConName == ptList2->ConName) break;
|
||||
|
||||
if ((ptList == NULL) && (ptList2 == NULL))
|
||||
for (ptList3 = *LeadList3; ptList3; ptList3 = ptList3->NextCon)
|
||||
if (ConName == ptList3->ConName) break;
|
||||
|
||||
if ((ptList == NULL) && (ptList2 == NULL) && (ptList3 == NULL))
|
||||
for (ptList4 = *LeadList4; ptList4; ptList4 = ptList4->NextCon)
|
||||
if (ConName == ptList4->ConName) break;
|
||||
|
||||
if ((ptList == NULL) && (ptList2 == NULL) &&
|
||||
(ptList3 == NULL) && (ptList4 == NULL)) {
|
||||
ptEliminate = ptList1;
|
||||
ptList1 = ptList1->NextCon;
|
||||
if (ptList1 == (*LeadList1)->NextCon) *LeadList1 = ptList1;
|
||||
else if (ptList1 == NULL) PrevList1->NextCon = NULL;
|
||||
else PrevList1->NextCon = ptList1;
|
||||
mbkfree((void *) ptEliminate);
|
||||
}
|
||||
else {
|
||||
PrevList1 = ptList1;
|
||||
ptList1 = ptList1->NextCon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* cette fonction elimine les connecteurs redondant dans la liste */
|
||||
/* EAST et dans la liste WEST. */
|
||||
/******************************************************************************/
|
||||
void SCR_Eliminate(LeadConList)
|
||||
|
||||
ConnectorList **LeadConList;
|
||||
|
||||
{
|
||||
ConnectorList *EliminateCon = NULL;
|
||||
ConnectorList *CurrentCon = NULL;
|
||||
ConnectorList *CurrentConList = NULL;
|
||||
ConnectorList *BeforCurrentConList = NULL;
|
||||
|
||||
if (*LeadConList)
|
||||
for(CurrentCon = *LeadConList; CurrentCon;
|
||||
CurrentCon = CurrentCon->NextCon) {
|
||||
BeforCurrentConList = CurrentCon;
|
||||
CurrentConList = CurrentCon->NextCon;
|
||||
while(CurrentConList)
|
||||
if(CurrentCon->ConName == CurrentConList->ConName) {
|
||||
EliminateCon = CurrentConList;
|
||||
if (CurrentConList->NextCon) {
|
||||
CurrentConList = CurrentConList->NextCon;
|
||||
BeforCurrentConList->NextCon = CurrentConList;
|
||||
}
|
||||
else {
|
||||
CurrentConList = NULL;
|
||||
BeforCurrentConList->NextCon = NULL;
|
||||
}
|
||||
mbkfree(((void *) EliminateCon));
|
||||
}
|
||||
else {
|
||||
CurrentConList = CurrentConList->NextCon;
|
||||
BeforCurrentConList = BeforCurrentConList->NextCon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* CALCUL DE LA NOUVELLE LARGEUR DU CANAL */
|
||||
/******************************************************************************/
|
||||
long SCR_NewChannelWidth(LeadWest, LeadEast, Width)
|
||||
|
||||
ConnectorList *LeadWest;
|
||||
ConnectorList *LeadEast;
|
||||
long Width;
|
||||
|
||||
{
|
||||
ConnectorList *CurrentList = NULL;
|
||||
|
||||
for (CurrentList = LeadWest; CurrentList; Width++,
|
||||
CurrentList = CurrentList->NextCon);
|
||||
for (CurrentList = LeadEast; CurrentList; Width++,
|
||||
CurrentList = CurrentList->NextCon);
|
||||
return(Width);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Creation de la base de donnee du routeur canal symbolique */
|
||||
/******************************************************************************/
|
||||
|
||||
StaticColumn *SCR_LoadStaticColumn(LeadColumn, LeadNorth,LeadSouth,
|
||||
LeadWest, LeadEast, Width)
|
||||
|
||||
StaticColumn *LeadColumn;
|
||||
ConnectorList *LeadNorth;
|
||||
ConnectorList *LeadSouth;
|
||||
ConnectorList *LeadWest;
|
||||
ConnectorList *LeadEast;
|
||||
long Width;
|
||||
|
||||
{
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
ConnectorList *CurrentList = NULL;
|
||||
ConnectorList *CurrentNorthList = NULL;
|
||||
ConnectorList *CurrentSouthList = NULL;
|
||||
long Indice = 0;
|
||||
|
||||
|
||||
|
||||
CurrentColumn = LeadColumn;
|
||||
|
||||
/* Transfert de la liste WEST - si elle n'est pas vide - vers la liste des */
|
||||
/* colonnes */
|
||||
|
||||
if (LeadWest)
|
||||
for (CurrentList = LeadWest; CurrentList;
|
||||
CurrentList = CurrentList->NextCon, CurrentColumn = CurrentColumn->NextCol) {
|
||||
CurrentColumn->NorthCon = CurrentList->ConName;
|
||||
CurrentColumn->SouthCon = 0;
|
||||
}
|
||||
|
||||
/* Transfert de la liste NORTH et SOUTH vers la liste des colonnes */
|
||||
|
||||
|
||||
for (Lead_NS_Column = CurrentColumn, CurrentNorthList = LeadNorth,
|
||||
CurrentSouthList = LeadSouth, Indice = 1; Indice <= Width;
|
||||
CurrentColumn = CurrentColumn->NextCol, Indice++) {
|
||||
if (CurrentNorthList)
|
||||
if (CurrentNorthList->Mark == Indice) {
|
||||
CurrentColumn->NorthCon = CurrentNorthList->ConName;
|
||||
CurrentNorthList = CurrentNorthList->NextCon;
|
||||
}
|
||||
else CurrentColumn->NorthCon = 0;
|
||||
else CurrentColumn->NorthCon = 0;
|
||||
|
||||
if (CurrentSouthList)
|
||||
if (CurrentSouthList->Mark == Indice) {
|
||||
CurrentColumn->SouthCon = CurrentSouthList->ConName;
|
||||
CurrentSouthList = CurrentSouthList->NextCon;
|
||||
}
|
||||
else CurrentColumn->SouthCon = 0;
|
||||
else CurrentColumn->SouthCon = 0;
|
||||
|
||||
End_NS_Column = CurrentColumn;
|
||||
}
|
||||
|
||||
/* Transfert de la liste EAST - si elle n'est pas vide - vers la liste des */
|
||||
/* colonnes en creant au fur et a mesure les colonnes necessaires */
|
||||
|
||||
if (LeadEast)
|
||||
for (CurrentList = LeadEast, LeadEastColumn = CurrentColumn; CurrentList;
|
||||
CurrentList = CurrentList->NextCon, CurrentColumn = CurrentColumn->NextCol) {
|
||||
CurrentColumn->NorthCon = CurrentList->ConName;
|
||||
CurrentColumn->SouthCon = 0;
|
||||
}
|
||||
|
||||
return(LeadColumn);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* BELONG */
|
||||
/******************************************************************************/
|
||||
BOOLEAN SCR_Belong(Element, LeadList, EndList, ControlCon)
|
||||
|
||||
StaticColumn *LeadList;
|
||||
StaticColumn *EndList;
|
||||
long Element;
|
||||
char ControlCon;
|
||||
|
||||
{
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
BOOLEAN Find = FALSE;
|
||||
long ConName = 0;
|
||||
|
||||
CurrentColumn = LeadList;
|
||||
while (CurrentColumn != EndList) {
|
||||
if (ControlCon == 'N') ConName = CurrentColumn->NorthCon;
|
||||
else ConName = CurrentColumn->SouthCon;
|
||||
if (Element == ConName) {
|
||||
Find = TRUE;
|
||||
break;
|
||||
}
|
||||
CurrentColumn = CurrentColumn->NextCol;
|
||||
}
|
||||
return(Find);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* CALCUL DE LA DENSITE DU CANAL */
|
||||
/******************************************************************************/
|
||||
long SCR_ChannelDensity(LeadStaticColumn, Height)
|
||||
|
||||
StaticColumn *LeadStaticColumn;
|
||||
long *Height;
|
||||
|
||||
{
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
StaticColumn *BeforCurrentColumn = NULL;
|
||||
StaticColumn *AfterCurrentColumn = NULL;
|
||||
long BeforCurrentNorthCon = 0;
|
||||
long BeforCurrentSouthCon = 0;
|
||||
long LocalDensity = 0;
|
||||
long Density = 0;
|
||||
|
||||
for (CurrentColumn = Lead_NS_Column; CurrentColumn != LeadEastColumn;
|
||||
CurrentColumn = CurrentColumn->NextCol) {
|
||||
AfterCurrentColumn = CurrentColumn->NextCol;
|
||||
for (BeforCurrentColumn = LeadStaticColumn;
|
||||
BeforCurrentColumn != AfterCurrentColumn;
|
||||
BeforCurrentColumn = BeforCurrentColumn->NextCol) {
|
||||
BeforCurrentNorthCon = BeforCurrentColumn->NorthCon;
|
||||
BeforCurrentSouthCon = BeforCurrentColumn->SouthCon;
|
||||
if (BeforCurrentNorthCon != BeforCurrentSouthCon) {
|
||||
if (BeforCurrentNorthCon != 0)
|
||||
if (!(SCR_Belong(BeforCurrentNorthCon, LeadStaticColumn,
|
||||
BeforCurrentColumn, 'N') ||
|
||||
SCR_Belong(BeforCurrentNorthCon, LeadStaticColumn,
|
||||
BeforCurrentColumn, 'S')))
|
||||
if (SCR_Belong(BeforCurrentNorthCon, CurrentColumn,
|
||||
((StaticColumn *) NULL), 'N') ||
|
||||
SCR_Belong(BeforCurrentNorthCon, CurrentColumn,
|
||||
((StaticColumn *) NULL), 'S'))
|
||||
LocalDensity++;
|
||||
if (BeforCurrentSouthCon != 0)
|
||||
if (!(SCR_Belong(BeforCurrentSouthCon, LeadStaticColumn,
|
||||
BeforCurrentColumn, 'N') ||
|
||||
SCR_Belong(BeforCurrentSouthCon, LeadStaticColumn,
|
||||
BeforCurrentColumn, 'S')))
|
||||
if (SCR_Belong(BeforCurrentSouthCon, CurrentColumn,
|
||||
((StaticColumn *) NULL), 'N') ||
|
||||
SCR_Belong(BeforCurrentSouthCon, CurrentColumn,
|
||||
((StaticColumn *) NULL), 'S'))
|
||||
LocalDensity++;
|
||||
}
|
||||
else if (CurrentColumn != BeforCurrentColumn) {
|
||||
if (BeforCurrentNorthCon != 0)
|
||||
if (!(SCR_Belong(BeforCurrentNorthCon, LeadStaticColumn,
|
||||
BeforCurrentColumn, 'N') ||
|
||||
SCR_Belong(BeforCurrentNorthCon, LeadStaticColumn,
|
||||
BeforCurrentColumn, 'S')))
|
||||
if (SCR_Belong(BeforCurrentNorthCon, CurrentColumn,
|
||||
((StaticColumn *) NULL), 'N') ||
|
||||
SCR_Belong(BeforCurrentNorthCon, CurrentColumn,
|
||||
((StaticColumn *) NULL), 'S'))
|
||||
LocalDensity++;
|
||||
}
|
||||
else
|
||||
if (BeforCurrentNorthCon != 0)
|
||||
if (!(SCR_Belong(BeforCurrentNorthCon, LeadStaticColumn,
|
||||
BeforCurrentColumn, 'N') ||
|
||||
SCR_Belong(BeforCurrentNorthCon, LeadStaticColumn,
|
||||
BeforCurrentColumn, 'S')))
|
||||
if (SCR_Belong(BeforCurrentNorthCon, CurrentColumn->NextCol,
|
||||
((StaticColumn *) NULL), 'N') ||
|
||||
SCR_Belong(BeforCurrentNorthCon, CurrentColumn->NextCol,
|
||||
((StaticColumn *) NULL), 'S'))
|
||||
LocalDensity++;
|
||||
|
||||
}
|
||||
Density = MAX(Density, LocalDensity);
|
||||
LocalDensity = 0;
|
||||
}
|
||||
return((*Height = MAX(Density, *Height)));
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* INSERER UNE NOUVELLE COLONNE */
|
||||
/******************************************************************************/
|
||||
void SCR_InsertNewColumn(EndRealChannel, LeadEastColumn, Density, NumberColumn)
|
||||
|
||||
StaticColumn *EndRealChannel;
|
||||
StaticColumn *LeadEastColumn;
|
||||
long Density;
|
||||
long NumberColumn;
|
||||
|
||||
{
|
||||
StaticColumn *NewSetColumn = NULL;
|
||||
StaticColumn *LeadNewChannel = NULL;
|
||||
StaticColumn *EndNewChannel = NULL;
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
StaticPoint *LeadNewPoint = NULL;
|
||||
StaticPoint *EndNewPoint = NULL;
|
||||
StaticPoint *OldPoint = NULL;
|
||||
StaticPoint *EastPoint = NULL;
|
||||
|
||||
NewSetColumn = SCR_AllowColumn(NumberColumn);
|
||||
LeadNewChannel = SCR_AllowChannel(NewSetColumn, (Density + 2), NumberColumn);
|
||||
for (CurrentColumn = LeadNewChannel; CurrentColumn;
|
||||
CurrentColumn = CurrentColumn->NextCol)
|
||||
EndNewChannel = CurrentColumn;
|
||||
if (LeadEastColumn) {
|
||||
EndNewChannel->NextCol = LeadEastColumn;
|
||||
LeadEastColumn->PrevCol = EndNewChannel;
|
||||
EndRealChannel->NextCol = LeadNewChannel;
|
||||
LeadNewChannel->PrevCol = EndRealChannel;
|
||||
for (OldPoint = EndRealChannel->PointList,
|
||||
EastPoint = LeadEastColumn->PointList,
|
||||
LeadNewPoint = LeadNewChannel->PointList,
|
||||
EndNewPoint = EndNewChannel->PointList; OldPoint;
|
||||
OldPoint = OldPoint->NextPoint,
|
||||
EastPoint = EastPoint->NextPoint,
|
||||
LeadNewPoint = LeadNewPoint->NextPoint,
|
||||
EndNewPoint = EndNewPoint->NextPoint ) {
|
||||
EndNewPoint->RightPoint = EastPoint;
|
||||
OldPoint->RightPoint = LeadNewPoint;
|
||||
}
|
||||
}
|
||||
else {
|
||||
EndRealChannel->NextCol = LeadNewChannel;
|
||||
LeadNewChannel->PrevCol = EndRealChannel;
|
||||
for (OldPoint = EndRealChannel->PointList,
|
||||
LeadNewPoint = LeadNewChannel->PointList; OldPoint;
|
||||
OldPoint = OldPoint->NextPoint,
|
||||
LeadNewPoint = LeadNewPoint->NextPoint )
|
||||
OldPoint->RightPoint = LeadNewPoint;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* INSERER UNE NOUVELLE PISTE */
|
||||
/******************************************************************************/
|
||||
void SCR_InsertNewTrack(LeadDataBase, Position, Width)
|
||||
|
||||
StaticColumn *LeadDataBase;
|
||||
long Position;
|
||||
long Width;
|
||||
|
||||
{
|
||||
StaticPoint *CurrentPoint = NULL;
|
||||
StaticPoint *NextCurrentPoint = NULL;
|
||||
StaticPoint *NewTrack = NULL;
|
||||
long Counter = 1;
|
||||
|
||||
for (CurrentPoint = LeadDataBase->PointList; Counter < Position; Counter++,
|
||||
CurrentPoint = CurrentPoint->NextPoint);
|
||||
NewTrack = SCR_AllowOneTrack(Width);
|
||||
for (NextCurrentPoint = CurrentPoint->NextPoint; CurrentPoint;
|
||||
CurrentPoint = CurrentPoint->RightPoint,
|
||||
NextCurrentPoint = NextCurrentPoint->RightPoint,
|
||||
NewTrack = NewTrack->RightPoint) {
|
||||
NewTrack->NextPoint = NextCurrentPoint;
|
||||
CurrentPoint->NextPoint = NewTrack;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* POST TREATMENT OF THE WEST CONNECTORS */
|
||||
/******************************************************************************/
|
||||
StaticColumn *SCR_WestPostAnalysis(Lead_NS_Column, LeadWestCon, Density)
|
||||
|
||||
StaticColumn *Lead_NS_Column;
|
||||
ConnectorList *LeadWestCon;
|
||||
long Density;
|
||||
|
||||
{
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
StaticColumn *EndWestColumn = NULL;
|
||||
StaticPoint *CurrentPoint = NULL;
|
||||
StaticPoint *PointList = NULL;
|
||||
ConnectorList *CurrentList = NULL;
|
||||
long TrackCounter = 0;
|
||||
long Counter;
|
||||
|
||||
EndWestColumn = Lead_NS_Column->PrevCol;
|
||||
EndWestColumn->PointList->Via = FALSE;
|
||||
EndWestColumn->PointList->Layer1 = NOP;
|
||||
EndWestColumn->PointList->Layer2 = NOP;
|
||||
for (CurrentColumn = EndWestColumn; CurrentColumn;
|
||||
CurrentColumn = CurrentColumn->PrevCol) {
|
||||
for (TrackCounter = Density,
|
||||
CurrentPoint = CurrentColumn->PointList->NextPoint;
|
||||
((CurrentPoint) && (CurrentPoint->Layer1 != RIGHT));
|
||||
CurrentPoint = CurrentPoint->NextPoint, TrackCounter--);
|
||||
for (Counter = Density, PointList = EndWestColumn->PointList->NextPoint;
|
||||
Counter > TrackCounter; PointList = PointList->NextPoint, Counter--);
|
||||
PointList->Via = FALSE;
|
||||
PointList->Layer1 = RIGHT;
|
||||
PointList->Layer2 = NOP;
|
||||
for (CurrentList = LeadWestCon;
|
||||
CurrentList->ConName != CurrentPoint->PointName;
|
||||
CurrentList = CurrentList->NextCon);
|
||||
CurrentList->Mark = TrackCounter;
|
||||
}
|
||||
return (EndWestColumn);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* POST TREATMENT OF THE EAST CONNECTORS */
|
||||
/******************************************************************************/
|
||||
StaticColumn *SCR_EastPostAnalysis(LeadEastColumn, LeadEastCon, Density)
|
||||
|
||||
StaticColumn *LeadEastColumn;
|
||||
ConnectorList *LeadEastCon;
|
||||
long Density;
|
||||
|
||||
{
|
||||
StaticColumn *CurrentColumn = NULL;
|
||||
StaticPoint *CurrentPoint = NULL;
|
||||
StaticPoint *CurrentEastPoint = NULL;
|
||||
StaticPoint *EastPoint = NULL;
|
||||
ConnectorList *CurrentList = NULL;
|
||||
long TrackCounter = 0;
|
||||
BOOLEAN NetNotTreated = TRUE;
|
||||
BOOLEAN FirstColumn = TRUE;
|
||||
|
||||
LeadEastColumn->PointList->Via = FALSE;
|
||||
LeadEastColumn->PointList->Layer1 = NOP;
|
||||
LeadEastColumn->PointList->Layer2 = NOP;
|
||||
|
||||
for (CurrentColumn = LeadEastColumn; CurrentColumn;
|
||||
CurrentColumn = CurrentColumn->NextCol) {
|
||||
|
||||
for (TrackCounter = Density,
|
||||
CurrentPoint = CurrentColumn->PointList->NextPoint,
|
||||
CurrentEastPoint = LeadEastColumn->PointList->NextPoint; CurrentPoint;
|
||||
CurrentEastPoint = CurrentEastPoint->NextPoint,
|
||||
CurrentPoint = CurrentPoint->NextPoint, TrackCounter--) {
|
||||
if (CurrentPoint->Layer1 == LEFT) {
|
||||
NetNotTreated = TRUE;
|
||||
if (FirstColumn) {
|
||||
for (CurrentList = LeadEastCon;
|
||||
CurrentList->ConName != CurrentPoint->PointName;
|
||||
CurrentList = CurrentList->NextCon);
|
||||
CurrentList->Mark = TrackCounter;
|
||||
}
|
||||
else {
|
||||
for (EastPoint = LeadEastColumn->PointList->NextPoint; EastPoint;
|
||||
EastPoint = EastPoint->NextPoint)
|
||||
if (EastPoint->PointName == CurrentPoint->PointName) {
|
||||
NetNotTreated = FALSE;
|
||||
break;
|
||||
}
|
||||
if (NetNotTreated) {
|
||||
CurrentEastPoint->PointName = CurrentPoint->PointName;
|
||||
CurrentEastPoint->Layer1 = LEFT;
|
||||
for (CurrentList = LeadEastCon;
|
||||
CurrentList->ConName != CurrentPoint->PointName;
|
||||
CurrentList = CurrentList->NextCon);
|
||||
CurrentList->Mark = TrackCounter;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (CurrentEastPoint->Layer1 != LEFT) {
|
||||
CurrentEastPoint->PointName = ((long ) 0);
|
||||
CurrentEastPoint->Layer1 = NOP;
|
||||
}
|
||||
CurrentEastPoint->Via = FALSE;
|
||||
CurrentEastPoint->Layer2 = NOP;
|
||||
}
|
||||
FirstColumn = FALSE;
|
||||
}
|
||||
return (LeadEastColumn);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* SAUVEGARDE DU RESULTAT DE ROUTAGE */
|
||||
/******************************************************************************/
|
||||
void SCR_SaveResult(
|
||||
LeadDataBase, EndDataBase, LeadH_Segment,
|
||||
LeadV_Segment, LeadVia, Density, LeadWestCon
|
||||
)
|
||||
|
||||
StaticColumn *LeadDataBase;
|
||||
StaticColumn *EndDataBase;
|
||||
SegmentList **LeadH_Segment;
|
||||
SegmentList **LeadV_Segment;
|
||||
ViasList **LeadVia;
|
||||
long Density;
|
||||
ConnectorList *LeadWestCon;
|
||||
|
||||
{
|
||||
StaticColumn *CurrentColumnList = NULL;
|
||||
StaticPoint *CurrentPoint = NULL;
|
||||
StaticPoint *RightCurrentPoint = NULL;
|
||||
StaticPoint *NextCurrentPoint = NULL;
|
||||
SegmentList *CurrentH_Segment = NULL;
|
||||
SegmentList *CurrentV_Segment = NULL;
|
||||
ViasList *CurrentVia = NULL;
|
||||
SegmentList *BeforCurrentH_Seg = NULL;
|
||||
SegmentList *BeforCurrentV_Seg = NULL;
|
||||
ViasList *BeforCurrentVia = NULL;
|
||||
long CounterTrack = 0;
|
||||
long Counter = 0;
|
||||
long CounterColumn = 0;
|
||||
BOOLEAN FirstVia = TRUE;
|
||||
BOOLEAN FirstH_Segment = TRUE;
|
||||
BOOLEAN FirstV_Segment = TRUE;
|
||||
char NodeName[15];
|
||||
char Buffer[10];
|
||||
|
||||
if (LeadWestCon) CounterColumn = 0;
|
||||
else CounterColumn = 1;
|
||||
for (CurrentColumnList = LeadDataBase; (CurrentColumnList != EndDataBase);
|
||||
CurrentColumnList = CurrentColumnList->NextCol, CounterColumn++)
|
||||
for (CurrentPoint = CurrentColumnList->PointList,
|
||||
CounterTrack = (Density + 1); CurrentPoint;
|
||||
CurrentPoint = CurrentPoint->NextPoint, CounterTrack--) {
|
||||
|
||||
sprintf(Buffer,"%ld",CurrentPoint->PointName);
|
||||
strcpy(NodeName,"Seg_");
|
||||
strcat(NodeName,Buffer);
|
||||
|
||||
if (CurrentPoint->Via) {
|
||||
if (FirstVia) {
|
||||
*LeadVia = BeforCurrentVia = SCR_AllowViasList();
|
||||
BeforCurrentVia->XVia = CounterColumn;
|
||||
BeforCurrentVia->YVia = CounterTrack;
|
||||
FirstVia = FALSE;
|
||||
}
|
||||
else {
|
||||
CurrentVia = SCR_AllowViasList();
|
||||
BeforCurrentVia->NextVia = CurrentVia;
|
||||
CurrentVia->XVia = CounterColumn;
|
||||
CurrentVia->YVia = CounterTrack;
|
||||
BeforCurrentVia = CurrentVia;
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentPoint->Layer1 == RIGHT) {
|
||||
if (FirstH_Segment) {
|
||||
*LeadH_Segment = BeforCurrentH_Seg = SCR_AllowSegmentList();
|
||||
BeforCurrentH_Seg->SegName = namealloc(NodeName);
|
||||
BeforCurrentH_Seg->X1Seg = CounterColumn;
|
||||
BeforCurrentH_Seg->Y1Seg = BeforCurrentH_Seg->Y2Seg = CounterTrack;
|
||||
for (Counter = CounterColumn, RightCurrentPoint = CurrentPoint->RightPoint;
|
||||
((RightCurrentPoint) && (RightCurrentPoint->Layer1 != LEFT));
|
||||
RightCurrentPoint = RightCurrentPoint->RightPoint, Counter++);
|
||||
BeforCurrentH_Seg->X2Seg = ++Counter;
|
||||
FirstH_Segment = FALSE;
|
||||
}
|
||||
else {
|
||||
CurrentH_Segment = SCR_AllowSegmentList();
|
||||
BeforCurrentH_Seg->NextSeg = CurrentH_Segment;
|
||||
CurrentH_Segment->SegName = namealloc(NodeName);
|
||||
CurrentH_Segment->X1Seg = CounterColumn;
|
||||
CurrentH_Segment->Y1Seg = CurrentH_Segment->Y2Seg = CounterTrack;
|
||||
for (Counter = CounterColumn, RightCurrentPoint = CurrentPoint->RightPoint;
|
||||
((RightCurrentPoint) && (RightCurrentPoint->Layer1 != LEFT));
|
||||
RightCurrentPoint = RightCurrentPoint->RightPoint, Counter++);
|
||||
CurrentH_Segment->X2Seg = ++Counter;
|
||||
BeforCurrentH_Seg = CurrentH_Segment;
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentPoint->Layer2 == DOWN) {
|
||||
if (FirstV_Segment) {
|
||||
*LeadV_Segment = BeforCurrentV_Seg = SCR_AllowSegmentList();
|
||||
BeforCurrentV_Seg->SegName = namealloc(NodeName);
|
||||
BeforCurrentV_Seg->X1Seg = BeforCurrentV_Seg->X2Seg = CounterColumn;
|
||||
BeforCurrentV_Seg->Y2Seg = CounterTrack;
|
||||
for (Counter = CounterTrack, NextCurrentPoint = CurrentPoint->NextPoint;
|
||||
((NextCurrentPoint) && (NextCurrentPoint->Layer2 != UP));
|
||||
NextCurrentPoint = NextCurrentPoint->NextPoint, Counter--);
|
||||
BeforCurrentV_Seg->Y1Seg = --Counter;
|
||||
FirstV_Segment = FALSE;
|
||||
}
|
||||
else {
|
||||
CurrentV_Segment = SCR_AllowSegmentList();
|
||||
BeforCurrentV_Seg->NextSeg = CurrentV_Segment;
|
||||
CurrentV_Segment->SegName = namealloc(NodeName);
|
||||
CurrentV_Segment->X1Seg = CurrentV_Segment->X2Seg = CounterColumn;
|
||||
CurrentV_Segment->Y2Seg = CounterTrack;
|
||||
for (Counter = CounterTrack, NextCurrentPoint = CurrentPoint->NextPoint;
|
||||
((NextCurrentPoint) && (NextCurrentPoint->Layer2 != UP));
|
||||
NextCurrentPoint = NextCurrentPoint->NextPoint, Counter--);
|
||||
CurrentV_Segment->Y1Seg = --Counter;
|
||||
BeforCurrentV_Seg = CurrentV_Segment;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* SYMBOLIC CHANNEL ROUTER */
|
||||
/******************************************************************************/
|
||||
BOOLEAN SymbolicChannelRouter(
|
||||
LeadNorthCon, LeadSouthCon,
|
||||
LeadWestCon, LeadEastCon,
|
||||
ChannelWidth, ChannelHeight,
|
||||
LeadH_Segment, LeadV_Segment, LeadVia
|
||||
)
|
||||
|
||||
ConnectorList **LeadNorthCon;
|
||||
ConnectorList **LeadSouthCon;
|
||||
ConnectorList **LeadWestCon;
|
||||
ConnectorList **LeadEastCon;
|
||||
long *ChannelWidth;
|
||||
long *ChannelHeight;
|
||||
SegmentList **LeadH_Segment;
|
||||
SegmentList **LeadV_Segment;
|
||||
ViasList **LeadVia;
|
||||
|
||||
{
|
||||
long OldChannelWidth = 0;
|
||||
long NewChannelWidth = 0;
|
||||
long ChannelDensity = 0;
|
||||
StaticColumn *LeadStaticColumn = NULL;
|
||||
StaticColumn *LeadColumnList = NULL;
|
||||
StaticColumn *LeadStaticDataBase = NULL;
|
||||
StaticColumn *LeadRealChannel = NULL;
|
||||
StaticColumn *EndRealChannel = NULL;
|
||||
BOOLEAN Change = FALSE;
|
||||
|
||||
Lead_NS_Column = NULL;
|
||||
End_NS_Column = NULL;
|
||||
LeadEastColumn = NULL;
|
||||
OldChannelWidth = *ChannelWidth;
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"Befor elimination : \n");
|
||||
fprintf(stderr,"Northlist : \n");
|
||||
U_PrintList(*LeadNorthCon);
|
||||
fprintf(stderr,"Southlist : \n");
|
||||
U_PrintList(*LeadSouthCon);
|
||||
fprintf(stderr,"Westlist : \n");
|
||||
U_PrintList(*LeadWestCon);
|
||||
fprintf(stderr,"Eastlist : \n");
|
||||
U_PrintList(*LeadEastCon);
|
||||
# endif
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"Eliminate a Multiply Connector on West Edge if necessary \n");
|
||||
# endif
|
||||
|
||||
if (LeadWestCon) SCR_Eliminate(LeadWestCon);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"Eliminate a Multiply Connector on East Edge if necessary \n");
|
||||
# endif
|
||||
|
||||
if (LeadEastCon) SCR_Eliminate(LeadEastCon);
|
||||
|
||||
EliminateOnlyCon(LeadNorthCon,LeadSouthCon,LeadWestCon,LeadEastCon);
|
||||
EliminateOnlyCon(LeadSouthCon,LeadNorthCon,LeadWestCon,LeadEastCon);
|
||||
if (LeadWestCon) EliminateOnlyCon(LeadWestCon,LeadNorthCon,LeadSouthCon,LeadEastCon);
|
||||
if (LeadEastCon) EliminateOnlyCon(LeadEastCon,LeadNorthCon,LeadSouthCon,LeadWestCon);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"After elimination : \n");
|
||||
fprintf(stderr,"Northlist : \n");
|
||||
U_PrintList(*LeadNorthCon);
|
||||
fprintf(stderr,"Southlist : \n");
|
||||
U_PrintList(*LeadSouthCon);
|
||||
fprintf(stderr,"Westlist : \n");
|
||||
U_PrintList(*LeadWestCon);
|
||||
fprintf(stderr,"Eastlist : \n");
|
||||
U_PrintList(*LeadEastCon);
|
||||
# endif
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"Computing a New Channel Width \n");
|
||||
# endif
|
||||
|
||||
NewChannelWidth = SCR_NewChannelWidth(*LeadWestCon,*LeadEastCon,*ChannelWidth);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"Allow Static Column \n");
|
||||
# endif
|
||||
|
||||
LeadStaticColumn = SCR_AllowColumn(NewChannelWidth);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"Loading Static Data Base \n");
|
||||
# endif
|
||||
|
||||
LeadColumnList = SCR_LoadStaticColumn(LeadStaticColumn,
|
||||
*LeadNorthCon,*LeadSouthCon,
|
||||
*LeadWestCon,*LeadEastCon,
|
||||
OldChannelWidth);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"Column Static Data Base \n");
|
||||
U_PrintColumn(LeadColumnList);
|
||||
fprintf(stderr,"Computing Channel Density \n");
|
||||
# endif
|
||||
|
||||
ChannelDensity = SCR_ChannelDensity(LeadColumnList, ChannelHeight);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"Channel Density = %ld \n", ChannelDensity);
|
||||
fprintf(stderr,"Allow Memory of a Channel \n");
|
||||
# endif
|
||||
|
||||
LeadStaticDataBase = SCR_AllowChannel( LeadColumnList, ChannelDensity + 2,
|
||||
NewChannelWidth);
|
||||
|
||||
LeadRealChannel = LeadStaticDataBase;
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"U_PrintStaticDataBase Befor Routing\n");
|
||||
U_PrintStaticDataBase(LeadStaticDataBase);
|
||||
fprintf(stderr,"Greedy Router \n");
|
||||
# endif
|
||||
|
||||
*ChannelWidth = OldChannelWidth;
|
||||
SCR_GreedyRouter( LeadStaticDataBase, End_NS_Column, LeadEastColumn,
|
||||
&ChannelDensity, NewChannelWidth, ChannelWidth);
|
||||
|
||||
*ChannelHeight = ChannelDensity;
|
||||
|
||||
if (OldChannelWidth != *ChannelWidth) Change = TRUE;
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"ChannelDensity = %ld \n", ChannelDensity);
|
||||
fprintf(stderr,"U_PrintStaticDataBase \n");
|
||||
U_PrintStaticDataBase(LeadStaticDataBase);
|
||||
# endif
|
||||
|
||||
if (*LeadWestCon) {
|
||||
LeadRealChannel = SCR_WestPostAnalysis( Lead_NS_Column,*LeadWestCon,
|
||||
ChannelDensity);
|
||||
}
|
||||
|
||||
if (*LeadEastCon) {
|
||||
EndRealChannel = SCR_EastPostAnalysis( LeadEastColumn,*LeadEastCon,
|
||||
ChannelDensity );
|
||||
}
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"U_PrintStaticDataBase \n");
|
||||
U_PrintStaticDataBase(LeadRealChannel);
|
||||
fprintf(stderr,"Saving a Channel Router Result \n");
|
||||
# endif
|
||||
|
||||
SCR_SaveResult(LeadRealChannel, EndRealChannel, LeadH_Segment,
|
||||
LeadV_Segment, LeadVia, ChannelDensity,*LeadWestCon);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"Print Horizontal Segment : \n");
|
||||
U_PrintSegmentList(*LeadH_Segment);
|
||||
fprintf(stderr,"Print Vertical Segment : \n");
|
||||
U_PrintSegmentList(*LeadV_Segment);
|
||||
fprintf(stderr,"Print Via List : \n");
|
||||
U_PrintViasList(*LeadVia);
|
||||
fprintf(stderr,"Free of Memory \n");
|
||||
# endif
|
||||
|
||||
SCR_FreeDataBase(LeadStaticDataBase);
|
||||
|
||||
return (Change);
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
extern void SCR_Eliminate();
|
||||
extern long SCR_NewChannelWidth();
|
||||
extern StaticColumn *SCR_LoadStaticColumn();
|
||||
extern BOOLEAN SCR_Belong();
|
||||
extern long SCR_ChannelDensity();
|
||||
extern void SCR_InsertNewColumn();
|
||||
extern void SCR_InsertNewTrack();
|
||||
extern void SCR_GreedyRouter();
|
||||
extern StaticColumn *SCR_WestEastPostAnalysis();
|
||||
extern void SCR_SaveResult();
|
||||
extern BOOLEAN SymbolicChannelRouter();
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
# define IMPAIRE(a) (((a) & 1) ? TRUE : FALSE)
|
||||
# define JOG_LENGTH(a) ((long ) (IMPAIRE(a) ? ((a+1) >> 2) : ((a) >> 2)))
|
||||
# define MINJOG_LENGTH ((long ) 1)
|
||||
# define LEADPATTERN 6
|
||||
extern long EndPattern;
|
||||
long TabRout[MAXCOL][MAXLINE];
|
||||
|
||||
BOOLEAN TOPNOTROUT, BOTNOTROUT;
|
||||
|
||||
#define PREVHNET(I) TabRout[0][I]
|
||||
#define HNET(I) TabRout[1][I]
|
||||
#define SPLIT(I) TabRout[2][I]
|
||||
#define SFRT(I) TabRout[3][I]
|
||||
#define WEIGHT(I) TabRout[4][I]
|
||||
#define VNET(I) TabRout[5][I]
|
||||
#define COMBI(I,J) TabRout[I][J]
|
||||
#define SCR_TOP TabRout[1][0]
|
||||
#define SCR_BOTTOM(I) TabRout[1][I]
|
||||
|
||||
#define SNC ((long ) 1000)
|
||||
#define TERMINAL ((long ) 0)
|
||||
#define NOTTERMINAL ((long ) 1)
|
||||
#define STEADY ((long ) 2)
|
||||
#define FALLING ((long ) 3)
|
||||
#define RISING ((long ) 4)
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* Cette fonction est provisoire, elle fait just appel a la fonction routeur */
|
||||
/******************************************************************************/
|
||||
|
||||
# include <stdio.h>
|
||||
# include "apr.h"
|
||||
# include "gscr_DataBase.h"
|
||||
# include "gscr_StaticUtil.h"
|
||||
# include "gscr_SymbChanRout.h"
|
||||
|
||||
main(argc,argv)
|
||||
|
||||
int argc;
|
||||
char *argv[];
|
||||
|
||||
{
|
||||
ConnectorList *LeadNorthList = NULL;
|
||||
ConnectorList *LeadSouthList = NULL;
|
||||
ConnectorList *LeadWestList = NULL;
|
||||
ConnectorList *LeadEastList = NULL;
|
||||
SegmentList *LeadH_Segment = NULL;
|
||||
SegmentList *LeadV_Segment = NULL;
|
||||
ViasList *LeadViaList = NULL;
|
||||
long ChannelWidth = 0;
|
||||
long ChannelHeight = 0;
|
||||
BOOLEAN Change = FALSE;
|
||||
|
||||
mbkenv();
|
||||
if (argc == 1) fprintf(stdout,"Erreur manque du nom de fichier \n");
|
||||
else {
|
||||
U_GetChannel(argv[1], &LeadNorthList, &LeadSouthList,
|
||||
&LeadWestList, &LeadEastList);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stdout,"Northlist : \n");
|
||||
U_PrintList(LeadNorthList);
|
||||
fprintf(stdout,"Southlist : \n");
|
||||
U_PrintList(LeadSouthList);
|
||||
fprintf(stdout,"Westlist : \n");
|
||||
U_PrintList(LeadWestList);
|
||||
fprintf(stdout,"Eastlist : \n");
|
||||
U_PrintList(LeadEastList);
|
||||
# endif
|
||||
|
||||
ChannelWidth = U_ChannelWidth(LeadNorthList, LeadSouthList);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stdout,"ChannelWidth = %ld \n",ChannelWidth);
|
||||
# endif
|
||||
|
||||
Change = SymbolicChannelRouter(LeadNorthList,LeadSouthList, LeadWestList,
|
||||
LeadEastList, &ChannelWidth, &ChannelHeight,
|
||||
&LeadH_Segment, &LeadV_Segment, &LeadViaList);
|
||||
|
||||
gscr2mbk(argv[2],LeadH_Segment,LeadV_Segment,LeadViaList,
|
||||
LeadNorthList,LeadSouthList,LeadWestList,
|
||||
LeadEastList,ChannelWidth,ChannelHeight);
|
||||
|
||||
if (LeadH_Segment) SCR_FreeSegmentList(LeadH_Segment);
|
||||
if (LeadV_Segment) SCR_FreeSegmentList(LeadV_Segment);
|
||||
if (LeadViaList) SCR_FreeViasList(LeadViaList);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stdout,"ChannelWidth = %ld \n",ChannelWidth);
|
||||
fprintf(stdout,"ChannelHeight = %ld \n",ChannelHeight);
|
||||
fprintf(stdout,"NorthList : \n");
|
||||
U_PrintList(LeadNorthList);
|
||||
fprintf(stdout,"SouthList : \n");
|
||||
U_PrintList(LeadSouthList);
|
||||
fprintf(stdout,"Westlist : \n");
|
||||
U_PrintList(LeadWestList);
|
||||
fprintf(stdout,"Eastlist : \n");
|
||||
U_PrintList(LeadEastList);
|
||||
# endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
extern ConnectorList *LeadNorthList;
|
||||
extern ConnectorList *LeadSouthList;
|
||||
extern ConnectorList *LeadWestList;
|
||||
extern ConnectorList *LeadEastList;
|
|
@ -0,0 +1,178 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_channel.c */
|
||||
/* Contents : main of placer */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Xavier Picat Date : 21/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les includes
|
||||
\---------------------------------------------------------*/
|
||||
#include "scp_channel.h"
|
||||
extern int SXMODE;
|
||||
# define PITCH_X ((long )((SXMODE ? 5:6) * SCALE_X))
|
||||
/*---------------------------------------------------------\
|
||||
Les definitions de type
|
||||
\---------------------------------------------------------*/
|
||||
typedef struct cells
|
||||
{
|
||||
struct cells *NEXT;
|
||||
phins_list *INS;
|
||||
} cells_list;
|
||||
#define min(x,y) ((x<y)?(x):(y))
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
OpenVerticalChannel
|
||||
|
||||
L'abscisse, Epsilon et Largeur sont un multiples de SCALE_X
|
||||
\---------------------------------------------------------*/
|
||||
phfig_list *OpenVerticalChannel (Figure, Abscisse, Epsilon, Largeur)
|
||||
phfig_list *Figure;
|
||||
unsigned long Abscisse;
|
||||
unsigned long Epsilon;
|
||||
unsigned long Largeur;
|
||||
{
|
||||
cells_list **Rows, **List;
|
||||
phins_list *Ins;
|
||||
phfig_list *Fig;
|
||||
cells_list *Cell, *Current, *Previous;
|
||||
long Height;
|
||||
long NbRow;
|
||||
long Row;
|
||||
long X, i;
|
||||
long XOpen, MinCost;
|
||||
long Ox, Oy;
|
||||
long NbCells;
|
||||
long iCell;
|
||||
cells_list *CellTab;
|
||||
|
||||
if (Figure == NULL || Figure->PHINS == NULL)
|
||||
return (NULL);
|
||||
if (Abscisse % PITCH_X ||
|
||||
Epsilon % PITCH_X ||
|
||||
Largeur % PITCH_X)
|
||||
{
|
||||
fprintf (stderr, "X(%d), Width(%d), Epsilon(%d) MUST be PITCHED\n", Abscisse, Largeur, Epsilon);
|
||||
exit (1);
|
||||
}
|
||||
Abscisse += Figure->XAB1;
|
||||
Oy = Figure->YAB1;
|
||||
Fig = getphfig(Figure->PHINS->FIGNAME,'A');
|
||||
sx2sc (Fig);
|
||||
Height = Fig->YAB2 - Fig->YAB1;
|
||||
if (Epsilon + Abscisse > Figure->XAB2 ||
|
||||
Epsilon - Abscisse <= Figure->XAB1)
|
||||
Epsilon = 0;
|
||||
|
||||
/* on commence par calculer le nombre de lignes qu'occupe la figure */
|
||||
NbCells = 0;
|
||||
NbRow = 0;
|
||||
for (Ins = Figure->PHINS; Ins; Ins=Ins->NEXT)
|
||||
{
|
||||
NbCells++;
|
||||
Row = (Ins->YINS - Oy) / Height;
|
||||
if (Row > NbRow)
|
||||
NbRow = Row;
|
||||
}
|
||||
NbRow++; /* la ligne 0 existe : 0 a 3 donne 4 lignes */
|
||||
|
||||
/* on remplit la structure rows */
|
||||
Rows = (cells_list **) mbkalloc (sizeof (cells_list *) * NbRow);
|
||||
memset (Rows, 0, sizeof (cells_list *) * NbRow);
|
||||
List = (cells_list **) mbkalloc (sizeof (cells_list *) * NbRow);
|
||||
CellTab = (cells_list *) mbkalloc (sizeof (cells_list) * NbCells);
|
||||
memset (CellTab, 0, sizeof (cells_list) * NbCells);
|
||||
iCell = 0;
|
||||
for (Ins = Figure->PHINS; Ins; Ins=Ins->NEXT, iCell++)
|
||||
{
|
||||
Row = (Ins->YINS - Oy) / Height;
|
||||
X = Ins->XINS;
|
||||
Cell = &CellTab[iCell];
|
||||
Cell->INS = Ins;
|
||||
Fig = getphfig (Ins->FIGNAME,'A');
|
||||
sx2sc (Fig);
|
||||
Previous = (cells_list *)&Rows[Row];
|
||||
for (Current = Rows[Row]; Current && X > Current->INS->XINS; Previous = Current, Current = Current->NEXT);
|
||||
Cell->NEXT = Current;
|
||||
Previous->NEXT = Cell;
|
||||
}
|
||||
|
||||
/* on recherche l'abscisse optimale */
|
||||
XOpen = Abscisse - Epsilon;
|
||||
MinCost = 1<<30;
|
||||
for (X = XOpen; X <= Abscisse + Epsilon; X+=PITCH_X)
|
||||
{
|
||||
long Left, Right, Cost;
|
||||
|
||||
Left = 1<<30;
|
||||
Right = 0;
|
||||
Cost = 0;
|
||||
for (i=0; i<NbRow; i++)
|
||||
{
|
||||
Previous = NULL;
|
||||
for (Cell = Rows[i]; Cell && Cell->INS->XINS < X; Previous = Cell, Cell = Cell->NEXT);
|
||||
if (Previous)
|
||||
{
|
||||
if (Previous->INS->XINS < Left)
|
||||
Left = Previous->INS->XINS;
|
||||
if (Previous->INS->XINS > Right)
|
||||
Right = Previous->INS->XINS;
|
||||
}
|
||||
if (Right - Left > Cost)
|
||||
Cost = Right - Left;
|
||||
}
|
||||
if (MinCost > Cost &&
|
||||
abs(XOpen-Abscisse) >= abs(X-Abscisse))
|
||||
{
|
||||
MinCost = Cost;
|
||||
XOpen = X;
|
||||
}
|
||||
}
|
||||
|
||||
X = MinCost + Largeur;
|
||||
if (X%PITCH_X)
|
||||
X += PITCH_X - X % PITCH_X;
|
||||
for (i=0; i<NbRow; i++)
|
||||
{
|
||||
Previous = NULL;
|
||||
for (Cell = Rows[i]; Cell && Cell->INS->XINS < XOpen; Previous = Cell, Cell = Cell->NEXT);
|
||||
for (Cell = Previous; Cell; Cell = Cell->NEXT)
|
||||
Cell->INS->XINS += X;
|
||||
}
|
||||
Figure->XAB2 += X;
|
||||
mbkfree (CellTab);
|
||||
mbkfree (Rows);
|
||||
mbkfree (List);
|
||||
} /* fin de OpenVerticalChannel */
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_channel.h */
|
||||
/* Contents : prototypes du parser */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Xavier Picat Date : 09/08/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef SCP_CHANNEL
|
||||
#define SCP_CHANNEL
|
||||
/*---------------------------------------------------------\
|
||||
Les includes
|
||||
\---------------------------------------------------------*/
|
||||
#include <mut.h>
|
||||
#include <mlo.h>
|
||||
#include <mph.h>
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Prototypes
|
||||
\---------------------------------------------------------*/
|
||||
extern phfig_list *OpenVerticalChannel ();
|
||||
|
||||
#endif /* SCP_CHANNEL */
|
|
@ -0,0 +1,346 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_inits.c */
|
||||
/* Contents : fonctions d'initialisation */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Pierre Fedrichkine Date : 02/07/1993 */
|
||||
/* Modified by : Xavier Picat Date : 08/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
#include <mut.h>
|
||||
#include <mlo.h>
|
||||
#include <mph.h>
|
||||
#include "scp_types.h"
|
||||
#include "scp_main.h"
|
||||
#include "scp_mbk2scp.h"
|
||||
#include "scp_inits.h"
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les prototypes
|
||||
\---------------------------------------------------------*/
|
||||
static void InsereConnecteur ();
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les variables globales
|
||||
\---------------------------------------------------------*/
|
||||
long NombreLignes;
|
||||
long LargeurIdeale;
|
||||
long Norme;
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
initialisation
|
||||
\---------------------------------------------------------*/
|
||||
void initialisation(WeightRow,nbrow,WHratio)
|
||||
int WeightRow;
|
||||
int nbrow;
|
||||
int WHratio;
|
||||
{
|
||||
long NombreLignesIdeal, NormeLignesIdeal;
|
||||
long NormeBandes, NormeCellules;
|
||||
|
||||
/* on considere que pour une bande de hauteur n, la hauteur du canal
|
||||
* de routage est egale a 2.5*n d'ou le /3.5 -> 99/23/9 WHratio
|
||||
*/
|
||||
if (WHratio==0) WHratio=100;
|
||||
NombreLignesIdeal = (int)(sqrt((float)LargeurTotale/(3 * (float)Hauteur * WHratio/100)));
|
||||
NormeLignesIdeal = (int)(sqrt((float)NombreCellules)/2);
|
||||
if (NombreLignesIdeal == 0)
|
||||
NombreLignesIdeal++;
|
||||
if (NormeLignesIdeal == 0)
|
||||
NormeLignesIdeal++;
|
||||
NombreLignes = (nbrow == 0) ? NombreLignesIdeal : nbrow;
|
||||
|
||||
LargeurIdeale = LargeurTotale / NombreLignes;
|
||||
fprintf(stderr,"Original width : %ld\n", LargeurIdeale);
|
||||
NormeBandes = 1;
|
||||
if (NombreLignes < (NormeLignesIdeal >> 1))
|
||||
NormeBandes = -((NombreLignes << 3) / NormeLignesIdeal) + 5;
|
||||
else if (NombreLignes > (NormeLignesIdeal << 1))
|
||||
NormeBandes = ((NombreLignes << 1) / NormeLignesIdeal) - 3;
|
||||
|
||||
NormeCellules = FLOAT_TO_LONG;
|
||||
if (NombreCellules > 100)
|
||||
{
|
||||
NormeCellules *= NombreCellules;
|
||||
NormeCellules /= 350;
|
||||
NormeCellules += 0.71 * FLOAT_TO_LONG;
|
||||
}
|
||||
Norme = NormeCellules * NormeBandes * WeightRow;
|
||||
|
||||
Rows = (row_elt *) mbkalloc (sizeof (row_elt) * NombreLignes);
|
||||
memset (Rows, 0, sizeof (row_elt) * NombreLignes);
|
||||
} /* fin de initialisation */
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
generation_configuration_initiale
|
||||
|
||||
fonction realisant le placement initial aleatoire
|
||||
\---------------------------------------------------------*/
|
||||
void generation_configuration_initiale(ptlofig, Connectors, WeightCon, WeightY)
|
||||
lofig_list *ptlofig;
|
||||
PlaceConList *Connectors;
|
||||
long WeightCon;
|
||||
long WeightY;
|
||||
{
|
||||
CaracConList *Con;
|
||||
int nLigne;
|
||||
int iCell; /* indice de cellule */
|
||||
int iRow; /* indice de collonne */
|
||||
int iCol; /* indice de colonne */
|
||||
long iPos; /* indice de position */
|
||||
int up = 1;
|
||||
int NombreCellulesParRangee;
|
||||
int *tab_row; /* table d'occupation des rangees (nb cellules) */
|
||||
int **tab_row_col; /* position des cellules */
|
||||
|
||||
/*********************** initialisations ******************************/
|
||||
tab_row_col = (int **) mbkalloc (sizeof (int *) * NombreLignes);
|
||||
for (iRow =0; iRow < NombreLignes; iRow++)
|
||||
{
|
||||
tab_row_col[iRow] = mbkalloc (sizeof (int) * NombreCellules);
|
||||
memset (tab_row_col[iRow], NONE, sizeof (int) * NombreCellules);
|
||||
}
|
||||
tab_row = (int *) mbkalloc (sizeof (int) * NombreLignes);
|
||||
memset (tab_row, 0, sizeof (int) * NombreLignes);
|
||||
|
||||
/*********************** initialisations ******************************/
|
||||
NombreCellulesParRangee = NombreCellules / NombreLignes; /* nb de cells par rangee (div entiere) */
|
||||
|
||||
/************ repartition des cellules dans les rangees ***************/
|
||||
for (iCell = 0;iCell < NombreCellules;iCell++)
|
||||
{
|
||||
do
|
||||
{
|
||||
nLigne = rand()%NombreLignes;
|
||||
} while(tab_row[nLigne] > NombreCellulesParRangee);
|
||||
tab_row[nLigne]++;
|
||||
Cells[iCell].row = nLigne;
|
||||
Cells[iCell].y = nLigne << WeightY;
|
||||
}
|
||||
|
||||
/************* repartition des cellules par colonnes *****************/
|
||||
for (iCell = 0; iCell < NombreCellules; iCell++)
|
||||
{
|
||||
nLigne = Cells[iCell].row;
|
||||
iCol = rand()%tab_row[nLigne];
|
||||
while(tab_row_col[nLigne][iCol] != NONE)
|
||||
if (up)
|
||||
if(iCol == tab_row[nLigne]-1)
|
||||
iCol =0;
|
||||
else
|
||||
iCol++;
|
||||
else
|
||||
if(iCol == 0)
|
||||
iCol = tab_row[nLigne]-1;
|
||||
else
|
||||
iCol--;
|
||||
tab_row_col[nLigne][iCol] = iCell;
|
||||
up = 1 - up;
|
||||
}
|
||||
|
||||
/******** affectation du placement dans la structure Cells ************/
|
||||
for (iRow=0; iRow < NombreLignes; iRow++)
|
||||
{
|
||||
cell_list *Cell, *PrevCell;
|
||||
|
||||
iCell = tab_row_col[iRow][0];
|
||||
Cell = &Cells[iCell];
|
||||
iPos = Cell->width;
|
||||
|
||||
Rows[iRow].head = Cell;
|
||||
Cell->prev = NULL;
|
||||
Cell->x = Cell->width >> 0 /* 99/9/21 1 */;
|
||||
|
||||
for (iCol=1; iCol < tab_row[iRow]; iCol++)
|
||||
{
|
||||
PrevCell = Cell;
|
||||
|
||||
iCell = tab_row_col[iRow][iCol];
|
||||
Cell = &Cells[iCell];
|
||||
Cell->x = iPos + (Cell->width >> 0 /* 99/9/21 1 */);
|
||||
iPos += Cell->width;
|
||||
|
||||
Cell->prev = PrevCell;
|
||||
PrevCell->next = Cell;
|
||||
}
|
||||
Rows[iRow].tail = Cell;
|
||||
Cell->next = NULL;
|
||||
Rows[iRow].length = iPos;
|
||||
}
|
||||
|
||||
/* insertion des connecteurs */
|
||||
if (Connectors)
|
||||
{
|
||||
cell_list *Cell;
|
||||
|
||||
iCell = NombreCellules;
|
||||
for (Con = Connectors->NORTH_CON; Con; Con = Con->NEXT)
|
||||
{
|
||||
Cell = &Cells[iCell];
|
||||
InsereConnecteur (Cell, NombreLignes - 1);
|
||||
/* Cell->x = 0; */
|
||||
Cell->y = (NombreLignes << WeightY) + WeightCon;
|
||||
iCell++;
|
||||
}
|
||||
for (Con = Connectors->SOUTH_CON; Con; Con = Con->NEXT)
|
||||
{
|
||||
Cell = &Cells[iCell];
|
||||
InsereConnecteur (Cell, 0);
|
||||
/* Cell->x = 0; */
|
||||
Cell->y = - WeightCon;
|
||||
iCell++;
|
||||
}
|
||||
for (Con = Connectors->WEST_CON; Con; Con = Con->NEXT)
|
||||
{
|
||||
Cell = &Cells[iCell];
|
||||
InsereConnecteur (Cell, Con->USER);
|
||||
Cell->x = -WeightCon;
|
||||
Cell->y = Con->USER << WeightY;
|
||||
iCell++;
|
||||
}
|
||||
for (Con = Connectors->EAST_CON; Con; Con = Con->NEXT)
|
||||
{
|
||||
Cell = &Cells[iCell];
|
||||
InsereConnecteur (Cell, Con->USER);
|
||||
Cell->x = LargeurIdeale+WeightCon;
|
||||
Cell->y = Con->USER << WeightY;
|
||||
iCell++;
|
||||
}
|
||||
}
|
||||
|
||||
for (iRow =0; iRow < NombreLignes; iRow++)
|
||||
mbkfree (tab_row_col[iRow]);
|
||||
mbkfree (tab_row_col);
|
||||
mbkfree (tab_row);
|
||||
} /* fin de generation_configuration_initiale */
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
InsereConnecteur
|
||||
\---------------------------------------------------------*/
|
||||
static void InsereConnecteur (Cell,nLigne)
|
||||
cell_list *Cell;
|
||||
int nLigne;
|
||||
{
|
||||
if (nLigne >= NombreLignes)
|
||||
{
|
||||
fprintf (stderr, "There are only %d rows and a connector is placed in row %d\n", NombreLignes, nLigne);
|
||||
exit (1);
|
||||
}
|
||||
Cell->row = nLigne;
|
||||
Rows[nLigne].head->prev = Cell;
|
||||
Cell->next = Rows[nLigne].head;
|
||||
Cell->prev = NULL;
|
||||
Rows[nLigne].head = Cell;
|
||||
} /* fin de InsereConnecteur */
|
||||
|
||||
|
||||
|
||||
|
||||
/* Cette version genere un placement environ deux fois meilleur que le placement
|
||||
* aleatoire genere ci-dessus. Il pourrait etre interessant de l'utiliser pour
|
||||
* un nombre d'iterations a 0, ou en diminuant le taux d'acceptation initial, car
|
||||
* le resultat obtenu est identique.
|
||||
* ATTENTION, elle n'utilise pas le meme format de donnee que celui implemente
|
||||
void generation_configuration_initiale(ptlofig, Connectors, ConWeight)
|
||||
lofig_list *ptlofig;
|
||||
PlaceConList *Connectors;
|
||||
long ConWeight;
|
||||
{
|
||||
int iCell,j;
|
||||
int NonPlacee;
|
||||
cell_list *Cell;
|
||||
|
||||
for (iCell=0; iCell<NombreCellules; iCell++)
|
||||
{
|
||||
Cell = &Cells[iCell];
|
||||
NonPlacee = TRUE;
|
||||
j = 0;
|
||||
do
|
||||
{
|
||||
if ( Rows[j].head->next == NULL ||
|
||||
((Rows[j].length+Cell->width < LargeurIdeale) && SignalCommun (Cell,Rows[j].tail)))
|
||||
{
|
||||
InsereCellule (Cell,j);
|
||||
NonPlacee = FALSE;
|
||||
}
|
||||
j++;
|
||||
} while (j<NombreLignes && NonPlacee);
|
||||
if (NonPlacee)
|
||||
{
|
||||
int Largeur, DepassementMin, Ligne;
|
||||
|
||||
Largeur = Cell->width;
|
||||
DepassementMin = Rows[0].length+Largeur-LargeurIdeale;
|
||||
Ligne = 0;
|
||||
for (j=1; j<NombreLignes; j++)
|
||||
if (Rows[j].length+Largeur-LargeurIdeale < DepassementMin)
|
||||
{
|
||||
Ligne = j;
|
||||
DepassementMin = Rows[j].length+Largeur-LargeurIdeale;
|
||||
}
|
||||
InsereCellule (Cell, Ligne);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int SignalCommun (Cell1,Cell2)
|
||||
cell_list *Cell1;
|
||||
cell_list *Cell2;
|
||||
{
|
||||
nets_of_cell *sig1, *sig2;
|
||||
|
||||
for (sig1 = Cell1->first; sig1; sig1 = sig1->next)
|
||||
for (sig2 = Cell2->first; sig2; sig2 = sig2->next)
|
||||
if (sig1->net == sig2->net)
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void InsereCellule (Cell,Ligne)
|
||||
cell_list *Cell;
|
||||
int Ligne;
|
||||
{
|
||||
Cell->pos = Cell->width>>1;
|
||||
if (Rows[Ligne].head->next)
|
||||
Cell->pos += Rows[Ligne].tail->pos + (Rows[Ligne].tail->width>>1);
|
||||
Rows[Ligne].length += Cell->width;
|
||||
Cell->row = Ligne;
|
||||
|
||||
Cell->next = (cell_list *)&Rows[Ligne].null;
|
||||
Cell->prev = Rows[Ligne].tail;
|
||||
Rows[Ligne].tail->next = Cell;
|
||||
Rows[Ligne].tail = Cell;
|
||||
}
|
||||
*/
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_inits.h */
|
||||
/* Contents : prototypes des fonctions d'initialisation */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Xavier Picat Date : 09/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef SCP_INITS_H
|
||||
#define SCP_INITS_H
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les variables globales
|
||||
\---------------------------------------------------------*/
|
||||
extern long LargeurIdeale;
|
||||
extern long NombreLignes;
|
||||
extern long Norme;
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les prototypes
|
||||
\---------------------------------------------------------*/
|
||||
extern void initialisation ();
|
||||
extern void generation_configuration_initiale ();
|
||||
|
||||
#endif /* SCP_INITS_H */
|
|
@ -0,0 +1,218 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_main.c */
|
||||
/* Contents : main of placer */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Pierre Fedrichkine Date : 02/07/1993 */
|
||||
/* Modified by : Xavier Picat Date : 08/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les includes
|
||||
\---------------------------------------------------------*/
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/times.h>
|
||||
#include <sys/param.h>
|
||||
#include <mut.h>
|
||||
#include <mlo.h>
|
||||
#include <mph.h>
|
||||
#include "scp_types.h"
|
||||
#include "scp_modif.h"
|
||||
#include "scp_main.h"
|
||||
#include "scp_inits.h"
|
||||
#include "scp_mbk2scp.h"
|
||||
#include "scp_scp2mbk.h"
|
||||
#include "scp_time.h"
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les prototypes
|
||||
\---------------------------------------------------------*/
|
||||
extern float CalculCoutTotal ();
|
||||
extern long Accepte ();
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les variables globales
|
||||
\---------------------------------------------------------*/
|
||||
long PoidsX, PoidsY;
|
||||
cell_list *Cells;
|
||||
net_list *Nets;
|
||||
row_elt *Rows;
|
||||
placement_fig Placement;
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les variables locales
|
||||
\---------------------------------------------------------*/
|
||||
static long CoutMoyen = 141900;
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Place
|
||||
\---------------------------------------------------------*/
|
||||
|
||||
int SXMODE=0;
|
||||
int SCR_RATIO=100; /* carre */
|
||||
|
||||
placement_fig *Place (LogicalFigur,NombreModifications,NbRow,WeightX,WeightY,WeightRows,WeightCon,Connectors,WHratio)
|
||||
lofig_list *LogicalFigur;
|
||||
unsigned long NombreModifications;
|
||||
unsigned long NbRow;
|
||||
unsigned long WeightX;
|
||||
unsigned long WeightY;
|
||||
unsigned long WeightRows;
|
||||
long WeightCon;
|
||||
int WHratio;
|
||||
PlaceConList *Connectors;
|
||||
{
|
||||
float CoutInitial; /* il faut le laisser en flottant car le cout initial est >> 2 000 000 000 */
|
||||
int Iteration;
|
||||
int Acceptees, Totales;
|
||||
long DeltaCout;
|
||||
nets_of_cell *pt_cn1;
|
||||
nets_of_cell *pt_cn2;
|
||||
cells_of_net *pt_cl1;
|
||||
cells_of_net *pt_cl2;
|
||||
int iNet, iCell;
|
||||
|
||||
set_time ();
|
||||
srand(getpid());
|
||||
PoidsX = WeightX;
|
||||
PoidsY = WeightY;
|
||||
printf("Loading SCP data base ...\n");
|
||||
chargement_figure(LogicalFigur,Connectors);
|
||||
initialisation(WeightRows,NbRow,WHratio);
|
||||
printf("Generating initial placement ... \n");
|
||||
generation_configuration_initiale(LogicalFigur, Connectors, WeightCon, WeightY);
|
||||
CoutInitial = CalculCoutTotal();
|
||||
printf ("%d cells %d nets in %d rows\n", NombreCellules, NombreSignaux, NombreLignes);
|
||||
Placement.Rows = Rows;
|
||||
Placement.NbRows = NombreLignes;
|
||||
Placement.Cells = Cells;
|
||||
Placement.NbCells = NombreCellules;
|
||||
if (NombreCellules > NombreModifications)
|
||||
NombreModifications = 10*NombreCellules;
|
||||
|
||||
printf("Placement in process of treatment : ");
|
||||
Iteration = 85;
|
||||
while (Iteration)
|
||||
{
|
||||
printf ("%3d%%\b\b\b\b",100-20*Iteration/17);
|
||||
fflush (stdout);
|
||||
Acceptees = 0;
|
||||
Totales = 0;
|
||||
while (Acceptees < NombreModifications && Totales < NombreModifications*3)
|
||||
{
|
||||
DeltaCout = modification_configuration ();
|
||||
if (DeltaCout <= 0 || Accepte (DeltaCout))
|
||||
{
|
||||
memorisation_nouvelle_configuration();
|
||||
Acceptees++;
|
||||
}
|
||||
Totales++;
|
||||
}
|
||||
if (CoutMoyen < 10240)
|
||||
{
|
||||
CoutMoyen *= 9;
|
||||
CoutMoyen /= 10;
|
||||
}
|
||||
else if (CoutMoyen < 51200)
|
||||
{
|
||||
CoutMoyen <<= 2;
|
||||
CoutMoyen /= 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
CoutMoyen *= 49;
|
||||
CoutMoyen /= 50;
|
||||
}
|
||||
Iteration--;
|
||||
}
|
||||
printf ("100%%\n%d%% saved in %4.1f s\n", (int)(100*(CoutInitial-CalculCoutTotal())/CoutInitial), get_time ());
|
||||
fflush (stdout);
|
||||
|
||||
/* liberation des structures associees au signaux */
|
||||
for (iCell = 0;iCell < NombreCellules;iCell++)
|
||||
if (pt_cn1=Cells[iCell].first)
|
||||
{
|
||||
for(pt_cn2=pt_cn1->next;pt_cn2;pt_cn1=pt_cn2,pt_cn2=pt_cn2->next)
|
||||
mbkfree(pt_cn1);
|
||||
Cells[iCell].first = NULL;
|
||||
}
|
||||
for (iNet = 0;iNet < NombreSignaux;iNet++)
|
||||
if (pt_cl1=Nets[iNet].first)
|
||||
for(pt_cl2=pt_cl1->next;pt_cl2;pt_cl1=pt_cl2,pt_cl2=pt_cl2->next)
|
||||
mbkfree(pt_cl1);
|
||||
mbkfree (Nets);
|
||||
return (&Placement);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Accepte
|
||||
\---------------------------------------------------------*/
|
||||
long Accepte (DeltaCout)
|
||||
long DeltaCout;
|
||||
{
|
||||
long Proba;
|
||||
|
||||
Proba = CoutMoyen-(DeltaCout<<10);
|
||||
if (Proba <0)
|
||||
return (0);
|
||||
else
|
||||
return (CoutMoyen*(rand() % 100) < 100*Proba);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
CalculCoutTotal
|
||||
\---------------------------------------------------------*/
|
||||
float CalculCoutTotal ()
|
||||
{
|
||||
cells_of_net *cell1, *cell2;
|
||||
long CoutNoeud;
|
||||
float CoutTotal;
|
||||
int Signal;
|
||||
|
||||
CoutTotal = 0;
|
||||
/*** parcours et calcul du cout total du a la longueur des nets *******/
|
||||
for (Signal = 0; Signal < NombreSignaux; Signal++)
|
||||
{
|
||||
CoutNoeud = 0;
|
||||
for (cell1 = Nets[Signal].first; cell1; cell1 = cell1->next)
|
||||
for (cell2 = cell1->next; cell2; cell2 = cell2->next)
|
||||
CoutNoeud += (abs(cell1->cell->x - cell2->cell->x)<<PoidsX)
|
||||
+ abs(cell1->cell->y - cell2->cell->y);
|
||||
CoutTotal += CoutNoeud * Nets[Signal].coeff;
|
||||
}
|
||||
return (CoutTotal);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_main.h */
|
||||
/* Contents : prototypes du placeur */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Xavier Picat Date : 09/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef SCP_MAIN_H
|
||||
#define SCP_MAIN_H
|
||||
/*---------------------------------------------------------\
|
||||
Les includes
|
||||
\---------------------------------------------------------*/
|
||||
#include "scp_types.h"
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les variables globales
|
||||
\---------------------------------------------------------*/
|
||||
extern long PoidsX;
|
||||
extern long PoidsY;
|
||||
extern cell_list *Cells;
|
||||
extern net_list *Nets;
|
||||
extern row_elt *Rows;
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les prototypes
|
||||
\---------------------------------------------------------*/
|
||||
extern placement_fig *Place ();
|
||||
|
||||
#endif /* SCP_MAIN_H */
|
|
@ -0,0 +1,266 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_mbk2scp.c */
|
||||
/* Contents : function wich loads the netlist in the internal data */
|
||||
/* structure through MBK data base */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Pierre Fedrichkine Date : 02/07/1993 */
|
||||
/* Modified by : Xavier Picat Date : 09/08/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
#include <memory.h>
|
||||
#include <mut.h>
|
||||
#include <mlo.h>
|
||||
#include <mph.h>
|
||||
#include "scp_types.h"
|
||||
#include "scp_inits.h"
|
||||
#include "scp_main.h"
|
||||
#include "scp_mbk2scp.h"
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Prototypes
|
||||
\---------------------------------------------------------*/
|
||||
static void add_net_cell ();
|
||||
static void add_cell_net ();
|
||||
static long man2dp ();
|
||||
static long get_index ();
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les variables globales
|
||||
\---------------------------------------------------------*/
|
||||
long NombreCellules;
|
||||
long NombreSignaux;
|
||||
long LargeurTotale;
|
||||
long Hauteur;
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
chargement_figure
|
||||
\---------------------------------------------------------*/
|
||||
void chargement_figure(ptlofig,Connectors)
|
||||
lofig_list *ptlofig;
|
||||
PlaceConList *Connectors;
|
||||
{
|
||||
phfig_list *ptphfig;
|
||||
locon_list *ptlocon;
|
||||
loins_list *ptloins;
|
||||
losig_list *ptlosig;
|
||||
int NetMax,iNet;
|
||||
int NombreConnecteurs;
|
||||
int *inter_net;
|
||||
CaracConList *Con;
|
||||
net_list *Net;
|
||||
cell_list *Cell;
|
||||
|
||||
/**************** comptage du nombre de cellules *************************/
|
||||
NombreCellules = 0;
|
||||
for (ptloins=ptlofig->LOINS; ptloins; ptloins=ptloins->NEXT)
|
||||
NombreCellules++;
|
||||
NombreConnecteurs = 0;
|
||||
if (Connectors)
|
||||
{
|
||||
for (Con = Connectors->NORTH_CON; Con; Con = Con->NEXT)
|
||||
NombreConnecteurs++;
|
||||
for (Con = Connectors->SOUTH_CON; Con; Con = Con->NEXT)
|
||||
NombreConnecteurs++;
|
||||
for (Con = Connectors->WEST_CON; Con; Con = Con->NEXT)
|
||||
NombreConnecteurs++;
|
||||
for (Con = Connectors->EAST_CON; Con; Con = Con->NEXT)
|
||||
NombreConnecteurs++;
|
||||
}
|
||||
Cells = (cell_list *) mbkalloc (sizeof (cell_list) * (NombreCellules + NombreConnecteurs));
|
||||
memset (Cells, 0, sizeof (cell_list) * (NombreCellules + NombreConnecteurs));
|
||||
|
||||
/**************** comptage du nombre de signaux *************************/
|
||||
NombreSignaux = 0;
|
||||
NetMax = 0;
|
||||
for (ptlosig=ptlofig->LOSIG; ptlosig; ptlosig=ptlosig->NEXT)
|
||||
{
|
||||
NombreSignaux++;
|
||||
if (ptlosig->INDEX>NetMax)
|
||||
NetMax = ptlosig->INDEX;
|
||||
}
|
||||
NetMax++; /* les signaux partent de 0 */
|
||||
Nets = (net_list *) mbkalloc (sizeof (net_list) * NombreSignaux);
|
||||
memset (Nets, 0, sizeof (net_list) * NombreSignaux);
|
||||
inter_net = (int *) mbkalloc (sizeof (int) * NetMax);
|
||||
iNet = 0;
|
||||
for (ptlosig=ptlofig->LOSIG; ptlosig; ptlosig=ptlosig->NEXT)
|
||||
{
|
||||
inter_net[ptlosig->INDEX] = iNet;
|
||||
iNet++;
|
||||
}
|
||||
|
||||
/******************** lecture des instances (cellules) ********************/
|
||||
LargeurTotale = 0;
|
||||
Cell = &Cells[0];
|
||||
for (ptloins=ptlofig->LOINS; ptloins; ptloins=ptloins->NEXT)
|
||||
{
|
||||
Cell->ins = ptloins;
|
||||
ptphfig = getphfig(ptloins->FIGNAME,'A');
|
||||
sx2sc (ptphfig);
|
||||
Cell->width = (ptphfig->XAB2 - ptphfig->XAB1) / SCALE_X;
|
||||
LargeurTotale += Cell->width;
|
||||
for(ptlocon=ptloins->LOCON; ptlocon; ptlocon=ptlocon->NEXT)
|
||||
{
|
||||
char *NomConnecteur;
|
||||
|
||||
NomConnecteur = namealloc(ptlocon->NAME);
|
||||
if (!(isvdd(NomConnecteur) || isvss(NomConnecteur)))
|
||||
{
|
||||
Net = &Nets[inter_net[ptlocon->SIG->INDEX]];
|
||||
add_net_cell(Cell,Net);
|
||||
add_cell_net(Net,Cell);
|
||||
}
|
||||
}
|
||||
Cell++;
|
||||
}
|
||||
if (Connectors)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (Con = ((CaracConList **)Connectors)[i]; Con; Con = Con->NEXT)
|
||||
{
|
||||
Net = &Nets[inter_net[get_index(ptlofig->LOSIG, namealloc(Con->NAME))]];
|
||||
add_net_cell(Cell,Net);
|
||||
add_cell_net(Net,Cell);
|
||||
Cell++;
|
||||
}
|
||||
}
|
||||
for (iNet=0; iNet<NombreSignaux; iNet++)
|
||||
Nets[iNet].coeff = man2dp(Nets[iNet].coeff);
|
||||
Hauteur = (ptphfig->YAB2 - ptphfig->YAB1) / SCALE_X;
|
||||
|
||||
/******************** lecture des connecteurs *********************/
|
||||
mbkfree (inter_net);
|
||||
} /* fin de chargement_figure */
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
get_index
|
||||
\---------------------------------------------------------*/
|
||||
static long get_index (ptlosig, ConName)
|
||||
losig_list *ptlosig;
|
||||
char *ConName;
|
||||
{
|
||||
chain_list *NameList;
|
||||
|
||||
while (ptlosig)
|
||||
{
|
||||
NameList = ptlosig->NAMECHAIN;
|
||||
while (NameList)
|
||||
{
|
||||
if (ConName == NameList->DATA)
|
||||
return (ptlosig->INDEX);
|
||||
NameList = NameList->NEXT;
|
||||
}
|
||||
ptlosig = ptlosig->NEXT;
|
||||
}
|
||||
fprintf (stderr, "\nThere is no signal named %s\n", ConName);
|
||||
exit (1);
|
||||
} /* fin de get_index */
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
add_net_cell
|
||||
\---------------------------------------------------------*/
|
||||
static void add_net_cell(Cell,Net)
|
||||
cell_list *Cell;
|
||||
net_list *Net;
|
||||
{
|
||||
nets_of_cell *NetOfCell;
|
||||
|
||||
NetOfCell = (nets_of_cell *) mbkalloc (sizeof (nets_of_cell));
|
||||
NetOfCell->net = Net;
|
||||
NetOfCell->next = Cell->first;
|
||||
Cell->first = NetOfCell;
|
||||
} /* fin de add_net_cell */
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
add_cell_net
|
||||
\---------------------------------------------------------*/
|
||||
static void add_cell_net(Net,Cell)
|
||||
net_list *Net;
|
||||
cell_list *Cell;
|
||||
{
|
||||
cells_of_net *CellOfNet;
|
||||
|
||||
CellOfNet = (cells_of_net *) mbkalloc (sizeof (cells_of_net));
|
||||
CellOfNet->cell = Cell;
|
||||
CellOfNet->next = Net->first;
|
||||
Net->coeff++;
|
||||
Net->first = CellOfNet;
|
||||
} /* fin de add_cell_net */
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
man2dp
|
||||
\---------------------------------------------------------*/
|
||||
static long man2dp(card)
|
||||
int card;
|
||||
{
|
||||
switch(card)
|
||||
{
|
||||
case 0 :
|
||||
case 1 :
|
||||
/* fprintf (stderr, "Warning : a signal isn't connected to any cell\n"); */
|
||||
return(0);
|
||||
break;
|
||||
|
||||
case 2 : return(FLOAT_TO_LONG * 1);
|
||||
break;
|
||||
|
||||
case 3 : return(FLOAT_TO_LONG * 0.5);
|
||||
break;
|
||||
|
||||
case 4 : return(FLOAT_TO_LONG * 0.333);
|
||||
break;
|
||||
|
||||
case 5 : return(FLOAT_TO_LONG * 0.222);
|
||||
break;
|
||||
|
||||
case 6 : return(FLOAT_TO_LONG * 0.15);
|
||||
break;
|
||||
|
||||
case 7 : return(FLOAT_TO_LONG * 0.11);
|
||||
break;
|
||||
|
||||
case 8 : return(FLOAT_TO_LONG * 0.087);
|
||||
break;
|
||||
|
||||
case 9 : return(FLOAT_TO_LONG * 0.0689);
|
||||
break;
|
||||
|
||||
case 10 : return(FLOAT_TO_LONG * 0.0563);
|
||||
break;
|
||||
|
||||
default : return(FLOAT_TO_LONG * 6.0 / (card*(card+1.0)));
|
||||
}
|
||||
} /* fin de man2dp */
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_mbk2scp.h */
|
||||
/* Contents : prototypes du parser */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Xavier Picat Date : 09/08/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef SCP_MBK2SCP
|
||||
#define SCP_MBK2SCP
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les variables globales
|
||||
\---------------------------------------------------------*/
|
||||
extern long NombreCellules;
|
||||
extern long NombreSignaux;
|
||||
extern long LargeurTotale;
|
||||
extern long Hauteur;
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Prototypes
|
||||
\---------------------------------------------------------*/
|
||||
extern void chargement_figure();
|
||||
|
||||
#endif /* SCP_MBK2SCP */
|
|
@ -0,0 +1,241 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_modif.c */
|
||||
/* Contents : fonctions de modification de la configuration */
|
||||
/* et du calcul du cout associe */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Pierre Fedrichkine Date : 02/07/1993 */
|
||||
/* Modified by : Xavier Picat Date : 09/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
/*---------------------------------------------------------\
|
||||
Les includes
|
||||
\---------------------------------------------------------*/
|
||||
#include <mut.h>
|
||||
#include <mlo.h>
|
||||
#include <mph.h>
|
||||
#include "scp_types.h"
|
||||
#include "scp_modif.h"
|
||||
#include "scp_inits.h"
|
||||
#include "scp_main.h"
|
||||
#include "scp_mbk2scp.h"
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les variables locales
|
||||
\---------------------------------------------------------*/
|
||||
static cell_list *Cell1, *Cell2; /* Cellules selectionnees pour la modification */
|
||||
static long DeltaWidth; /* Difference de largeur entre Cell2 et Cell1 */
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
memorisation_nouvelle_configuration
|
||||
\---------------------------------------------------------*/
|
||||
void memorisation_nouvelle_configuration ()
|
||||
{
|
||||
cell_list *Cell;
|
||||
int Pos;
|
||||
|
||||
/****** mise a jour des dernieres cellules ********/
|
||||
if (Cell1->next == NULL)
|
||||
Rows[Cell1->row].tail = Cell2;
|
||||
if (Cell2->next == NULL)
|
||||
Rows[Cell2->row].tail = Cell1;
|
||||
|
||||
/****** mise a jour des premieres cellules *******/
|
||||
if (Cell1->prev == NULL)
|
||||
Rows[Cell1->row].head = Cell2;
|
||||
if (Cell2->prev == NULL)
|
||||
Rows[Cell2->row].head = Cell1;
|
||||
|
||||
/********* mise a jour des longueurs des rangeesRows[].length ********/
|
||||
Rows[Cell1->row].length += DeltaWidth;
|
||||
Rows[Cell2->row].length -= DeltaWidth;
|
||||
|
||||
/*************** mise a jour des positions de cellules ****************/
|
||||
/* ne marche pas si les 2 cellules sont sur la meme rangee */
|
||||
/* si 2 suit 1, 2 sera decale de deltawidth .. */
|
||||
for(Cell = Cell1->next; Cell; Cell = Cell->next)
|
||||
Cell->x += DeltaWidth;
|
||||
|
||||
for(Cell = Cell2->next; Cell; Cell = Cell->next)
|
||||
Cell->x -= DeltaWidth;
|
||||
|
||||
Pos = Cell2->x - (DeltaWidth >> 0 /* 99/9/21 1 */);
|
||||
Cell2->x = Cell1->x + (DeltaWidth >> 0 /* 99/9/21 1 */);
|
||||
Cell1->x = Pos;
|
||||
|
||||
if (Cell1->next == Cell2)
|
||||
{
|
||||
if (Cell1->prev)
|
||||
Cell1->prev->next = Cell2;
|
||||
if (Cell2->next)
|
||||
Cell2->next->prev = Cell1;
|
||||
Cell1->next = Cell2->next;
|
||||
Cell2->next = Cell1;
|
||||
Cell2->prev = Cell1->prev;
|
||||
Cell1->prev = Cell2;
|
||||
}
|
||||
else
|
||||
{
|
||||
int Row;
|
||||
int Y;
|
||||
cell_list *Cell;
|
||||
|
||||
if (Cell1->next)
|
||||
Cell1->next->prev = Cell2;
|
||||
if (Cell1->prev)
|
||||
Cell1->prev->next = Cell2;
|
||||
if (Cell2->next)
|
||||
Cell2->next->prev = Cell1;
|
||||
if (Cell2->prev)
|
||||
Cell2->prev->next = Cell1;
|
||||
|
||||
Row = Cell1->row;
|
||||
Cell1->row = Cell2->row;
|
||||
Cell2->row = Row;
|
||||
|
||||
Y = Cell1->y;
|
||||
Cell1->y = Cell2->y;
|
||||
Cell2->y = Y;
|
||||
|
||||
Cell = Cell1->next;
|
||||
Cell1->next = Cell2->next;
|
||||
Cell2->next = Cell;
|
||||
|
||||
Cell = Cell1->prev;
|
||||
Cell1->prev = Cell2->prev;
|
||||
Cell2->prev = Cell;
|
||||
}
|
||||
} /* fin de memorisation_nouvelle_configuration */
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
modification_configuration
|
||||
|
||||
Effectue une modification elementaire de la configuration
|
||||
et renvoie une approximation du cout qu'elle occasionnerait
|
||||
\---------------------------------------------------------*/
|
||||
long modification_configuration ()
|
||||
{
|
||||
long DeltaCoutSignal, DeltaCout, DeltaCoutBandes;
|
||||
long NewX, NewY;
|
||||
long OldX, OldY;
|
||||
long XCellule, YCellule;
|
||||
nets_of_cell *signal;
|
||||
cells_of_net *cell;
|
||||
cell_list *Cellule;
|
||||
|
||||
/* Recherche de deux cellules a echanger */
|
||||
Cell1 = &Cells[rand() % NombreCellules];
|
||||
/* sur les tests effectues, on obtient JAMAIS (sur des millions d'appels)
|
||||
* deux fois la meme cellule, il est donc inutile de passer par un entier
|
||||
* qui contiendrait le numero de la cellule, plutot que de calculer directement
|
||||
* l'adresse de la cellule
|
||||
*/
|
||||
do
|
||||
{
|
||||
Cell2 = &Cells[rand() % NombreCellules];
|
||||
} while (Cell2 == Cell1) ;
|
||||
if (Cell2->next == Cell1)
|
||||
{
|
||||
Cellule = Cell1;
|
||||
Cell1 = Cell2;
|
||||
Cell2 = Cellule;
|
||||
}
|
||||
DeltaWidth = Cell2->width - Cell1->width;
|
||||
|
||||
/* calcul du cout occasionne par la premiere cellule */
|
||||
DeltaCout = 0;
|
||||
NewX = Cell2->x + ((Cell1->width - Cell2->width) >> 0 /* 99/9/21 1 */);
|
||||
NewY = Cell2->y; /* bande de finale de la cellule */
|
||||
OldX = Cell1->x; /* position initiale cellule */
|
||||
OldY = Cell1->y; /* bande initiale de la cellule */
|
||||
for (signal=Cell1->first; signal; signal=signal->next)
|
||||
{
|
||||
DeltaCoutSignal = 0;
|
||||
for(cell=signal->net->first; cell; cell=cell->next)
|
||||
{
|
||||
Cellule = cell->cell;
|
||||
if ((Cellule != Cell1) && (Cellule != Cell2))
|
||||
{
|
||||
XCellule = Cellule->x;
|
||||
YCellule = Cellule->y;
|
||||
if (Cellule->width)
|
||||
DeltaCoutSignal += ((abs(NewX - XCellule) - abs(OldX - XCellule)) << PoidsX)
|
||||
+ abs(NewY - YCellule) - abs(OldY - YCellule);
|
||||
else if (XCellule)
|
||||
/* c'est un connecteur EST/OUEST */
|
||||
DeltaCoutSignal += ((abs(NewX - XCellule) - abs(OldX - XCellule)) << PoidsX)
|
||||
+ ((abs(NewY - YCellule) - abs(OldY - YCellule)) << 1);
|
||||
else
|
||||
/* c'est un connecteur NORD/SUD */
|
||||
DeltaCoutSignal += ((abs(NewY - YCellule) - abs(OldY - YCellule)) << 1);
|
||||
}
|
||||
} /* fin du parcours des cellules signalees a ce signal */
|
||||
DeltaCout += DeltaCoutSignal * signal->net->coeff;
|
||||
} /* fin du parcours des signaux attaches a cette cellule */
|
||||
DeltaCoutBandes = abs(Rows[Cell1->row].length + DeltaWidth - LargeurIdeale)
|
||||
- abs(Rows[Cell1->row].length - LargeurIdeale);
|
||||
|
||||
/* calcul du cout occasionne par la premiere cellule */
|
||||
NewX = Cell1->x + ((Cell2->width - Cell1->width) >> 0 /* 99/9/21 1 */);
|
||||
NewY = Cell1->y; /* bande de finale de la cellule */
|
||||
OldX = Cell2->x; /* position initiale cellule */
|
||||
OldY = Cell2->y; /* bande initiale de la cellule */
|
||||
for (signal=Cell2->first; signal; signal=signal->next)
|
||||
{
|
||||
DeltaCoutSignal = 0;
|
||||
for(cell=signal->net->first; cell; cell=cell->next)
|
||||
{
|
||||
Cellule = cell->cell;
|
||||
if ((Cellule != Cell1) && (Cellule != Cell2))
|
||||
{
|
||||
XCellule = Cellule->x;
|
||||
YCellule = Cellule->y;
|
||||
if (Cellule->width)
|
||||
DeltaCoutSignal += ((abs(NewX - XCellule) - abs(OldX - XCellule)) << PoidsX)
|
||||
+ abs(NewY - YCellule) - abs(OldY - YCellule);
|
||||
else if (XCellule)
|
||||
/* c'est un connecteur EST/OUEST */
|
||||
DeltaCoutSignal += ((abs(NewX - XCellule) - abs(OldX - XCellule)) << PoidsX)
|
||||
+ ((abs(NewY - YCellule) - abs(OldY - YCellule)) << 1);
|
||||
else
|
||||
/* c'est un connecteur NORD/SUD */
|
||||
DeltaCoutSignal += ((abs(NewY - YCellule) - abs(OldY - YCellule)) << 1);
|
||||
}
|
||||
} /* fin du parcours des cellules signalees a ce signal */
|
||||
DeltaCout += DeltaCoutSignal * signal->net->coeff;
|
||||
} /* fin du parcours des signaux attaches a cette cellule */
|
||||
DeltaCoutBandes += 2* (abs(Rows[Cell2->row].length - DeltaWidth - LargeurIdeale)
|
||||
- abs(Rows[Cell2->row].length - LargeurIdeale));
|
||||
|
||||
return (DeltaCout/Norme + DeltaCoutBandes);
|
||||
} /* fin de calcul_difference_cout */
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_modif.h */
|
||||
/* Contents : prototypes des fonctions de modification de la configuration*/
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Xavier Picat Date : 09/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef SCP_MODIF_H
|
||||
#define SCP_MODIF_H
|
||||
/*---------------------------------------------------------\
|
||||
Les prototypes
|
||||
\---------------------------------------------------------*/
|
||||
extern void memorisation_nouvelle_configuration ();
|
||||
extern long modification_configuration ();
|
||||
|
||||
#endif /* SCP_MODIF_H */
|
|
@ -0,0 +1,159 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_Placer.c */
|
||||
/* Contents : */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Date : .......... */
|
||||
/* Modified by : Xavier Picat Date : 08/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les includes
|
||||
\---------------------------------------------------------*/
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <mut.h>
|
||||
#include <mlo.h>
|
||||
#include <mph.h>
|
||||
#include "scp_placer.h"
|
||||
#include "scp_scp2mbk.h"
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : ScrUsage() */
|
||||
/* */
|
||||
/* Description : */
|
||||
/* */
|
||||
/* Input parameters : */
|
||||
/* Input global Variables : none */
|
||||
/* Output parameters : none */
|
||||
/* Output global Variables : none */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
void ScrUsage(Execut)
|
||||
char *Execut;
|
||||
|
||||
{
|
||||
fprintf(stdout,"Syntax error on command line\n");
|
||||
fprintf(stdout,"usage : %s <source> [options...]\n",Execut);
|
||||
fprintf(stdout,"where valid options are :\n");
|
||||
fprintf(stdout," <source> : netlist file and placed layout (same name)\n");
|
||||
fprintf(stdout," [-i IterationNumber] : This action is used to improve the quality of the placement\n");
|
||||
fprintf(stdout," [-s SliceNumber] : This option allows the designer to set the number of slices\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : GetOptions() */
|
||||
/* */
|
||||
/* Description : getting all used options on commad line */
|
||||
/* */
|
||||
/* Input parameters : argument count and argument value */
|
||||
/* Input global Variables : none */
|
||||
/* Output parameters : option list pointer */
|
||||
/* Output global Variables : none */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
OptionList *GetOptions(ArgCount,ArgValue)
|
||||
int ArgCount;
|
||||
char *ArgValue[];
|
||||
|
||||
{
|
||||
OptionList *ptOption = (OptionList *) mbkalloc (sizeof(OptionList));
|
||||
int ArgNumber = 0;
|
||||
char car;
|
||||
|
||||
ptOption->ChannelName = NULL;
|
||||
ptOption->FileName = NULL;
|
||||
ptOption->Placer = 0;
|
||||
ptOption->Router = 0;
|
||||
ptOption->SupplyRecall = 1;
|
||||
ptOption->Row = 0;
|
||||
ptOption->Iteration = 0;
|
||||
|
||||
for (ArgNumber = 2; ArgNumber < ArgCount; ArgNumber++) {
|
||||
char *ArgV = ArgValue[ArgNumber];
|
||||
if (*ArgV == '-') {
|
||||
switch (*++ArgV) {
|
||||
|
||||
case 's' : if ((car = *++ArgV) == '\0')
|
||||
ptOption->Row = atoi(ArgValue[++ArgNumber]);
|
||||
else ScrUsage(ArgValue[0]);
|
||||
continue;
|
||||
|
||||
case 'i' : if (*++ArgV == '\0')
|
||||
ptOption->Iteration = atoi(ArgValue[++ArgNumber]);
|
||||
else ScrUsage(ArgValue[0]);
|
||||
continue;
|
||||
|
||||
default : ScrUsage(ArgValue[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(ptOption);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : main() */
|
||||
/******************************************************************************/
|
||||
int main(argc,argv)
|
||||
|
||||
int argc;
|
||||
char *argv[];
|
||||
|
||||
{
|
||||
phfig_list *ptphfig = NULL;
|
||||
lofig_list *ptlofig = NULL;
|
||||
OptionList *ptOption = NULL;
|
||||
|
||||
mbkenv();
|
||||
|
||||
ptOption = GetOptions(argc,argv);
|
||||
|
||||
fprintf(stdout,"Loading logical view : %s\n",argv[1]);
|
||||
ptlofig = getlofig(argv[1],'A');
|
||||
rflattenlofig(ptlofig,'Y','Y');
|
||||
|
||||
if (ptlofig->LOTRS) {
|
||||
fprintf(stdout,"scp_error : Check that the catalogue file existes and that it contains all the models instanciated in the figure.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fprintf(stdout,"Placing logical view : %s\n",argv[1]);
|
||||
ptphfig = Placer2Scr( ptlofig->NAME, Place( ptlofig, ptOption->Iteration, ptOption->Row, 0, 7, 5, 5, NULL));
|
||||
|
||||
savephfig(ptphfig);
|
||||
|
||||
return(0);
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_placer.h */
|
||||
/* Contents : prototypes du placeur */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Xavier Picat Date : 09/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#define BOOLEAN int
|
||||
typedef struct Option
|
||||
{
|
||||
char *ChannelName;
|
||||
char *FileName;
|
||||
BOOLEAN Placer;
|
||||
BOOLEAN Router;
|
||||
int SupplyRecall;
|
||||
int Row;
|
||||
int Iteration;
|
||||
}OptionList;
|
||||
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_scp2mbk.c */
|
||||
/* Contents : function sauvegarde_figure wich save the final placement */
|
||||
/* through MBK data base */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Pierre Fedrichkine Date : 02/07/1993 */
|
||||
/* Modified by : Xavier Picat Date : 09/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
/*---------------------------------------------------------\
|
||||
Les includes
|
||||
\---------------------------------------------------------*/
|
||||
#include "apr.h"
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Placer2Scr
|
||||
|
||||
ecriture du placement dans mbk physique
|
||||
\---------------------------------------------------------*/
|
||||
phfig_list *Placer2Scr(Nom,FigurePlacee)
|
||||
char *Nom;
|
||||
placement_fig *FigurePlacee;
|
||||
|
||||
{
|
||||
phfig_list *ptphfig;
|
||||
int iCell, iRow;
|
||||
int Width;
|
||||
int Height;
|
||||
row_elt *Row;
|
||||
cell_list *Cell;
|
||||
long step, percent, i;
|
||||
long NombreLignes, NombreCellules, Hauteur;
|
||||
|
||||
printf ("Saving placement ");
|
||||
/****************** recuperation de la hauteur d'UNE cellule ********************/
|
||||
Row = FigurePlacee->Rows;
|
||||
ptphfig = getphfig (Row[0].head->ins->FIGNAME,'P');
|
||||
sx2sc(ptphfig);
|
||||
Hauteur = (ptphfig->YAB2 - ptphfig->YAB1) / SCALE_X;
|
||||
|
||||
/****************** chargement du pointeur figure ********************/
|
||||
ptphfig = addphfig(Nom);
|
||||
NombreCellules = FigurePlacee->NbCells;
|
||||
NombreLignes = FigurePlacee->NbRows;
|
||||
|
||||
/**************** calcul de la taille de la figure ********************/
|
||||
Width = 0;
|
||||
for (iRow=0;iRow<NombreLignes;iRow++) /* bande la plus large */
|
||||
if (Row[iRow].length>Width)
|
||||
Width=Row[iRow].length;
|
||||
Height = NombreLignes*Hauteur;
|
||||
ptphfig->XAB1 = 0;
|
||||
ptphfig->YAB1 = 0;
|
||||
ptphfig->XAB2 = Width*SCALE_X;
|
||||
ptphfig->YAB2 = Height*SCALE_X;
|
||||
|
||||
step = NombreCellules/100;
|
||||
percent = 0;
|
||||
i = step - 1;
|
||||
/********************* placement des cellules *************************/
|
||||
Cell = FigurePlacee->Cells;
|
||||
for (iCell=0;iCell < NombreCellules;iCell++)
|
||||
{
|
||||
i++;
|
||||
if (i == step)
|
||||
{
|
||||
i = 0;
|
||||
printf ("%3d%%\b\b\b\b", percent);
|
||||
fflush (stdout);
|
||||
percent++;
|
||||
}
|
||||
addphins (ptphfig,
|
||||
Cell->ins->FIGNAME,
|
||||
Cell->ins->INSNAME,
|
||||
NOSYM,
|
||||
(Cell->x-(Cell->width>>0 /* 99/9/21 1 */))*SCALE_X,
|
||||
Cell->row*Hauteur*SCALE_X
|
||||
);
|
||||
Cell++;
|
||||
}
|
||||
printf ("100%\n");
|
||||
mbkfree (FigurePlacee->Rows);
|
||||
mbkfree (FigurePlacee->Cells);
|
||||
return(ptphfig);
|
||||
} /* fin de Placer2Scr */
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_scp2mbk.h */
|
||||
/* Contents : prototypes du driver */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Xavier Picat Date : 09/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef SCP_SCP2MBK_H
|
||||
#define SCP_SCP2MBK_H
|
||||
/*---------------------------------------------------------\
|
||||
Les includes
|
||||
\---------------------------------------------------------*/
|
||||
#include "scp_main.h"
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les prototypes
|
||||
\---------------------------------------------------------*/
|
||||
extern phfig_list *Placer2Scr ();
|
||||
|
||||
#endif /* SCP_SCP2MBK_H */
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_time.c */
|
||||
/* Contents : timing gunctions */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Xavier Picat Date : 02/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/times.h>
|
||||
#include "scp_time.h"
|
||||
|
||||
#define HZ 50
|
||||
/*---------------------------------------------------------\
|
||||
Les variables locales
|
||||
\---------------------------------------------------------*/
|
||||
static struct tms start_time;
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
set_time
|
||||
\---------------------------------------------------------*/
|
||||
void set_time ()
|
||||
{
|
||||
times (&start_time);
|
||||
} /* fin de set_time */
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
get_time
|
||||
\---------------------------------------------------------*/
|
||||
float get_time ()
|
||||
{
|
||||
struct tms end_time;
|
||||
|
||||
times (&end_time);
|
||||
return ((float) (end_time.tms_utime - start_time.tms_utime)/(float) HZ
|
||||
+ (float) (end_time.tms_stime - start_time.tms_stime)/(float) HZ);
|
||||
} /* fin de get_time */
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Placer */
|
||||
/* File : scp_time.h */
|
||||
/* Contents : prototypes of the timing functions */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Xavier Picat Date : 09/07/1993 */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef SCP_TIME_H
|
||||
#define SCP_TIME_H
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Prototypes
|
||||
\---------------------------------------------------------*/
|
||||
extern void set_time ();
|
||||
extern float get_time ();
|
||||
|
||||
#endif /* SCP_TIME_H */
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : Standard Cell Router */
|
||||
/* File : @(#) */
|
||||
/* Contents : */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : Date : ../../.... */
|
||||
/* Modified by : El housseine REJOUAN Date : 26/02/1993 */
|
||||
/* Modified by : Xavier Picat Date : 09/07/1993 */
|
||||
/* Modified by : Date : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef SCP_TYPES_H
|
||||
#define SCP_TYPES_H
|
||||
/*---------------------------------------------------------\
|
||||
Les includes
|
||||
\---------------------------------------------------------*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <apr.h>
|
||||
|
||||
/*---------------------------------------------------------\
|
||||
Les constantes
|
||||
\---------------------------------------------------------*/
|
||||
#define NONE -1
|
||||
/* cette valeur de 10 000 est suffisante pour des circuits <10000 cellules, mais peut etre
|
||||
* trop importante pour des circuits plus gros, en effet, lors du calcul de cout dans modif
|
||||
* les calculs se font en long et apparemment avec 100 000, le cout depasse parfois les
|
||||
* 2<<30 maximaux que peu contenir un long et donc tous les calculs sont fausses.
|
||||
* apparemment le fait de designer CoutTotal comme un float ne ralenti pas les calculs, se
|
||||
* serait peut etre la solution : CoutTotal += (float)((long)CoutSignal*(long)Net.coeff);
|
||||
* CoutSignal et coeff etant des longs. le fait de caster en long, evite que le C convertisse
|
||||
* tout en flottant (ce qu'il doit faire normalement je crois), on n'a donc plus qu'une
|
||||
* conversion et une addition en flottant (on gagne une multiplication en flottant).
|
||||
* il est moins probable qu'UN signal occasionne une valeur > 2<<30, mais si c le cas, alors
|
||||
* il faudrait tout mettre en flottant.
|
||||
*/
|
||||
#define FLOAT_TO_LONG 10000
|
||||
|
||||
#define max(a,b) ((a)<(b) ? (b):(a))
|
||||
|
||||
#endif /* SCP_TYPES_H */
|
|
@ -0,0 +1,58 @@
|
|||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <mph.h>
|
||||
#include <mut.h>
|
||||
#include <mpu.h>
|
||||
#include "apr.h"
|
||||
|
||||
extern int SXMODE;
|
||||
|
||||
void sx2sc (phfig_list * phfig)
|
||||
{
|
||||
phref_list *phref;
|
||||
int used[100];
|
||||
int t;
|
||||
|
||||
if (SXMODE == 0) return;
|
||||
|
||||
if (phfig->USER) return; /* deja traite */
|
||||
|
||||
phfig->USER = 1;
|
||||
/*
|
||||
* initialisation du tableau des transparences
|
||||
*/
|
||||
for (t=0; t <= (phfig->XAB2)/PITCH_X; t++)
|
||||
{
|
||||
used[t] = 0;
|
||||
}
|
||||
used[t] = -1;
|
||||
|
||||
for (phref = phfig->PHREF; phref; phref = phref->NEXT)
|
||||
{
|
||||
if (phref->NAME && strstr (phref->NAME, "_25"))
|
||||
{
|
||||
char ConnName[32];
|
||||
strcpy (ConnName, phref->NAME);
|
||||
*(strchr (ConnName, '_')) = '\0';
|
||||
addphcon (phfig, NORTH, ConnName,
|
||||
phref->XREF, phref->YREF, ALU2, 2*SCALE_X);
|
||||
addphcon (phfig, SOUTH, ConnName,
|
||||
phref->XREF, phref->YREF, ALU2, 2*SCALE_X);
|
||||
}
|
||||
used[(phref->XREF)/PITCH_X] = 1;
|
||||
}
|
||||
|
||||
for (t=1; used[t] != -1; t++)
|
||||
{
|
||||
if (!used[t])
|
||||
{
|
||||
char transname[32];
|
||||
sprintf (transname, "T%d", t);
|
||||
addphseg (phfig, TALU2, 2*SCALE_X,
|
||||
t*PITCH_X, phfig->YAB1, t*PITCH_X, phfig->YAB2,
|
||||
transname);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -478,8 +478,7 @@ rdsrec_list *viambkrds( Figure, Via, Lynx )
|
|||
( ( USE == RDS_USE_DRC ) && ( ! Lynx ) ) )
|
||||
{
|
||||
if ( SIDE_STEP == 0 ) break;
|
||||
if ( WSX < SIDE+(SIDE>>1) ) break;
|
||||
if ( WSY < SIDE+(SIDE>>1) ) break;
|
||||
if ( ( WSX < SIDE+(SIDE>>1) ) && ( WSY < SIDE+(SIDE>>1) ) ) break;
|
||||
|
||||
X1R = Xvia + OVERLAP - ( ( WSX + DWR ) >> 1 );
|
||||
Y1R = Yvia + OVERLAP - ( ( WSY + DWR ) >> 1 );
|
||||
|
@ -494,11 +493,13 @@ rdsrec_list *viambkrds( Figure, Via, Lynx )
|
|||
Y1R = RfmRoundLow ( Y1R );
|
||||
Y2R = RfmRoundHigh( Y2R );
|
||||
|
||||
#if 0
|
||||
if ( X1R >= 0 ) X1R = ( (X1R + SIDE_STEP - 1) / SIDE_STEP ) * SIDE_STEP;
|
||||
else X1R = ( X1R / SIDE_STEP ) * SIDE_STEP;
|
||||
|
||||
if ( Y1R >= 0 ) Y1R = ( (Y1R + SIDE_STEP - 1) / SIDE_STEP ) * SIDE_STEP;
|
||||
else Y1R = ( Y1R / SIDE_STEP ) * SIDE_STEP;
|
||||
#endif
|
||||
|
||||
BX1R = X1R;
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ void lecture_fic(char *nomfic, lofig_list *circuit_lo,
|
|||
if (!existe_signal_circuit(liste, circuit_lo, lecoeur))
|
||||
ringerreur(ERR_NONCONWIDTHPARAM, nom_con, NULL);
|
||||
|
||||
if (larg_con < SCALE_X)
|
||||
if (larg_con < WVIA_ALU2)
|
||||
ringerreur(ERR_WIDTHPARAM, (void * )nom_con, (void * ) & larg_con);
|
||||
|
||||
liste = liste->NEXT;
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = src
|
|
@ -0,0 +1,37 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(src/ScrSesame.cpp)
|
||||
|
||||
SCR_MAJOR_VERSION=5
|
||||
SCR_MINOR_VERSION=4
|
||||
SCR_VERSION=$SCR_MAJOR_VERSION.$SCR_MINOR_VERSION
|
||||
|
||||
AC_SUBST(SCR_MAJOR_VERSION)
|
||||
AC_SUBST(SCR_MINOR_VERSION)
|
||||
AC_SUBST(SCR_VERSION)
|
||||
|
||||
# For automake.
|
||||
VERSION=$SCR_VERSION
|
||||
PACKAGE=scr
|
||||
|
||||
dnl Initialize automake stuff
|
||||
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AM_PROG_LIBTOOL
|
||||
AC_PROG_MAKE_SET
|
||||
AM_WITH_REGEX
|
||||
AM_PROG_LEX
|
||||
AC_PROG_YACC
|
||||
|
||||
AC_CHECK_LIB(m, pow)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
|
||||
AM_ALLIANCE
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
src/Makefile
|
||||
])
|
|
@ -0,0 +1,719 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Chaine de CAO & VLSI Alliance */
|
||||
/* */
|
||||
/* Produit : STANDAD CELLS ROUTER */
|
||||
/* Fichier : GlobalRouter.c */
|
||||
/* */
|
||||
/* (c) copyright 1991 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* Tous droits reserves */
|
||||
/* Support : e-mail cao-vlsi@masi.ibp.fr */
|
||||
/* */
|
||||
/* Auteur(s) : El housseine REJOUAN le : 26/10/1991 */
|
||||
/* */
|
||||
/* Modifie par : El housseine REJOUAN le : 25/07/1992 */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
# include <mut.h>
|
||||
# include <mlo.h>
|
||||
# include <mph.h>
|
||||
# include <apr.h>
|
||||
# include "SCR_Type.h"
|
||||
# include "LoadDataBase.h"
|
||||
# include "ViewDataBase.h"
|
||||
# include "ScrDataBase.h"
|
||||
# include "main.h"
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : EliminateMultipleConnection() */
|
||||
/* */
|
||||
/* Description : */
|
||||
/* */
|
||||
/* Input parameters : */
|
||||
/* Input global Variables : */
|
||||
/* Output parameters : */
|
||||
/* Output global Variables : */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
Figure *EliminateMultipleConnection(ptFig)
|
||||
Figure *ptFig;
|
||||
|
||||
{
|
||||
Line *PathLine = NULL;
|
||||
Line *CentralChannel = NULL;
|
||||
Channel *ptChannel = NULL;
|
||||
Signal *ptSignal = NULL;
|
||||
ConnectorList *ptNorthCon = NULL;
|
||||
ConnectorList *ptSouthCon = NULL;
|
||||
ConnectorList *ptWestCon = NULL;
|
||||
ConnectorList *ptEastCon = NULL;
|
||||
ConnectorList *ptDeleteCon = NULL;
|
||||
ConnectorList *ptConList = NULL;
|
||||
ConnectorList *PrevConList = NULL;
|
||||
ConnectorList *CurrentCon = NULL;
|
||||
ConnectorList *ptSaveCon = NULL;
|
||||
long CounterCon = 0;
|
||||
long IndexSignal = 0;
|
||||
long IndexCentralChannel = 0;
|
||||
long GravityCentre = 0;
|
||||
long AddMarkCon = 0;
|
||||
long MinLength = 0;
|
||||
long NewLength = 0;
|
||||
BOOLEAN NetInChannel = FALSE;
|
||||
|
||||
/******************************************************************************/
|
||||
for (ptSignal = ptFig->SIG; ptSignal; ptSignal = ptSignal->NEXT) {
|
||||
if (!(isvdd(ptSignal->NAME) || isvss(ptSignal->NAME))) {
|
||||
ptSignal->MAXCON = 0;
|
||||
IndexSignal = ptSignal->INDEX;
|
||||
for (PathLine = ptFig->LINE; PathLine; PathLine = PathLine->NEXT) {
|
||||
if (PathLine->TYPE == PATH) {
|
||||
ptChannel = PathLine->CHANNEL;
|
||||
CounterCon = 0;
|
||||
for (ptNorthCon = ptChannel->NORTH_LIST; ptNorthCon;
|
||||
ptNorthCon = ptNorthCon->NextCon)
|
||||
if (IndexSignal == ptNorthCon->ConName) CounterCon++;
|
||||
for (ptSouthCon = ptChannel->SOUTH_LIST; ptSouthCon;
|
||||
ptSouthCon = ptSouthCon->NextCon)
|
||||
if (IndexSignal == ptSouthCon->ConName) CounterCon++;
|
||||
for (ptWestCon = ptChannel->WEST_LIST; ptWestCon;
|
||||
ptWestCon = ptWestCon->NextCon)
|
||||
if (IndexSignal == ptWestCon->ConName) CounterCon++;
|
||||
for (ptEastCon = ptChannel->EAST_LIST; ptEastCon;
|
||||
ptEastCon = ptEastCon->NextCon)
|
||||
if (IndexSignal == ptEastCon->ConName) CounterCon++;
|
||||
if (CounterCon > ptSignal->MAXCON) {
|
||||
CentralChannel = PathLine;
|
||||
ptSignal->MAXCON = CounterCon;
|
||||
}
|
||||
}
|
||||
}
|
||||
ptSignal->MAXCON = CentralChannel->INDEX;
|
||||
}
|
||||
}
|
||||
/******************************************************************************/
|
||||
for (ptSignal = ptFig->SIG; ptSignal; ptSignal = ptSignal->NEXT) {
|
||||
if ((NameVdd != ptSignal->NAME) && (NameVss != ptSignal->NAME)) {
|
||||
IndexSignal = ptSignal->INDEX;
|
||||
IndexCentralChannel = ptSignal->MAXCON;
|
||||
for (PathLine = ptFig->LINE; PathLine; PathLine = PathLine->NEXT) {
|
||||
if (PathLine->TYPE == PATH) {
|
||||
if (PathLine->INDEX != IndexCentralChannel) {
|
||||
ptChannel = PathLine->CHANNEL;
|
||||
CounterCon = AddMarkCon = GravityCentre = 0;
|
||||
NetInChannel = FALSE;
|
||||
for (ptNorthCon = ptChannel->NORTH_LIST; ptNorthCon;
|
||||
ptNorthCon = ptNorthCon->NextCon)
|
||||
if (IndexSignal == ptNorthCon->ConName) {
|
||||
NetInChannel = TRUE;
|
||||
CounterCon++;
|
||||
AddMarkCon += ptNorthCon->Mark;
|
||||
}
|
||||
for (ptSouthCon = ptChannel->SOUTH_LIST; ptSouthCon;
|
||||
ptSouthCon = ptSouthCon->NextCon)
|
||||
if (IndexSignal == ptSouthCon->ConName) {
|
||||
NetInChannel = TRUE;
|
||||
CounterCon++;
|
||||
AddMarkCon += ptSouthCon->Mark;
|
||||
}
|
||||
for (ptWestCon = ptChannel->WEST_LIST; ptWestCon;
|
||||
ptWestCon = ptWestCon->NextCon)
|
||||
if (IndexSignal == ptWestCon->ConName) {
|
||||
NetInChannel = TRUE;
|
||||
CounterCon++;
|
||||
AddMarkCon += ptWestCon->Mark;
|
||||
}
|
||||
for (ptEastCon = ptChannel->EAST_LIST; ptEastCon;
|
||||
ptEastCon = ptEastCon->NextCon)
|
||||
if (IndexSignal == ptEastCon->ConName) {
|
||||
NetInChannel = TRUE;
|
||||
CounterCon++;
|
||||
AddMarkCon += ptChannel->WIDTH;
|
||||
}
|
||||
if (NetInChannel) {
|
||||
if (PathLine->INDEX < IndexCentralChannel)
|
||||
ptConList = ptChannel->NORTH_LIST;
|
||||
else
|
||||
if (PathLine->INDEX > IndexCentralChannel)
|
||||
ptConList = ptChannel->SOUTH_LIST;
|
||||
GravityCentre = ((long ) ((AddMarkCon / CounterCon) + 0.5));
|
||||
MinLength = ptChannel->WIDTH;
|
||||
ptSaveCon = NULL;
|
||||
for (CurrentCon = ptConList; CurrentCon; CurrentCon = CurrentCon->NextCon) {
|
||||
if (CurrentCon->ConName == IndexSignal) {
|
||||
NewLength = LABS(GravityCentre,CurrentCon->Mark);
|
||||
if (NewLength <= MinLength) {
|
||||
MinLength = NewLength;
|
||||
ptSaveCon = CurrentCon;
|
||||
}
|
||||
}
|
||||
}
|
||||
PrevConList = NULL;
|
||||
while (ptConList) {
|
||||
if ((ptConList->ConName == IndexSignal) && (ptConList != ptSaveCon)) {
|
||||
ptDeleteCon = ptConList;
|
||||
ptConList = ptConList->NextCon;
|
||||
if (PrevConList) {
|
||||
PrevConList->NextCon = ptConList;
|
||||
}
|
||||
else {
|
||||
if (PathLine->INDEX < IndexCentralChannel)
|
||||
ptChannel->NORTH_LIST = ptConList;
|
||||
else
|
||||
if (PathLine->INDEX > IndexCentralChannel)
|
||||
ptChannel->SOUTH_LIST = ptConList;
|
||||
}
|
||||
mbkfree((void *) ptDeleteCon);
|
||||
}
|
||||
else {
|
||||
PrevConList = ptConList;
|
||||
ptConList = ptConList->NextCon;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(ptFig);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : AutoAllowInsert() */
|
||||
/******************************************************************************/
|
||||
Segment *AutoAllowInsert(ptfig,ptLine,Xinf,Xsup,NewphIns,ptXInsert,Counter)
|
||||
Figure *ptfig;
|
||||
Line *ptLine;
|
||||
long Xinf;
|
||||
long Xsup;
|
||||
phfig_list *NewphIns;
|
||||
XSupplyRecallList *ptXInsert;
|
||||
long Counter;
|
||||
|
||||
{
|
||||
XSupplyRecallList *ptXBreakList = NULL;
|
||||
long Xinsert = 0;
|
||||
long XInsertSouth = 0;
|
||||
long Xmoy = 0;
|
||||
Line *CurrentLine = NULL;
|
||||
Instance *CurrentInst = NULL;
|
||||
Instance *PrevInst = NULL;
|
||||
Instance *ptNewIns = NULL;
|
||||
long Xinst = 0;
|
||||
long XWinst = 0;
|
||||
long NewWidth = 0;
|
||||
long phNewHeight = 0;
|
||||
Connector *CurrentCon = NULL;
|
||||
Segment *CurrentSeg = NULL;
|
||||
Segment *ptNewAllow = NULL;
|
||||
Segment *ptSaveAllow = NULL;
|
||||
chain_list *ConList = NULL;
|
||||
|
||||
Xmoy = ((Xsup + Xinf) / 2);
|
||||
NewWidth = NewphIns->XAB2 - NewphIns->XAB1;
|
||||
phNewHeight = NewphIns->YAB2 - NewphIns->YAB1;
|
||||
for (CurrentLine = ptfig->LINE; CurrentLine; CurrentLine = CurrentLine->NEXT) {
|
||||
if (CurrentLine->TYPE == CELL) {
|
||||
for (PrevInst = NULL, CurrentInst = CurrentLine->INS; CurrentInst;
|
||||
CurrentInst = CurrentInst->NEXT) {
|
||||
if ((Xmoy >= (Xinst = CurrentInst->X)) &&
|
||||
(Xmoy <= (XWinst = Xinst + CurrentInst->WIDTH))) break;
|
||||
PrevInst = CurrentInst;
|
||||
}
|
||||
Xinsert = INF(Xmoy,Xinst,XWinst);
|
||||
if (CurrentLine == (ptfig->LINE->NEXT->NEXT)) XInsertSouth = Xinsert;
|
||||
if (Xinsert == XWinst) {
|
||||
PrevInst = CurrentInst;
|
||||
CurrentInst = CurrentInst->NEXT;
|
||||
}
|
||||
ptNewIns = CreateInstance(nameindex(CurrentLine->NAME,Counter),
|
||||
NewphIns->NAME,Xinsert,CurrentLine->Y,
|
||||
NewWidth,phNewHeight,NOSYM);
|
||||
if (PrevInst) {
|
||||
ptNewIns->NEXT = CurrentInst;
|
||||
PrevInst->NEXT = ptNewIns;
|
||||
}
|
||||
else {
|
||||
ptNewIns->NEXT = CurrentInst;
|
||||
CurrentLine->INS = ptNewIns;
|
||||
}
|
||||
|
||||
CurrentLine->WIDTH += NewWidth;
|
||||
ptNewAllow = InsertAllowInIns(ptNewIns,NewphIns->XAB1,NewphIns->XAB2,
|
||||
NewphIns->YAB1,NewphIns->YAB2,NewphIns);
|
||||
if (CurrentLine == ptLine)
|
||||
ptSaveAllow = ptNewAllow;
|
||||
CurrentLine->ALLOW = addchain(CurrentLine->ALLOW,(char *)ptNewAllow);
|
||||
for (CurrentSeg = CurrentLine->ALLOWUSED; CurrentSeg;
|
||||
CurrentSeg = CurrentSeg->NEXT)
|
||||
if (CurrentSeg->X1 >= Xinsert) {
|
||||
CurrentSeg->X1 += NewWidth;
|
||||
CurrentSeg->X2 += NewWidth;
|
||||
}
|
||||
/* Mise a jour des connecteurs des lignes */
|
||||
for (ConList = CurrentLine->CON; ConList; ConList = ConList->NEXT){
|
||||
CurrentCon = ((Connector *)ConList->DATA);
|
||||
if ((!CurrentCon->INST) && (CurrentCon->X >= Xinsert))
|
||||
CurrentCon->X += NewWidth;
|
||||
}
|
||||
/* Mise a jour des connecteurs internes et des segment des instances */
|
||||
for (; CurrentInst; CurrentInst = CurrentInst->NEXT) {
|
||||
CurrentInst->X += NewWidth;
|
||||
for (CurrentCon = CurrentInst->CON; CurrentCon;
|
||||
CurrentCon = CurrentCon->NEXT)
|
||||
CurrentCon->X += NewWidth;
|
||||
for (CurrentSeg = CurrentInst->ALLOW; CurrentSeg;
|
||||
CurrentSeg = CurrentSeg->NEXT) {
|
||||
CurrentSeg->X1 += NewWidth;
|
||||
CurrentSeg->X2 += NewWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
CurrentLine->WIDTH += NewWidth;
|
||||
}
|
||||
/* Mise a jour des connecteurs externes */
|
||||
for (CurrentCon = ptfig->CON; CurrentCon; CurrentCon = CurrentCon->NEXT) {
|
||||
if (CurrentCon->ORIENT == EAST)
|
||||
CurrentCon->X += NewWidth;
|
||||
else
|
||||
if ((CurrentCon->ORIENT == NORTH) && (CurrentCon->X >= Xinsert))
|
||||
CurrentCon->X += NewWidth;
|
||||
else
|
||||
if ((CurrentCon->ORIENT == SOUTH) && (CurrentCon->X >= XInsertSouth))
|
||||
CurrentCon->X += NewWidth;
|
||||
}
|
||||
/* MISE A JOUR DES POSITIONS D'OUVERTURES DES ALIM. */
|
||||
for (ptXBreakList = ptXInsert; ptXBreakList; ptXBreakList = ptXBreakList->NEXT) {
|
||||
if (ptXBreakList->X >= Xinsert) ptXBreakList->X += NewWidth;
|
||||
}
|
||||
/* MISE A JOUR DES POSITIONS D'OUVERTURES DES ALIM. */
|
||||
|
||||
return(ptSaveAllow);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : MakeConList() */
|
||||
/******************************************************************************/
|
||||
ConnectorList *MakeConList(LeadConList,IndexSig,IndexCol)
|
||||
|
||||
ConnectorList *LeadConList;
|
||||
long IndexSig;
|
||||
long IndexCol;
|
||||
|
||||
{
|
||||
ConnectorList *ptNewCon = NULL;
|
||||
ConnectorList *CurrentCon = NULL;
|
||||
ConnectorList *PrevCon = NULL;
|
||||
|
||||
ptNewCon = (ConnectorList *) mbkalloc (sizeof(ConnectorList));
|
||||
ptNewCon->NextCon = NULL;
|
||||
ptNewCon->ConName = IndexSig;
|
||||
ptNewCon->Mark = IndexCol;
|
||||
|
||||
if (LeadConList == NULL) LeadConList = ptNewCon;
|
||||
else {
|
||||
PrevCon = CurrentCon = LeadConList;
|
||||
while (CurrentCon) {
|
||||
if (CurrentCon->Mark > IndexCol) {
|
||||
ptNewCon->NextCon = CurrentCon;
|
||||
if (CurrentCon == LeadConList) LeadConList = ptNewCon;
|
||||
else PrevCon->NextCon = ptNewCon;
|
||||
break;
|
||||
}
|
||||
PrevCon = CurrentCon;
|
||||
CurrentCon = CurrentCon->NextCon;
|
||||
}
|
||||
if (CurrentCon == NULL) PrevCon->NextCon = ptNewCon;
|
||||
}
|
||||
|
||||
return(LeadConList);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : CreateChannel() */
|
||||
/******************************************************************************/
|
||||
Channel *CreateChannel( LeadNorth,LeadSouth,LeadWest,LeadEast,
|
||||
Width,Heigth)
|
||||
|
||||
ConnectorList *LeadNorth;
|
||||
ConnectorList *LeadSouth;
|
||||
ConnectorList *LeadWest;
|
||||
ConnectorList *LeadEast;
|
||||
long Width;
|
||||
long Heigth;
|
||||
|
||||
{
|
||||
Channel *ptNewChannel = NULL;
|
||||
|
||||
ptNewChannel = (Channel *) mbkalloc (sizeof(Channel));
|
||||
ptNewChannel->NORTH_LIST = LeadNorth;
|
||||
ptNewChannel->SOUTH_LIST = LeadSouth;
|
||||
ptNewChannel->WEST_LIST = LeadWest;
|
||||
ptNewChannel->EAST_LIST = LeadEast;
|
||||
ptNewChannel->H_SEGMENT = NULL;
|
||||
ptNewChannel->V_SEGMENT = NULL;
|
||||
ptNewChannel->VIA = NULL;
|
||||
ptNewChannel->WIDTH = Width;
|
||||
ptNewChannel->HEIGTH = Heigth;
|
||||
|
||||
return (ptNewChannel);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : FillChannel() */
|
||||
/******************************************************************************/
|
||||
void FillChannel(ptfig)
|
||||
|
||||
Figure *ptfig;
|
||||
|
||||
{
|
||||
Line *PathLine = NULL;
|
||||
Line *NorthLine = NULL;
|
||||
Line *SouthLine = NULL;
|
||||
Connector *CurrentCon = NULL;
|
||||
chain_list *ConList = NULL;
|
||||
ConnectorList *ptNorthList = NULL;
|
||||
ConnectorList *ptSouthList = NULL;
|
||||
ConnectorList *ptEastList = NULL;
|
||||
ConnectorList *ptWestList = NULL;
|
||||
|
||||
for (SouthLine = ptfig->LINE; SouthLine->NEXT;
|
||||
SouthLine = SouthLine->NEXT->NEXT) {
|
||||
|
||||
ptNorthList = NULL;
|
||||
ptSouthList = NULL;
|
||||
ptEastList = NULL;
|
||||
ptWestList = NULL;
|
||||
|
||||
PathLine = SouthLine->NEXT;
|
||||
NorthLine = PathLine->NEXT;
|
||||
for (ConList = PathLine->CON; ConList; ConList = ConList->NEXT) {
|
||||
CurrentCon = ((Connector *) ConList->DATA);
|
||||
if (CurrentCon->ORIENT == WEST)
|
||||
ptWestList = MakeConList(ptWestList,CurrentCon->SIG->INDEX,0);
|
||||
else if (CurrentCon->ORIENT == EAST)
|
||||
ptEastList = MakeConList(ptEastList,CurrentCon->SIG->INDEX,0);
|
||||
}
|
||||
if (SouthLine->TYPE == DOWN) {
|
||||
for (ConList = SouthLine->CON; ConList; ConList = ConList->NEXT) {
|
||||
CurrentCon = ((Connector *) ConList->DATA);
|
||||
ptSouthList = MakeConList(ptSouthList,CurrentCon->SIG->INDEX,
|
||||
((CurrentCon->X - WESTOFFSET) / PITCH_X) + 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (ConList = SouthLine->CON; ConList; ConList = ConList->NEXT) {
|
||||
CurrentCon = ((Connector *) ConList->DATA);
|
||||
if (CurrentCon->ORIENT == NORTH)
|
||||
ptSouthList = MakeConList(ptSouthList,CurrentCon->SIG->INDEX,
|
||||
((CurrentCon->X - WESTOFFSET) / PITCH_X) + 1);
|
||||
}
|
||||
}
|
||||
if (NorthLine->TYPE == UP) {
|
||||
for (ConList = NorthLine->CON; ConList; ConList = ConList->NEXT) {
|
||||
CurrentCon = ((Connector *) ConList->DATA);
|
||||
ptNorthList = MakeConList(ptNorthList,CurrentCon->SIG->INDEX,
|
||||
((CurrentCon->X - WESTOFFSET) / PITCH_X) + 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (ConList = NorthLine->CON; ConList; ConList = ConList->NEXT) {
|
||||
CurrentCon = ((Connector *) ConList->DATA);
|
||||
if (CurrentCon->ORIENT == SOUTH)
|
||||
ptNorthList = MakeConList(ptNorthList,CurrentCon->SIG->INDEX,
|
||||
((CurrentCon->X - WESTOFFSET) / PITCH_X) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
PathLine->CHANNEL = CreateChannel(ptNorthList,ptSouthList,ptWestList,
|
||||
ptEastList,
|
||||
((PathLine->WIDTH) / PITCH_X),
|
||||
((PathLine->HEIGTH) / PITCH_Y));
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* fonction MaxConInColumn() */
|
||||
/******************************************************************************/
|
||||
long MaxConInColumn(ptSig)
|
||||
|
||||
Signal *ptSig;
|
||||
|
||||
{
|
||||
chain_list *ConList1 = NULL;
|
||||
chain_list *ConList2 = NULL;
|
||||
Connector *CurrentCon = NULL;
|
||||
Connector *NextCon = NULL;
|
||||
long MaxConInCol = 0 ;
|
||||
long ConInColumn = 0 ;
|
||||
|
||||
for (ConList1 = ptSig->CON; ConList1; ConList1 = ConList1->NEXT) {
|
||||
CurrentCon = ((Connector *) ConList1->DATA);
|
||||
ConInColumn = 1;
|
||||
for (ConList2 = ConList1->NEXT; ConList2; ConList2 = ConList2->NEXT) {
|
||||
NextCon = ((Connector *) ConList2->DATA);
|
||||
if (NextCon->X == CurrentCon->X) ConInColumn++;
|
||||
}
|
||||
if (MaxConInCol < ConInColumn) MaxConInCol = ConInColumn;
|
||||
}
|
||||
return (MaxConInCol);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* fonction SortSignal() */
|
||||
/******************************************************************************/
|
||||
Signal *SortSignal(ptLeadSig)
|
||||
|
||||
Signal *ptLeadSig;
|
||||
|
||||
{
|
||||
Signal *CurrentSig = NULL;
|
||||
Signal *ptNextSig = NULL;
|
||||
Signal *ptPrevSig = NULL;
|
||||
BOOLEAN EndingSort = FALSE;
|
||||
long SecondSig = 0;
|
||||
|
||||
|
||||
for (CurrentSig = ptLeadSig; CurrentSig; CurrentSig = CurrentSig->NEXT)
|
||||
CurrentSig->MAXCON = MaxConInColumn(CurrentSig);
|
||||
|
||||
while (!EndingSort) {
|
||||
EndingSort = TRUE;
|
||||
SecondSig = 0;
|
||||
for (ptPrevSig = CurrentSig = ptLeadSig; CurrentSig->NEXT;
|
||||
CurrentSig = CurrentSig->NEXT) {
|
||||
ptNextSig = CurrentSig->NEXT;
|
||||
if (SecondSig < 2) SecondSig++;
|
||||
else ptPrevSig = ptPrevSig->NEXT;
|
||||
if (CurrentSig->MAXCON < ptNextSig->MAXCON) {
|
||||
EndingSort = FALSE;
|
||||
|
||||
if (CurrentSig == ptLeadSig) {
|
||||
if (ptNextSig->NEXT == NULL) {
|
||||
ptLeadSig = ptNextSig;
|
||||
ptNextSig->NEXT = CurrentSig;
|
||||
CurrentSig->NEXT = NULL;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
ptLeadSig = ptNextSig;
|
||||
CurrentSig->NEXT = ptNextSig->NEXT;
|
||||
ptNextSig->NEXT = CurrentSig;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ptNextSig->NEXT == NULL) {
|
||||
ptPrevSig->NEXT = ptNextSig;
|
||||
ptNextSig->NEXT = CurrentSig;
|
||||
CurrentSig->NEXT = NULL;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
CurrentSig->NEXT = ptNextSig->NEXT;
|
||||
ptNextSig->NEXT = CurrentSig;
|
||||
ptPrevSig->NEXT = ptNextSig;
|
||||
CurrentSig = ptNextSig;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return (ptLeadSig);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : SpreadSignal() */
|
||||
/******************************************************************************/
|
||||
void SpreadSignal(ptScrRoot,NewphIns,ptXInsert)
|
||||
Figure *ptScrRoot;
|
||||
phfig_list *NewphIns;
|
||||
XSupplyRecallList *ptXInsert;
|
||||
|
||||
{
|
||||
Signal *CurrentSig = NULL;
|
||||
Signal *ptSignal = NULL;
|
||||
Connector *ptCon = NULL;
|
||||
Connector *ptNewCon = NULL;
|
||||
Segment *ptAllow = NULL;
|
||||
Segment *ptSaveAllow = NULL;
|
||||
Segment *ptNewAllow = NULL;
|
||||
Line *FirstLine = NULL;
|
||||
Line *LastLine = NULL;
|
||||
Line *CellLine = NULL;
|
||||
Line *PrevLine = NULL;
|
||||
Line *ptSaveLine = NULL;
|
||||
Line *ptLine = NULL;
|
||||
chain_list *LineList = NULL;
|
||||
chain_list *SigList = NULL;
|
||||
chain_list *ConList = NULL;
|
||||
chain_list *AllowList = NULL;
|
||||
chain_list *PrevAllow = NULL;
|
||||
char *SigName = NULL;
|
||||
long MinLength = 0;
|
||||
long NewLength = 0;
|
||||
long Xinf = 0;
|
||||
long Xsup = 0;
|
||||
long Counter = 0;
|
||||
|
||||
for (CurrentSig = ptScrRoot->SIG; CurrentSig; CurrentSig = CurrentSig->NEXT) {
|
||||
SigName = namealloc(CurrentSig->NAME);
|
||||
if (!(isvdd(SigName) || isvss(SigName))) {
|
||||
FirstLine = LastLine = ((Line *) (CurrentSig->LINE)->DATA);
|
||||
for (LineList = CurrentSig->LINE; LineList; LineList = LineList->NEXT) {
|
||||
ptLine = ((Line *) LineList->DATA);
|
||||
if(ptLine->INDEX < FirstLine->INDEX) FirstLine = ptLine;
|
||||
else if (ptLine->INDEX > LastLine->INDEX) LastLine = ptLine;
|
||||
}
|
||||
if ((FirstLine != LastLine) && (FirstLine->NEXT != LastLine)) {
|
||||
for (ptSaveLine = PrevLine = FirstLine, CellLine = PrevLine->NEXT;
|
||||
(CellLine != LastLine); ptSaveLine = PrevLine,
|
||||
PrevLine = CellLine, CellLine = CellLine->NEXT) {
|
||||
if (CellLine->TYPE == CELL) {
|
||||
for (SigList = CellLine->SIG; SigList; SigList = SigList->NEXT)
|
||||
if (CurrentSig->INDEX == ((Signal *) SigList->DATA)->INDEX) break;
|
||||
if (SigList == NULL) { /* signal n'appartient pas a la ligne */
|
||||
if (CellLine->ALLOW) {
|
||||
for (SigList = PrevLine->SIG; SigList; SigList = SigList->NEXT) {
|
||||
ptSignal = ((Signal *) SigList->DATA);
|
||||
if (CurrentSig->INDEX == ptSignal->INDEX) break;
|
||||
}
|
||||
if (SigList == NULL) {
|
||||
for (SigList = ptSaveLine->SIG; SigList; SigList = SigList->NEXT) {
|
||||
ptSignal = ((Signal *) SigList->DATA);
|
||||
if (CurrentSig->INDEX == ptSignal->INDEX) break;
|
||||
}
|
||||
}
|
||||
for (ConList = ptSignal->CON; ConList; ConList = ConList->NEXT) {
|
||||
ptCon = ((Connector *) ConList->DATA);
|
||||
if ( ((ptCon->LINE->INDEX == PrevLine->INDEX) &&
|
||||
(ptCon->ORIENT == NORTH))
|
||||
||((ptCon->LINE->INDEX == ptSaveLine->INDEX) &&
|
||||
(ptCon->ORIENT == NORTH)) )
|
||||
break;
|
||||
}
|
||||
MinLength = CellLine->WIDTH;
|
||||
ptSaveAllow = NULL;
|
||||
for (AllowList = CellLine->ALLOW; AllowList;
|
||||
AllowList = AllowList->NEXT) {
|
||||
ptAllow = ((Segment *) AllowList->DATA);
|
||||
NewLength = LABS(ptAllow->X1,ptCon->X);
|
||||
if (MinLength > NewLength) {
|
||||
MinLength = NewLength;
|
||||
ptSaveAllow = ptAllow;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
Xinf = CellLine->WIDTH;
|
||||
Xsup = CellLine->X;
|
||||
for (ConList = CurrentSig->CON; ConList; ConList = ConList->NEXT) {
|
||||
ptCon = ((Connector *)ConList->DATA);
|
||||
if (Xinf > ptCon->X) Xinf = ptCon->X;
|
||||
if (Xsup < ptCon->X) Xsup = ptCon->X;
|
||||
}
|
||||
ptSaveAllow = AutoAllowInsert(ptScrRoot,CellLine,Xinf,Xsup,
|
||||
NewphIns,ptXInsert,++Counter);
|
||||
}
|
||||
/* Insert ALLOW in Line at ALLOWUSED */
|
||||
if (ptSaveAllow) {
|
||||
ptNewAllow = CreateSegment(namealloc(CurrentSig->NAME),ptSaveAllow->X1,
|
||||
ptSaveAllow->Y1,ptSaveAllow->X2,
|
||||
ptSaveAllow->Y2,LAYER2WIDTH,VER,ALU2);
|
||||
if (CellLine->ALLOWUSED == NULL) CellLine->ALLOWUSED = ptNewAllow;
|
||||
else {
|
||||
for (ptAllow = CellLine->ALLOWUSED; ptAllow->NEXT;
|
||||
ptAllow = ptAllow->NEXT);
|
||||
ptAllow->NEXT = ptNewAllow;
|
||||
}
|
||||
/* delete ALLOW from Line */
|
||||
PrevAllow = AllowList = CellLine->ALLOW;
|
||||
while (AllowList) {
|
||||
if (ptSaveAllow == ((Segment *) AllowList->DATA)) {
|
||||
if (AllowList == CellLine->ALLOW) CellLine->ALLOW = AllowList->NEXT;
|
||||
else if (AllowList->NEXT) PrevAllow->NEXT = AllowList->NEXT;
|
||||
else PrevAllow->NEXT = NULL;
|
||||
/* FREE(AllowList) */
|
||||
break;
|
||||
}
|
||||
PrevAllow = AllowList;
|
||||
AllowList = AllowList->NEXT;
|
||||
}
|
||||
|
||||
CellLine->SIG = addchain(CellLine->SIG,CurrentSig);
|
||||
CurrentSig->LINE = addchain(CurrentSig->LINE,CellLine);
|
||||
ptNewCon = CreateCon(CurrentSig->NAME,'I',UNKNOWN,NORTH,
|
||||
ptSaveAllow->X1,ptSaveAllow->Y2,
|
||||
LAYER2WIDTH,ALU2,CellLine,NULL);
|
||||
ptNewCon->SIG = CurrentSig;
|
||||
ptNewCon->LINE = CellLine;
|
||||
CellLine->CON = addchain(CellLine->CON,ptNewCon);
|
||||
CurrentSig->CON = addchain(CurrentSig->CON,ptNewCon);
|
||||
ptNewCon = CreateCon(CurrentSig->NAME,'I',UNKNOWN,SOUTH,
|
||||
ptSaveAllow->X1,ptSaveAllow->Y1,
|
||||
LAYER2WIDTH,ALU2,CellLine,NULL);
|
||||
ptNewCon->SIG = CurrentSig;
|
||||
ptNewCon->LINE = CellLine;
|
||||
CellLine->CON = addchain(CellLine->CON,ptNewCon);
|
||||
CurrentSig->CON = addchain(CurrentSig->CON,ptNewCon);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"scr_error : in Spread Signal !!! \n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* fonction GlobalRoute() */
|
||||
/******************************************************************************/
|
||||
void GlobalRoute(ptfig,NewphIns,ptXInsert)
|
||||
Figure *ptfig;
|
||||
phfig_list *NewphIns;
|
||||
XSupplyRecallList *ptXInsert;
|
||||
|
||||
{
|
||||
|
||||
ptfig->SIG = SortSignal(ptfig->SIG);
|
||||
SpreadSignal(ptfig,NewphIns,ptXInsert);
|
||||
FillChannel(ptfig);
|
||||
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"Eliminate the multiple connections ...\n");
|
||||
# endif
|
||||
|
||||
ptfig = EliminateMultipleConnection(ptfig);
|
||||
|
||||
}
|
||||
/******************************************************************************/
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Chaine de CAO & VLSI Alliance */
|
||||
/* */
|
||||
/* Produit : STANDAD CELLS ROUTER */
|
||||
/* Fichier : GlobalRouter.h */
|
||||
/* */
|
||||
/* (c) copyright 1991 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* Tous droits reserves */
|
||||
/* Support : e-mail cao-vlsi@masi.ibp.fr */
|
||||
/* */
|
||||
/* Auteur(s) : El housseine REJOUAN le : 11/07/1991 */
|
||||
/* */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
extern long MaxConInColumn();
|
||||
extern Signal *SortSignal();
|
||||
extern void GlobalRoute();
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Chaine de CAO & VLSI Alliance */
|
||||
/* */
|
||||
/* Produit : STANDAD CELLS ROUTER */
|
||||
/* Fichier : LoadDataBase.h */
|
||||
/* */
|
||||
/* (c) copyright 1991 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* Tous droits reserves */
|
||||
/* Support : e-mail cao-vlsi@masi.ibp.fr */
|
||||
/* */
|
||||
/* Auteur(s) : El housseine REJOUAN le : 11/07/1991 */
|
||||
/* */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
extern char Orient();
|
||||
extern long Delta_X();
|
||||
extern long Delta_Y();
|
||||
extern long Deltab_X();
|
||||
extern long Deltab_Y();
|
||||
extern Connector *CreateCon();
|
||||
extern Connector *InsertConInIns();
|
||||
extern Instance *CreateInstance();
|
||||
extern Instance *InsertInstance();
|
||||
extern Line *CreateLine();
|
||||
extern Line *MakeLine();
|
||||
extern Segment *CreateSegment();
|
||||
extern Segment *InsertAllowInIns();
|
||||
extern void FillFigure();
|
||||
extern Figure *LoadScrFig();
|
|
@ -0,0 +1,18 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
AM_YFLAGS = -d
|
||||
|
||||
#CFLAGS = -g -pg -O2
|
||||
CFLAGS = -g -O2
|
||||
#CFLAGS = -O2
|
||||
AM_CFLAGS = @ALLIANCE_CFLAGS@ \
|
||||
-I$(top_srcdir)/mbk/src
|
||||
|
||||
bin_PROGRAMS = scr
|
||||
|
||||
scr_LDADD = -L$(libdir) @ALLIANCE_LIBS@ \
|
||||
-L$(top_builddir)/mbk/src/.libs \
|
||||
-lApr -lMpu -lMlu -lMlo -lMph -lMut
|
||||
|
||||
scr_SOURCES = GlobalRouter.c LoadDataBase.c main.c ScrSesame.c ViewDataBase.c \
|
||||
scr_grammar.y scr_lexer.l
|
|
@ -0,0 +1,159 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Chaine de CAO & VLSI Alliance */
|
||||
/* */
|
||||
/* Produit : STANDAD CELLS ROUTER */
|
||||
/* Fichier : SCR_Type.h */
|
||||
/* */
|
||||
/* (c) copyright 1991 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* Tous droits reserves */
|
||||
/* Support : e-mail cao-vlsi@masi.ibp.fr */
|
||||
/* */
|
||||
/* Auteur(s) : El housseine REJOUAN le : 26/10/1991 */
|
||||
/* */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
extern char *ScrNameIndex();
|
||||
extern int SXMODE;
|
||||
|
||||
# define TRICE ((char *) "_")
|
||||
# define SIGNAME ((char *) "Sig_")
|
||||
# define NOTNET ((long 0) 0)
|
||||
|
||||
# define IMPAIRE(a) (((a) & 1) ? TRUE : FALSE)
|
||||
# define MAX(a,b) ((a>b) ? a:b)
|
||||
# define MIN(a,b) ((a<b) ? a:b)
|
||||
# define INF(x,y,z) (((x - y) <= (z - x)) ? y : z)
|
||||
# define LABS(x,y) ((x > y) ? (x - y) : (y - x))
|
||||
# define PATH 'P'
|
||||
# define CELL 'C'
|
||||
# define DOWN 'D'
|
||||
# define UP 'U'
|
||||
# define BOOLEAN int
|
||||
# define FALSE ((int ) 0)
|
||||
# define TRUE ((int ) 1)
|
||||
# define VDDOFFSET ((long ) (SXMODE ? 3:2) * SCALE_X)
|
||||
# define VSSOFFSET ((long ) (SXMODE ? 3:2) * SCALE_X)
|
||||
# define VDDWIDTH ((long ) (SXMODE ? 6:8) * SCALE_X)
|
||||
# define VSSWIDTH ((long ) (SXMODE ? 6:8) * SCALE_X)
|
||||
# define RIGHTSUPPLY (PITCH_X / (SXMODE ? 1:2))
|
||||
# define LEFTSUPPLY (PITCH_X / (SXMODE ? 1:2))
|
||||
# define MIDDLESUPPLY ((long ) 3 * SCALE_X)
|
||||
# define CELLAB ((long ) 50 * SCALE_X)
|
||||
|
||||
typedef struct SCR_Figure
|
||||
{
|
||||
struct SCR_Line *LINE;
|
||||
struct SCR_Signal *SIG;
|
||||
struct SCR_Connector *CON;
|
||||
struct SCR_Segment *ALLOW;
|
||||
} Figure;
|
||||
|
||||
typedef struct SCR_Line
|
||||
{
|
||||
struct SCR_Line *NEXT;
|
||||
char *NAME;
|
||||
char TYPE;
|
||||
long X,Y;
|
||||
long WIDTH;
|
||||
long HEIGTH;
|
||||
long INDEX;
|
||||
struct SCR_Instance *INS;
|
||||
struct chain *SIG;
|
||||
struct chain *CON;
|
||||
struct SCR_Segment *ALLOWUSED;
|
||||
struct chain *ALLOW;
|
||||
struct SCR_Channel *CHANNEL;
|
||||
} Line;
|
||||
|
||||
typedef struct SCR_Signal
|
||||
{
|
||||
struct SCR_Signal *NEXT;
|
||||
char *NAME;
|
||||
long INDEX;
|
||||
char TYPE;
|
||||
struct chain *CON;
|
||||
struct chain *LINE;
|
||||
long MAXCON;
|
||||
} Signal;
|
||||
|
||||
typedef struct SCR_Instance
|
||||
{
|
||||
struct SCR_Instance *NEXT;
|
||||
char *NAME;
|
||||
char *FIGNAME;
|
||||
long X,Y;
|
||||
long WIDTH;
|
||||
long HEIGTH;
|
||||
char TRANSF;
|
||||
struct SCR_Connector *CON;
|
||||
struct SCR_Segment *ALLOW;
|
||||
} Instance;
|
||||
|
||||
typedef struct SCR_Connector
|
||||
{
|
||||
struct SCR_Connector *NEXT;
|
||||
char *NAME;
|
||||
char TYPE;
|
||||
char DIRECTION;
|
||||
char ORIENT;
|
||||
long X,Y;
|
||||
long WIDTH;
|
||||
long ORDER; /* tenir compte de l'ordre des con. physiques */
|
||||
char LAYER;
|
||||
struct SCR_Signal *SIG;
|
||||
struct SCR_Line *LINE;
|
||||
struct SCR_Instance *INST;
|
||||
} Connector;
|
||||
|
||||
typedef struct SCR_Segment
|
||||
{
|
||||
struct SCR_Segment *NEXT;
|
||||
char *NAME;
|
||||
long X1,Y1,X2,Y2;
|
||||
long WIDTH;
|
||||
char TYPE;
|
||||
char LAYER;
|
||||
} Segment;
|
||||
|
||||
|
||||
typedef struct SCR_Channel
|
||||
{
|
||||
struct SCR_ConnectorList *NORTH_LIST;
|
||||
struct SCR_ConnectorList *SOUTH_LIST;
|
||||
struct SCR_ConnectorList *WEST_LIST;
|
||||
struct SCR_ConnectorList *EAST_LIST;
|
||||
struct SCR_SegmentList *H_SEGMENT;
|
||||
struct SCR_SegmentList *V_SEGMENT;
|
||||
struct SCR_ViasList *VIA;
|
||||
long WIDTH;
|
||||
long HEIGTH;
|
||||
} Channel ;
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Chaine de CAO & VLSI Alliance */
|
||||
/* */
|
||||
/* Produit : STANDAD CELLS ROUTER */
|
||||
/* Fichier : ScrDataBase.h */
|
||||
/* */
|
||||
/* (c) copyright 1991 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* Tous droits reserves */
|
||||
/* Support : e-mail cao-vlsi@masi.ibp.fr */
|
||||
/* */
|
||||
/* Auteur(s) : El housseine REJOUAN le : 26/10/1991 */
|
||||
/* */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
# define BOOLEAN int
|
||||
# define FALSE ((int ) 0)
|
||||
# define TRUE ((int ) 1)
|
||||
|
||||
# define HOR ((char )'H')
|
||||
# define VER ((char )'V')
|
|
@ -0,0 +1,188 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Chaine de CAO & VLSI Alliance */
|
||||
/* */
|
||||
/* Produit : STANDAD CELLS ROUTER */
|
||||
/* Fichier : ScrSesame.c */
|
||||
/* */
|
||||
/* (c) copyright 1991 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* Tous droits reserves */
|
||||
/* Support : e-mail cao-vlsi@masi.ibp.fr */
|
||||
/* */
|
||||
/* Auteur(s) : El housseine REJOUAN le : 26/10/1991 */
|
||||
/* */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
# include <mut.h>
|
||||
# include <mlo.h>
|
||||
# include <mph.h>
|
||||
|
||||
# define XNEG 1
|
||||
# define YNEG 2
|
||||
|
||||
extern int SXMODE;
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : UpDateNegatifCoordinate() */
|
||||
/******************************************************************************/
|
||||
void UpDateNegatifCoordinate(ptphfig,XYflag)
|
||||
phfig_list *ptphfig;
|
||||
int XYflag;
|
||||
|
||||
{
|
||||
phcon_list *CurrentphCon = NULL;
|
||||
phins_list *CurrentphIns = NULL;
|
||||
|
||||
if (XYflag == XNEG) {
|
||||
for (CurrentphCon = ptphfig->PHCON; CurrentphCon; CurrentphCon = CurrentphCon->NEXT) {
|
||||
CurrentphCon->XCON += (ptphfig->XAB1 * (-1));
|
||||
}
|
||||
for (CurrentphIns = ptphfig->PHINS; CurrentphIns; CurrentphIns = CurrentphIns->NEXT) {
|
||||
CurrentphIns->XINS += (ptphfig->XAB1 * (-1));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (XYflag == YNEG) {
|
||||
for (CurrentphCon = ptphfig->PHCON; CurrentphCon; CurrentphCon = CurrentphCon->NEXT) {
|
||||
CurrentphCon->YCON += (ptphfig->YAB1 * (-1));
|
||||
}
|
||||
for (CurrentphIns = ptphfig->PHINS; CurrentphIns; CurrentphIns = CurrentphIns->NEXT) {
|
||||
CurrentphIns->YINS += (ptphfig->YAB1 * (-1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : InsCompare() */
|
||||
/******************************************************************************/
|
||||
void InsCompare(ptphIns,ptloIns)
|
||||
|
||||
phins_list *ptphIns;
|
||||
loins_list *ptloIns;
|
||||
|
||||
{
|
||||
phins_list *CurrentphIns = NULL;
|
||||
phins_list *ptCurrentph = NULL;
|
||||
loins_list *CurrentloIns = NULL;
|
||||
loins_list *ptCurrentlo = NULL;
|
||||
char *InsName;
|
||||
|
||||
for (CurrentloIns = ptloIns; CurrentloIns; CurrentloIns = CurrentloIns->NEXT) {
|
||||
InsName = CurrentloIns->INSNAME;
|
||||
for (ptCurrentlo = ptloIns; ptCurrentlo; ptCurrentlo = ptCurrentlo->NEXT)
|
||||
if ((ptCurrentlo != CurrentloIns) && (InsName == ptCurrentlo->INSNAME)) {
|
||||
fprintf(stderr,"scr_error : Logic instance : %s is redeclared !!\n", InsName);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
for (CurrentphIns = ptphIns; CurrentphIns; CurrentphIns = CurrentphIns->NEXT) {
|
||||
InsName = CurrentphIns->INSNAME;
|
||||
for (ptCurrentph = ptphIns; ptCurrentph; ptCurrentph = ptCurrentph->NEXT)
|
||||
if ((ptCurrentph != CurrentphIns) && (InsName == ptCurrentph->INSNAME)) {
|
||||
fprintf(stderr,"scr_error : Physical instance : %s is redeclared !!\n", InsName);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
for (CurrentphIns = ptphIns; CurrentphIns; CurrentphIns = CurrentphIns->NEXT) {
|
||||
/*if (!(incatalogfeed(CurrentphIns->FIGNAME))) {*/
|
||||
if (strcmp(CurrentphIns->FIGNAME,(SXMODE ? "rowend_x0":"tie_y"))) {
|
||||
// if (strcmp(CurrentphIns->FIGNAME,(SXMODE ? "tie_x0":"tie_y"))) {
|
||||
for (CurrentloIns = ptloIns; CurrentloIns; CurrentloIns = CurrentloIns->NEXT)
|
||||
if (CurrentloIns->INSNAME == CurrentphIns->INSNAME) break;
|
||||
if (CurrentloIns == NULL) {
|
||||
fprintf(stderr,"scr_error : Physical instance : %s does not exist in logic net-list !! \n", CurrentphIns->INSNAME);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (CurrentloIns = ptloIns; CurrentloIns; CurrentloIns = CurrentloIns->NEXT) {
|
||||
for (CurrentphIns = ptphIns; CurrentphIns; CurrentphIns = CurrentphIns->NEXT)
|
||||
if (CurrentloIns->INSNAME == CurrentphIns->INSNAME) break;
|
||||
if (CurrentphIns == NULL) {
|
||||
fprintf(stderr,"scr_error : Logic instance : %s does not exist in physical net-list !! \n", CurrentloIns->INSNAME);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : ConCompare() */
|
||||
/******************************************************************************/
|
||||
void ConCompare(ptphCon,ptloCon)
|
||||
|
||||
phcon_list *ptphCon;
|
||||
locon_list *ptloCon;
|
||||
|
||||
{
|
||||
phcon_list *CurrentphCon = NULL;
|
||||
locon_list *CurrentloCon = NULL;
|
||||
|
||||
for (CurrentphCon = ptphCon; CurrentphCon; CurrentphCon = CurrentphCon->NEXT) {
|
||||
for (CurrentloCon = ptloCon; CurrentloCon; CurrentloCon = CurrentloCon->NEXT)
|
||||
if (CurrentphCon->NAME == CurrentloCon->NAME) break;
|
||||
if (CurrentloCon == NULL) {
|
||||
fprintf(stderr,"scr_error : Physical connector : %s does not exist in logic connector list\n", CurrentphCon->NAME);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : Sesame() */
|
||||
/******************************************************************************/
|
||||
void Sesame(ptphfig,ptlofig)
|
||||
|
||||
phfig_list *ptphfig;
|
||||
lofig_list *ptlofig;
|
||||
|
||||
{
|
||||
if (ptphfig->PHSEG || ptphfig->PHVIA) {
|
||||
fprintf(stderr,"scr_error : Segments and Vias list must be NULL !!\n");
|
||||
exit(1);
|
||||
}
|
||||
if (ptphfig->XAB1 < 0) {
|
||||
UpDateNegatifCoordinate(ptphfig,XNEG);
|
||||
ptphfig->XAB2 += (ptphfig->XAB1 * (-1));
|
||||
ptphfig->XAB1 += (ptphfig->XAB1 * (-1));
|
||||
}
|
||||
if (ptphfig->YAB1 < 0) {
|
||||
UpDateNegatifCoordinate(ptphfig,YNEG);
|
||||
ptphfig->YAB2 += (ptphfig->YAB1 * (-1));
|
||||
ptphfig->YAB1 += (ptphfig->YAB1 * (-1));
|
||||
}
|
||||
InsCompare(ptphfig->PHINS,ptlofig->LOINS);
|
||||
ConCompare(ptphfig->PHCON,ptlofig->LOCON);
|
||||
}
|
||||
|
|
@ -0,0 +1,295 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Chaine de CAO & VLSI Alliance */
|
||||
/* */
|
||||
/* Produit : STANDAD CELLS ROUTER */
|
||||
/* Fichier : ViewDataBase.c */
|
||||
/* */
|
||||
/* (c) copyright 1991 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* Tous droits reserves */
|
||||
/* Support : e-mail cao-vlsi@masi.ibp.fr */
|
||||
/* */
|
||||
/* Auteur(s) : El housseine REJOUAN le : 26/10/1991 */
|
||||
/* */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
# include <mut.h>
|
||||
# include <mlo.h>
|
||||
# include <mph.h>
|
||||
# include <apr.h>
|
||||
# include "SCR_Type.h"
|
||||
|
||||
/******************************************************************************/
|
||||
/* function DecodLayer() /
|
||||
/******************************************************************************/
|
||||
char *DecodLayer(index)
|
||||
char index;
|
||||
{
|
||||
switch (index) {
|
||||
case NWELL :
|
||||
return "nwell";
|
||||
case PWELL :
|
||||
return "pwell";
|
||||
case NTIE :
|
||||
return "ntie";
|
||||
case PTIE :
|
||||
return "ptie";
|
||||
case NDIF :
|
||||
return "ndif";
|
||||
case PDIF :
|
||||
return "pdif";
|
||||
case NTRANS :
|
||||
return "ntrans";
|
||||
case PTRANS :
|
||||
return "ptrans";
|
||||
case POLY :
|
||||
return "poly";
|
||||
case ALU1 :
|
||||
return "metal1";
|
||||
case ALU2 :
|
||||
return "metal2";
|
||||
case ALU3 :
|
||||
return "metal3";
|
||||
case TPOLY :
|
||||
return "allowP";
|
||||
case TALU1 :
|
||||
return "allowM1";
|
||||
case TALU2 :
|
||||
return "allowM2";
|
||||
case TALU3 :
|
||||
return "allowM3";
|
||||
}
|
||||
return NULL; /* makes lint silent */
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : ViewConList() */
|
||||
/******************************************************************************/
|
||||
void ViewConList(ptLeadList)
|
||||
|
||||
ConnectorList *ptLeadList;
|
||||
|
||||
{
|
||||
ConnectorList *CurrentCon = NULL;
|
||||
|
||||
for (CurrentCon = ptLeadList; CurrentCon; CurrentCon = CurrentCon->NextCon)
|
||||
fprintf(stdout,"|____(NAME,INDEX) : ( %ld , %ld ) \n",
|
||||
CurrentCon->ConName,CurrentCon->Mark);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : ViewScrChannel() */
|
||||
/******************************************************************************/
|
||||
void ViewScrChannel(ptfig)
|
||||
|
||||
Figure *ptfig;
|
||||
|
||||
{
|
||||
Line *ptLine = NULL;
|
||||
Channel *ptChannel = NULL;
|
||||
|
||||
for(ptLine = ptfig->LINE->NEXT; ptLine->NEXT->NEXT;
|
||||
ptLine = ptLine->NEXT->NEXT) {
|
||||
ptChannel = ptLine->CHANNEL;
|
||||
if (ptChannel) {
|
||||
fprintf(stdout,"|__ChannelName : %s \n",ptLine->NAME);
|
||||
fprintf(stdout,"|__________|__NorthConList : \n");
|
||||
ViewConList(ptChannel->NORTH_LIST);
|
||||
fprintf(stdout,"|__________|__SouthConList : \n");
|
||||
ViewConList(ptChannel->SOUTH_LIST);
|
||||
fprintf(stdout,"|__________|__WestConList : \n");
|
||||
ViewConList(ptChannel->WEST_LIST);
|
||||
fprintf(stdout,"|__________|__EastConList : \n");
|
||||
ViewConList(ptChannel->EAST_LIST);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* fonction ViewScrSegment() */
|
||||
/******************************************************************************/
|
||||
void ViewScrSegment(ptSeg)
|
||||
|
||||
Segment *ptSeg;
|
||||
|
||||
{
|
||||
Segment *CurrentSeg;
|
||||
|
||||
for (CurrentSeg = ptSeg ; CurrentSeg; CurrentSeg = CurrentSeg->NEXT) {
|
||||
printf("|__SEG.NAME________________: %s \n",CurrentSeg->NAME);
|
||||
printf("| |__SEG.(X1,Y1) : (%ld , %ld ) \n",CurrentSeg->X1,CurrentSeg->Y1);
|
||||
printf("| |__SEG.(X2,Y2) : (%ld , %ld ) \n",CurrentSeg->X2,CurrentSeg->Y2);
|
||||
printf("| |__SEG.(WIDTH) : %ld \n",CurrentSeg->WIDTH);
|
||||
printf("| |__SEG.(TYPE) : ( %c ) \n",CurrentSeg->TYPE);
|
||||
printf("| |__SEG.(LAYER) : ( %s ) \n",DecodLayer(CurrentSeg->LAYER));
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* fonction ViewScrCon() */
|
||||
/******************************************************************************/
|
||||
void ViewScrCon(ptCon)
|
||||
|
||||
Connector *ptCon;
|
||||
|
||||
{
|
||||
Connector *CurrentCon = NULL;
|
||||
|
||||
for ( CurrentCon = ptCon ; CurrentCon; CurrentCon = CurrentCon->NEXT ) {
|
||||
printf("|__CON.NAME____________________: %s \n",CurrentCon->NAME);
|
||||
printf("| |__CON.(TYPE) : ( %c )\n",CurrentCon->TYPE);
|
||||
printf("| |__CON.(DIRECT) : ( %c )\n",CurrentCon->DIRECTION);
|
||||
printf("| |__CON.(ORIENT) : ( %c )\n",CurrentCon->ORIENT);
|
||||
printf("| |__CON.(X,Y) : ( %ld, %ld )\n",CurrentCon->X,CurrentCon->Y);
|
||||
printf("| |__CON.(WIDTH) : ( %ld )\n",CurrentCon->WIDTH);
|
||||
printf("| |__CON.(LAYER) : ( %s )\n",DecodLayer(CurrentCon->LAYER));
|
||||
printf("| |__CON.(SIG_INDEX) : ( %ld )\n",CurrentCon->SIG->INDEX);
|
||||
printf("| |__CON.(LINE_INDEX): ( %ld )\n",CurrentCon->LINE->INDEX);
|
||||
if (CurrentCon->INST != NULL)
|
||||
printf("| |__CON.(LINE_INST) : ( %s )\n",CurrentCon->INST->NAME);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* fonction ViewScrInstance() */
|
||||
/******************************************************************************/
|
||||
void ViewScrInstance(ptLeadIns)
|
||||
|
||||
Instance *ptLeadIns;
|
||||
|
||||
{
|
||||
Instance *ptIns = NULL;
|
||||
|
||||
for ( ptIns = ptLeadIns ; ptIns; ptIns = ptIns->NEXT ) {
|
||||
printf("| |__INS.INSNAME__________: %s \n",ptIns->NAME );
|
||||
printf("| | |__INS.FIGNAME : %s \n", ptIns->FIGNAME );
|
||||
printf("| | |__INS.(X,WIDTH) : ( %ld , %ld ) \n",ptIns->X,ptIns->WIDTH);
|
||||
printf("| | |__INS.(Y,HEIGTH): ( %ld , %ld ) \n",ptIns->Y,ptIns->HEIGTH);
|
||||
printf("| | |__INS.TRANSF : ( %c ) \n",ptIns->TRANSF );
|
||||
printf("| | |__Connecteurs de l'instance : \n");
|
||||
ViewScrCon(ptIns->CON);
|
||||
printf("| | |__Transparences de la cellule : \n");
|
||||
if (ptIns->ALLOW == NULL)
|
||||
fprintf(stdout,"Pas de TRANSPARENCES dans cette cellule.\n");
|
||||
else ViewScrSegment(ptIns->ALLOW);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* fonction ViewScrSignal() */
|
||||
/******************************************************************************/
|
||||
void ViewScrSignal(ptLeadSig)
|
||||
|
||||
Signal *ptLeadSig;
|
||||
|
||||
{
|
||||
Signal *ptSig = NULL;
|
||||
chain_list *ConList = NULL;
|
||||
chain_list *LineList = NULL;
|
||||
|
||||
for (ptSig = ptLeadSig; ptSig; ptSig = ptSig->NEXT ) {
|
||||
printf("|____SIG.NAME__________________: %s \n",ptSig->NAME);
|
||||
printf("| |__SIG.(INDEX,TYPE) : ( %ld , %c ) \n",ptSig->INDEX,ptSig->TYPE);
|
||||
printf("| |__Connecteurs du signal : \n");
|
||||
for (ConList = ptSig->CON; ConList; ConList = ConList->NEXT )
|
||||
printf("| |__SIG.(CON_X) : ( %ld ) \n",
|
||||
((Connector *) ConList->DATA)->X);
|
||||
printf("| |__Lignes du signal : \n");
|
||||
for (LineList = ptSig->LINE; LineList; LineList = LineList->NEXT )
|
||||
printf("| |__SIG.(INDEX_LINE) : ( %ld ) \n",
|
||||
((Line *) LineList->DATA)->INDEX);
|
||||
printf("| |__SIG.(MAXCON) : ( %ld ) \n",ptSig->MAXCON);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* fonction ViewScrLine() */
|
||||
/******************************************************************************/
|
||||
void ViewScrLine(ptLeadLine)
|
||||
|
||||
Line *ptLeadLine;
|
||||
|
||||
{
|
||||
Line *ptLine = NULL;
|
||||
chain_list *SigList = NULL;
|
||||
chain_list *ConList = NULL;
|
||||
chain_list *AllowList = NULL;
|
||||
Segment *ptAllow = NULL;
|
||||
|
||||
for (ptLine = ptLeadLine; ptLine; ptLine = ptLine->NEXT) {
|
||||
printf("|_LIN.Name____________________: %s \n", ptLine->NAME);
|
||||
printf("| |__LIN.(TYPE,INDEX) :( %c, %ld )\n", ptLine->TYPE, ptLine->INDEX);
|
||||
printf("| |__LIN.(X,WIDTH) :( %ld, %ld )\n", ptLine->X , ptLine->WIDTH);
|
||||
printf("| |__LIN.(Y,HEIGTH) :( %ld, %ld )\n", ptLine->Y, ptLine->HEIGTH);
|
||||
if (ptLine->TYPE == 'C') {
|
||||
printf("|_________Cellules de la ligne : \n");
|
||||
ViewScrInstance(ptLine->INS);
|
||||
}
|
||||
printf("| |__signaux de la ligne : \n");
|
||||
for (SigList = ptLine->SIG; SigList; SigList = SigList->NEXT)
|
||||
printf("| |__LIN.(SIG_INDEX) : ( %ld )\n",
|
||||
((Signal *) SigList->DATA)->INDEX);
|
||||
printf("| |__connecteurs de la ligne : \n");
|
||||
for (ConList = ptLine->CON; ConList; ConList = ConList->NEXT)
|
||||
printf("| |__LIN.(CON_NAME) : ( %s )\n",
|
||||
((Connector *) ConList->DATA)->NAME);
|
||||
printf("| |__transprences utilisees de la ligne : \n");
|
||||
for (ptAllow = ptLine->ALLOWUSED; ptAllow; ptAllow = ptAllow->NEXT) {
|
||||
printf("| |__LIN.(ALLOWUSED_X1_Y1) : ( %ld , %ld )\n",
|
||||
ptAllow->X1,ptAllow->Y1);
|
||||
printf("| |__LIN.(ALLOWUSED_X2_Y2) : ( %ld , %ld )\n",
|
||||
ptAllow->X2,ptAllow->Y2);
|
||||
}
|
||||
printf("| |__transprences de la ligne : \n");
|
||||
for (AllowList = ptLine->ALLOW; AllowList; AllowList = AllowList->NEXT) {
|
||||
printf("| |__LIN.(ALLOW_X1_Y1) : ( %ld , %ld )\n",
|
||||
((Segment *) AllowList->DATA)->X1,((Segment *) AllowList->DATA)->Y1);
|
||||
printf("| |__LIN.(ALLOW_X2_Y2) : ( %ld , %ld )\n",
|
||||
((Segment *) AllowList->DATA)->X2,((Segment *) AllowList->DATA)->Y2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* fonction ViewScrFigure() */
|
||||
/******************************************************************************/
|
||||
void ViewScrFigure(ptRoot)
|
||||
|
||||
Figure *ptRoot;
|
||||
|
||||
{
|
||||
fprintf(stdout,"Les LIGNES de la figure : \n\n");
|
||||
ViewScrLine(ptRoot->LINE);
|
||||
fprintf(stdout,"Les SIGNAUX de la figure : \n\n");
|
||||
ViewScrSignal(ptRoot->SIG);
|
||||
fprintf(stdout,"Les CONNECTEURS de la figure : \n\n");
|
||||
ViewScrCon(ptRoot->CON);
|
||||
fprintf(stdout,"Les TRANSPARENCES de la figure : \n\n");
|
||||
ViewScrSegment(ptRoot->ALLOW);
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Chaine de CAO & VLSI Alliance */
|
||||
/* */
|
||||
/* Produit : STANDAD CELLS ROUTER */
|
||||
/* Fichier : ViewDataBase.h */
|
||||
/* */
|
||||
/* (c) copyright 1991 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* Tous droits reserves */
|
||||
/* Support : e-mail cao-vlsi@masi.ibp.fr */
|
||||
/* */
|
||||
/* Auteur(s) : El housseine REJOUAN le : 26/10/1991 */
|
||||
/* */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* Modifie par : le : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
extern char *DecodLayer();
|
||||
extern void ViewScrSegment();
|
||||
extern void ViewScrCon();
|
||||
extern void ViewScrInstance();
|
||||
extern void ViewScrSignal();
|
||||
extern void ViewScrLine();
|
||||
extern void ViewScrFigure();
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* CAO & VLSI's cad tools chain Alliance */
|
||||
/* */
|
||||
/* Product : main.h */
|
||||
/* File : @(#) */
|
||||
/* Contents : */
|
||||
/* */
|
||||
/* (c) Copyright 1992 Laboratoire MASI equipe CAO & VLSI */
|
||||
/* All rights reserved */
|
||||
/* Hot line : cao-vlsi@masi.ibp.fr (e-mail) */
|
||||
/* */
|
||||
/* Author(s) : El housseine REJOUAN Date : 22/08/1992 */
|
||||
/* Modified by : Date : ../../.... */
|
||||
/* Modified by : Date : ../../.... */
|
||||
/* Modified by : Date : ../../.... */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
typedef struct Option
|
||||
{
|
||||
char *ChannelName;
|
||||
char *InputFileName;
|
||||
char *OutputFileName;
|
||||
BOOLEAN Placer;
|
||||
BOOLEAN Router;
|
||||
int SupplyRecall;
|
||||
int Row;
|
||||
int Iteration;
|
||||
}OptionList;
|
||||
|
||||
typedef struct XSupplyRecall
|
||||
{
|
||||
struct XSupplyRecall *NEXT;
|
||||
long X;
|
||||
}XSupplyRecallList;
|
||||
/******************************************************************************/
|
||||
/* Variables Globales */
|
||||
/******************************************************************************/
|
||||
char *NameVdd;
|
||||
char *NameVss;
|
|
@ -0,0 +1,151 @@
|
|||
diff -Naur sources/patch2.patch ../../alliance-4.0-patchd/sources/patch2.patch
|
||||
--- sources/patch2.patch 1970-01-01 09:00:00.000000000 +0900
|
||||
+++ ../../alliance-4.0-patchd/sources/patch2.patch 2017-03-06 18:52:25.604945300 +0900
|
||||
@@ -0,0 +1,5 @@
|
||||
+diff -r ../sources-old/scr/SCR_Type.h scr/SCR_Type.h
|
||||
+68c68
|
||||
+< # define MIDDLESUPPLY ((long ) 2 * SCALE_X)
|
||||
+---
|
||||
+> # define MIDDLESUPPLY ((long ) 3 * SCALE_X)
|
||||
diff -Naur sources/scr/main.c ../../alliance-4.0-patchd/sources/scr/main.c
|
||||
--- sources/scr/main.c 2017-03-06 18:55:30.274247300 +0900
|
||||
+++ ../../alliance-4.0-patchd/sources/scr/main.c 2017-03-06 18:52:37.108768700 +0900
|
||||
@@ -494,7 +494,7 @@
|
||||
for (CurrentLine = ptFig->LINE; CurrentLine; CurrentLine = CurrentLine->NEXT) {
|
||||
if (CurrentLine->TYPE == CELL) {
|
||||
CurrentInst = CurrentLine->INS;
|
||||
- if (Xab1Figure != CurrentInst->X) {
|
||||
+ if (Xab1Figure + NewInstWidth <= CurrentInst->X) {
|
||||
CurrentInst = CreateInstance(ScrNameIndex("row",(*Counter)++),
|
||||
NewphIns->NAME,Xab1Figure,CurrentLine->Y,
|
||||
NewInstWidth,NewInstHeight,NOSYM);
|
||||
@@ -505,7 +505,7 @@
|
||||
CurrentLine->ALLOW = addchain(CurrentLine->ALLOW,(char *)ptNewAllow);
|
||||
}
|
||||
while (CurrentInst->NEXT) {
|
||||
- if ((CurrentInst->X + CurrentInst->WIDTH) !=
|
||||
+ if ((CurrentInst->X + CurrentInst->WIDTH) + NewInstWidth <=
|
||||
(NextInst = CurrentInst->NEXT)->X) {
|
||||
PrevInst = CurrentInst;
|
||||
CurrentInst = CreateInstance(ScrNameIndex("row",(*Counter)++),
|
||||
@@ -521,7 +521,7 @@
|
||||
}
|
||||
else CurrentInst = CurrentInst->NEXT;
|
||||
}
|
||||
- while ((CurrentInst->X + CurrentInst->WIDTH) != Xab2Figure) {
|
||||
+ while ((CurrentInst->X + CurrentInst->WIDTH) + NewInstWidth <= Xab2Figure) {
|
||||
CurrentInst->NEXT = CreateInstance(ScrNameIndex("row",(*Counter)++),
|
||||
NewphIns->NAME,
|
||||
CurrentInst->X + CurrentInst->WIDTH,
|
||||
@@ -768,6 +768,7 @@
|
||||
char Buffer[10];
|
||||
long IndexSignal = 0;
|
||||
long ChannelNumber = 0;
|
||||
+ static long Counter = 0;
|
||||
|
||||
for (ptScrLine = ptfig->LINE; ptScrLine; ptScrLine = ptScrLine->NEXT)
|
||||
{
|
||||
@@ -850,11 +851,11 @@
|
||||
for (CurrentSeg = ptScrChannel->V_SEGMENT; CurrentSeg;
|
||||
CurrentSeg = CurrentSeg->NextSeg) {
|
||||
if ((Y1Symbolic = CurrentSeg->Y1Seg) == 0)
|
||||
- Y1Segment = Yab1 - ((SXMODE && !L3MODE) ? CELLAB/2:0);
|
||||
+ Y1Segment = Yab1 - ((SXMODE && !L3MODE) ? CELLAB*40/50:0);
|
||||
else
|
||||
Y1Segment = ((Y1Symbolic - 1) * PITCH_Y) + SOUTHOFFSET + YLine;
|
||||
if ((Y2Symbolic = CurrentSeg->Y2Seg) == ChannelHeight + 1)
|
||||
- Y2Segment = Yab2 + ((SXMODE && !L3MODE)? CELLAB/2:0);
|
||||
+ Y2Segment = Yab2 + ((SXMODE && !L3MODE)? CELLAB*40/50:0);
|
||||
else
|
||||
Y2Segment = ((Y2Symbolic - 1) * PITCH_Y) + SOUTHOFFSET + YLine;
|
||||
X1Segment = X2Segment = ((CurrentSeg->X1Seg - 1) * PITCH_X) + WESTOFFSET + Xab1;
|
||||
@@ -1131,6 +1132,7 @@
|
||||
ALU1,VSSWIDTH);
|
||||
/* BARRES D'ALIMENTATIONS HORIZONTALES */
|
||||
for (ptXBreak = ptXInsert; ptXBreak; ptXBreak = ptXBreak->NEXT) {
|
||||
+ long xins;
|
||||
X1 = ptXBreak->X;
|
||||
X2 = X1 + VerticalChannelWidth;
|
||||
X3 = X1 + RIGHTSUPPLY + (VddWidth / 2);
|
||||
@@ -1141,6 +1143,16 @@
|
||||
ptMbkRoot->PHSEG = addphseg(ptMbkRoot,ALU1,VDDWIDTH,X1,Y2,X2,Y2,NameVdd);
|
||||
bigvia(ptMbkRoot, CONT_VIA,X3, Y2, VddWidth, VDDWIDTH);
|
||||
bigvia(ptMbkRoot, CONT_VIA,X4, Y1, VssWidth, VSSWIDTH);
|
||||
+ for(xins=X1; xins+10*SCALE_X <= X2; xins += 10*SCALE_X) {
|
||||
+ addphins(ptMbkRoot,"tie_x0",ScrNameIndex("tiefeed",Counter++),
|
||||
+ NOSYM,
|
||||
+ xins,ptScrLine->Y);
|
||||
+ }
|
||||
+ for(; xins+5*SCALE_X <= X2; xins += 5*SCALE_X) {
|
||||
+ addphins(ptMbkRoot,"rowend_x0",ScrNameIndex("tiefeed",Counter++),
|
||||
+ NOSYM,
|
||||
+ xins,ptScrLine->Y);
|
||||
+ }
|
||||
/*
|
||||
if (L3MODE)
|
||||
{
|
||||
@@ -1600,6 +1612,16 @@
|
||||
fprintf(stderr,"Get the transparencies model ...\n");
|
||||
# endif
|
||||
|
||||
+ NewphIns = getphfig((SXMODE ? "tie_x0":"tie_y"),'A');
|
||||
+ sx2sc (NewphIns);
|
||||
+
|
||||
+
|
||||
+# ifdef SCR_DEBUG
|
||||
+ fprintf(stderr,"Complete rows ...\n");
|
||||
+# endif
|
||||
+
|
||||
+ CompleteLine(ptfig,NewphIns,&CounterInst);
|
||||
+
|
||||
NewphIns = getphfig((SXMODE ? "rowend_x0":"tie_y"),'A');
|
||||
sx2sc (NewphIns);
|
||||
|
||||
@@ -1610,6 +1632,8 @@
|
||||
|
||||
CompleteLine(ptfig,NewphIns,&CounterInst);
|
||||
|
||||
+ NewphIns = getphfig((SXMODE ? "tie_x0":"tie_y"),'A');
|
||||
+ sx2sc (NewphIns);
|
||||
# ifdef SCR_DEBUG
|
||||
fprintf(stderr,"In ViewDataBase \n");
|
||||
ViewScrFigure(ptfig);
|
||||
@@ -1619,6 +1643,15 @@
|
||||
|
||||
if (ptOption->SupplyRecall != 0)
|
||||
ptXInsertList = PreparVerticalChannel(ptfig, NewphIns, ptOption->SupplyRecall, &CounterInst);
|
||||
+ else
|
||||
+ if (LeadPlaceConList && (LeadPlaceConList->VER_FEED != 0))
|
||||
+ ptXInsertList = PreparVerticalChannel(ptfig, NewphIns, 1, &CounterInst);
|
||||
+
|
||||
+ NewphIns = getphfig((SXMODE ? "rowend_x0":"tie_y"),'A');
|
||||
+ sx2sc (NewphIns);
|
||||
+
|
||||
+ if (ptOption->SupplyRecall != 0)
|
||||
+ ptXInsertList = PreparVerticalChannel(ptfig, NewphIns, ptOption->SupplyRecall, &CounterInst);
|
||||
else
|
||||
if (LeadPlaceConList && (LeadPlaceConList->VER_FEED != 0))
|
||||
ptXInsertList = PreparVerticalChannel(ptfig, NewphIns, 1, &CounterInst);
|
||||
diff -Naur sources/scr/ScrSesame.c ../../alliance-4.0-patchd/sources/scr/ScrSesame.c
|
||||
--- sources/scr/ScrSesame.c 2017-03-06 18:55:30.258623000 +0900
|
||||
+++ ../../alliance-4.0-patchd/sources/scr/ScrSesame.c 2017-03-06 18:52:37.171269700 +0900
|
||||
@@ -117,6 +117,7 @@
|
||||
for (CurrentphIns = ptphIns; CurrentphIns; CurrentphIns = CurrentphIns->NEXT) {
|
||||
/*if (!(incatalogfeed(CurrentphIns->FIGNAME))) {*/
|
||||
if (strcmp(CurrentphIns->FIGNAME,(SXMODE ? "rowend_x0":"tie_y"))) {
|
||||
+// if (strcmp(CurrentphIns->FIGNAME,(SXMODE ? "tie_x0":"tie_y"))) {
|
||||
for (CurrentloIns = ptloIns; CurrentloIns; CurrentloIns = CurrentloIns->NEXT)
|
||||
if (CurrentloIns->INSNAME == CurrentphIns->INSNAME) break;
|
||||
if (CurrentloIns == NULL) {
|
||||
diff -Naur sources/scr/SCR_Type.h ../../alliance-4.0-patchd/sources/scr/SCR_Type.h
|
||||
--- sources/scr/SCR_Type.h 2017-03-06 18:55:30.227372000 +0900
|
||||
+++ ../../alliance-4.0-patchd/sources/scr/SCR_Type.h 2017-03-06 18:52:37.108768700 +0900
|
||||
@@ -65,7 +65,7 @@
|
||||
# define VSSWIDTH ((long ) (SXMODE ? 6:8) * SCALE_X)
|
||||
# define RIGHTSUPPLY (PITCH_X / (SXMODE ? 1:2))
|
||||
# define LEFTSUPPLY (PITCH_X / (SXMODE ? 1:2))
|
||||
-# define MIDDLESUPPLY ((long ) 2 * SCALE_X)
|
||||
+# define MIDDLESUPPLY ((long ) 3 * SCALE_X)
|
||||
# define CELLAB ((long ) 50 * SCALE_X)
|
||||
|
||||
typedef struct SCR_Figure
|
|
@ -0,0 +1,313 @@
|
|||
%{
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
# include <mut.h>
|
||||
# include <mlo.h>
|
||||
# include <mph.h>
|
||||
# include <apr.h>
|
||||
#include "SCR_Type.h"
|
||||
|
||||
char *con_name;
|
||||
long vect_begin;
|
||||
long vect_end;
|
||||
long vect_flag = 0;
|
||||
char con_orient;
|
||||
long con_order;
|
||||
long order_begin;
|
||||
long order_end;
|
||||
char buffer[256];
|
||||
|
||||
extern PlaceConList *LeadPlaceConList;
|
||||
/******************************************************************************/
|
||||
/* PROTOTYPES */
|
||||
/******************************************************************************/
|
||||
CaracConList *MakeCaracConList();
|
||||
PlaceConList *MakePlaceConList();
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
|
||||
int tpllineno=1;
|
||||
%}
|
||||
|
||||
%union
|
||||
{
|
||||
char cara;
|
||||
long valu;
|
||||
char *text;
|
||||
}
|
||||
|
||||
%token <valu> M_PLACE_PHCON_NORTH
|
||||
%token <valu> M_PLACE_PHCON_SOUTH
|
||||
%token <valu> M_PLACE_PHCON_WEST
|
||||
%token <valu> M_PLACE_PHCON_EAST
|
||||
%token <valu> M_VER_FEED_THROUGH
|
||||
%token <valu> M_HOR_FEED_THROUGH
|
||||
%token <valu> Semicolon
|
||||
%token <valu> Colon
|
||||
%token <valu> Coma
|
||||
%token <text> Identifier
|
||||
%token <valu> Number
|
||||
%token <valu> Lparen
|
||||
%token <valu> Rparen
|
||||
%token <valu> Lcro
|
||||
%token <valu> Rcro
|
||||
|
||||
%start placement
|
||||
|
||||
%%
|
||||
placement
|
||||
: ldirective
|
||||
;
|
||||
|
||||
ldirective
|
||||
:
|
||||
ldirective
|
||||
directive
|
||||
| directive
|
||||
;
|
||||
|
||||
directive :
|
||||
M_PLACE_PHCON_NORTH
|
||||
{ con_orient = 'N'; vect_flag = 0; }
|
||||
name
|
||||
order
|
||||
Semicolon
|
||||
| M_PLACE_PHCON_SOUTH
|
||||
{ con_orient = 'S'; vect_flag = 0; }
|
||||
name
|
||||
order
|
||||
Semicolon
|
||||
| M_PLACE_PHCON_WEST
|
||||
{ con_orient = 'W'; vect_flag = 0; }
|
||||
name
|
||||
order
|
||||
Semicolon
|
||||
| M_PLACE_PHCON_EAST
|
||||
{ con_orient = 'E'; vect_flag = 0; }
|
||||
name
|
||||
order
|
||||
Semicolon
|
||||
| M_VER_FEED_THROUGH
|
||||
Number
|
||||
Semicolon
|
||||
{ if (LeadPlaceConList == NULL) {
|
||||
LeadPlaceConList = (PlaceConList *) mbkalloc (sizeof(PlaceConList));
|
||||
LeadPlaceConList->NORTH_CON = NULL;
|
||||
LeadPlaceConList->SOUTH_CON = NULL;
|
||||
LeadPlaceConList->WEST_CON = NULL;
|
||||
LeadPlaceConList->EAST_CON = NULL;
|
||||
LeadPlaceConList->VER_FEED = $2;
|
||||
LeadPlaceConList->HOR_FEED = 0;
|
||||
}
|
||||
else LeadPlaceConList->VER_FEED = $2;
|
||||
}
|
||||
| M_HOR_FEED_THROUGH
|
||||
Number
|
||||
Semicolon
|
||||
{ if (LeadPlaceConList == NULL) {
|
||||
LeadPlaceConList = (PlaceConList *) mbkalloc (sizeof(PlaceConList));
|
||||
LeadPlaceConList->NORTH_CON = NULL;
|
||||
LeadPlaceConList->SOUTH_CON = NULL;
|
||||
LeadPlaceConList->WEST_CON = NULL;
|
||||
LeadPlaceConList->EAST_CON = NULL;
|
||||
LeadPlaceConList->VER_FEED = 0;
|
||||
LeadPlaceConList->HOR_FEED = $2;
|
||||
}
|
||||
else LeadPlaceConList->HOR_FEED = $2;
|
||||
}
|
||||
;
|
||||
|
||||
name
|
||||
:
|
||||
Identifier
|
||||
{ con_name = $1; }
|
||||
| Identifier
|
||||
Lcro
|
||||
Number
|
||||
Rcro
|
||||
{sprintf(buffer,"%s %ld", $1, $3);
|
||||
con_name = namealloc(buffer);
|
||||
}
|
||||
| Identifier
|
||||
Lparen
|
||||
Number
|
||||
Rparen
|
||||
{sprintf(buffer,"%s %ld", $1, $3);
|
||||
con_name = namealloc(buffer);
|
||||
}
|
||||
| Identifier
|
||||
Lparen
|
||||
Number
|
||||
Colon
|
||||
Number
|
||||
Rparen
|
||||
{ con_name = $1, vect_begin = $3; vect_end = $5; vect_flag = 1; }
|
||||
| Identifier
|
||||
Lcro
|
||||
Number
|
||||
Colon
|
||||
Number
|
||||
Rcro
|
||||
{ con_name = $1, vect_begin = $3; vect_end = $5; vect_flag = 1; }
|
||||
;
|
||||
|
||||
order
|
||||
:
|
||||
Number
|
||||
{long j = 0;
|
||||
con_order = $1;
|
||||
if ((vect_flag == 1) && (con_order == -1)) {
|
||||
if (vect_begin < vect_end) {
|
||||
for(j = vect_begin ; j <= vect_end ; j++) {
|
||||
sprintf(buffer,"%s %ld",con_name,j);
|
||||
LeadPlaceConList = MakePlaceConList(con_orient,buffer,con_order);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(j = vect_begin ; j >= vect_end ; j--) {
|
||||
sprintf(buffer,"%s %ld",con_name,j);
|
||||
LeadPlaceConList = MakePlaceConList(con_orient,buffer,con_order);
|
||||
}
|
||||
}
|
||||
vect_flag = 0;
|
||||
}
|
||||
else
|
||||
LeadPlaceConList = MakePlaceConList(con_orient,con_name,con_order);
|
||||
}
|
||||
| Number
|
||||
Colon
|
||||
Number
|
||||
{long i = 0; long j = 0;
|
||||
order_begin = $1; order_end = $3;
|
||||
if (LABS(order_begin,order_end) != LABS(vect_begin,vect_end))
|
||||
yyerror();
|
||||
else {
|
||||
if (vect_begin < vect_end) {
|
||||
if (order_begin < order_end) {
|
||||
for(j = vect_begin, i = order_begin ; i <= order_end ; j++, i++) {
|
||||
sprintf(buffer,"%s %ld",con_name,j);
|
||||
LeadPlaceConList = MakePlaceConList(con_orient,buffer,i);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(j = vect_begin, i = order_begin ; i >= order_end ; j++, i--) {
|
||||
sprintf(buffer,"%s %ld",con_name,j);
|
||||
LeadPlaceConList = MakePlaceConList(con_orient,buffer,i);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (order_begin < order_end) {
|
||||
for(j = vect_begin, i = order_begin ; i <= order_end ; j--, i++) {
|
||||
sprintf(buffer,"%s %ld",con_name,j);
|
||||
LeadPlaceConList = MakePlaceConList(con_orient,buffer,i);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(j = vect_begin, i = order_begin ; i >= order_end ; j--, i--) {
|
||||
sprintf(buffer,"%s %ld",con_name,j);
|
||||
LeadPlaceConList = MakePlaceConList(con_orient,buffer,i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
%%
|
||||
|
||||
yyerror()
|
||||
{
|
||||
fprintf(stdout,"SYNTAX ERROR at line %d \n",tpllineno);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
yywrap() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : MakeCaracConList() le 17 juillet 1993 */
|
||||
/******************************************************************************/
|
||||
CaracConList *MakeCaracConList(LeadCaracConList, Name, OrderSlice)
|
||||
CaracConList *LeadCaracConList;
|
||||
char *Name;
|
||||
long OrderSlice;
|
||||
|
||||
{
|
||||
CaracConList *ptNewPhCon = NULL;
|
||||
CaracConList *CurPhCon = NULL;
|
||||
CaracConList *PrevPhCon = NULL;
|
||||
|
||||
ptNewPhCon = (CaracConList *) mbkalloc (sizeof(CaracConList));
|
||||
ptNewPhCon->NEXT = NULL;
|
||||
ptNewPhCon->NAME = namealloc(Name);
|
||||
ptNewPhCon->USER = OrderSlice;
|
||||
|
||||
if (LeadCaracConList == NULL) return(ptNewPhCon) ;
|
||||
for(PrevPhCon = NULL, CurPhCon = LeadCaracConList; (CurPhCon && (OrderSlice > CurPhCon->USER));
|
||||
PrevPhCon = CurPhCon, CurPhCon = CurPhCon->NEXT);
|
||||
if (OrderSlice != -1) {
|
||||
if (CurPhCon && (OrderSlice == CurPhCon->USER)) {
|
||||
fprintf(stdout,"The connectors ( %s ) and ( %s ) have a same order\n", CurPhCon->NAME, Name);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if (PrevPhCon == NULL ) {
|
||||
ptNewPhCon->NEXT = LeadCaracConList;
|
||||
LeadCaracConList = ptNewPhCon;
|
||||
}
|
||||
else {
|
||||
ptNewPhCon->NEXT = CurPhCon;
|
||||
PrevPhCon->NEXT = ptNewPhCon;
|
||||
}
|
||||
return(LeadCaracConList);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* Function : MakePlaceConList() le 17 juillet 1993 */
|
||||
/******************************************************************************/
|
||||
PlaceConList *MakePlaceConList(Side, ConName, OrderSlice)
|
||||
char Side;
|
||||
char *ConName;
|
||||
long OrderSlice;
|
||||
|
||||
{
|
||||
|
||||
if (isvdd(ConName)) {
|
||||
fprintf(stdout,"scr_warning : The power connector %s is placed automatically by scr.\n",ConName);
|
||||
return(LeadPlaceConList);
|
||||
}
|
||||
else
|
||||
if (isvss(ConName)) {
|
||||
fprintf(stdout,"scr_warning : The ground connector %s is placed automatically by scr.\n",ConName);
|
||||
return(LeadPlaceConList);
|
||||
}
|
||||
|
||||
if (LeadPlaceConList == NULL) {
|
||||
LeadPlaceConList = (PlaceConList *) mbkalloc (sizeof(PlaceConList));
|
||||
LeadPlaceConList->NORTH_CON = NULL;
|
||||
LeadPlaceConList->SOUTH_CON = NULL;
|
||||
LeadPlaceConList->WEST_CON = NULL;
|
||||
LeadPlaceConList->EAST_CON = NULL;
|
||||
LeadPlaceConList->VER_FEED = 0;
|
||||
LeadPlaceConList->HOR_FEED = 0;
|
||||
}
|
||||
if (Side == 'N')
|
||||
LeadPlaceConList->NORTH_CON = MakeCaracConList(LeadPlaceConList->NORTH_CON,ConName,OrderSlice);
|
||||
else
|
||||
if (Side == 'S')
|
||||
LeadPlaceConList->SOUTH_CON = MakeCaracConList(LeadPlaceConList->SOUTH_CON,ConName,OrderSlice);
|
||||
else
|
||||
if (Side == 'W')
|
||||
LeadPlaceConList->WEST_CON = MakeCaracConList(LeadPlaceConList->WEST_CON,ConName,OrderSlice);
|
||||
else
|
||||
if (Side == 'E')
|
||||
LeadPlaceConList->EAST_CON = MakeCaracConList(LeadPlaceConList->EAST_CON,ConName,OrderSlice);
|
||||
return(LeadPlaceConList);
|
||||
}
|
||||
/******************************************************************************/
|
|
@ -0,0 +1,40 @@
|
|||
%{
|
||||
#include <stdio.h>
|
||||
#include "scr_grammar.h"
|
||||
#include <mut.h>
|
||||
extern int tpllineno ;
|
||||
%}
|
||||
|
||||
%%
|
||||
[Pp][Ll][Aa][Cc][Ee]_[Pp][Hh][Cc][Oo][Nn]_[Nn][Oo][Rr][Tt][Hh] {
|
||||
return (M_PLACE_PHCON_NORTH);}
|
||||
[Pp][Ll][Aa][Cc][Ee]_[Pp][Hh][Cc][Oo][Nn]_[Ss][Oo][Uu][Tt][Hh] {
|
||||
return (M_PLACE_PHCON_SOUTH);}
|
||||
[Pp][Ll][Aa][Cc][Ee]_[Pp][Hh][Cc][Oo][Nn]_[Ww][Ee][Ss][Tt] {
|
||||
return (M_PLACE_PHCON_WEST);}
|
||||
[Pp][Ll][Aa][Cc][Ee]_[Pp][Hh][Cc][Oo][Nn]_[Ee][Aa][Ss][Tt] {
|
||||
return (M_PLACE_PHCON_EAST);}
|
||||
[Vv][Ee][Rr]_[Ff][Ee][Ee][Dd]_[Tt][Hh][Rr][Oo][Uu][Gg][Hh] {
|
||||
return (M_VER_FEED_THROUGH);}
|
||||
[Hh][Oo][Rr]_[Ff][Ee][Ee][Dd]_[Tt][Hh][Rr][Oo][Uu][Gg][Hh] {
|
||||
return (M_HOR_FEED_THROUGH);}
|
||||
[0-9\-]+ {
|
||||
sscanf(yytext,"%d",&(yylval.valu));
|
||||
return(Number);
|
||||
}
|
||||
|
||||
[a-zA-Z][a-zA-Z0-9\._]* {
|
||||
yylval.text = namealloc (yytext);
|
||||
return(Identifier);
|
||||
}
|
||||
\[ { return(Lcro); }
|
||||
\] { return(Rcro); }
|
||||
\( { return(Lparen); }
|
||||
\) { return(Rparen); }
|
||||
\, { return (Coma); }
|
||||
\; { return (Semicolon); }
|
||||
: { return (Colon); }
|
||||
[ \t] ;
|
||||
\n {tpllineno++;}
|
||||
#.*$ ;
|
||||
%%
|
Loading…
Reference in New Issue