This commit was generated by cvs2svn to track changes on a CVS vendor

branch.
This commit is contained in:
Franck Wajsburt 2002-04-09 11:20:14 +00:00
commit 2a31b2cec1
19 changed files with 4810 additions and 0 deletions

View File

@ -0,0 +1,3 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = doc src

View File

@ -0,0 +1,33 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/postrat.c)
S2R_MAJOR_VERSION=4
S2R_MINOR_VERSION=0
S2R_VERSION=$S2R_MAJOR_VERSION.$S2R_MINOR_VERSION
AC_SUBST(S2R_MAJOR_VERSION)
AC_SUBST(S2R_MINOR_VERSION)
AC_SUBST(S2R_VERSION)
# For automake.
VERSION=$S2R_VERSION
PACKAGE=s2r
dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_MAKE_SET
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AM_ALLIANCE
AC_OUTPUT([
Makefile
doc/Makefile
src/Makefile
])

View File

@ -0,0 +1,4 @@
## Process this file with automake to produce Makefile.in
man_MANS = s2r.1
EXTRA_DIST = $(man_MANS)

174
alliance/src/s2r/doc/s2r.1 Normal file
View File

@ -0,0 +1,174 @@
.\" $Id: s2r.1,v 1.1 2002/04/09 11:20:14 franck Exp $
.\" @(#)Labo.l 0.0 90/21/08 UPMC; Author: Fr'ed'eric P'etrot & Franck Wajsburt
.TH S2R 1 "October 1, 1997" "ASIM/LIP6" "ALLIANCE USER COMMANDS"
.SH NAME
.TP
s2r
\- Process mapping from symbolic layout to physical layout
.SH SYNOPSIS
.TP
\fBs2r\fP [\fB-sc1rv\fP] \fIsource\fP [\fIresult\fP]
.so man1/alc_origin.1
.SH DESCRIPTION
The goal of \fBs2r\fP is to perform the translation from the symbolic layout
to physical layout for the foundry.
\fBs2r\fP uses a technolgy file whose name is defined by the environnement
variable RDS_TECHNO_NAME.
.br
Some cells, like I/O pads, are specific to a given foundry.
In the symbolic methodology, these cells are phantom cells.
It means that only their abutment box and and connectors are present.
\fBs2r\fP wil substitute physical cells to the symbolic phamtom cells.
Beware, this implies that the manufacturer cells must be modified by hand to
ensure the abutment box is a symbolic grid step multiple, and that the
real connectors are centered on symbolic grid.
.br
In order for the replacement to work well, the physicals cells must have
the abutment box lower left corner at coordinate (0,0)
The name of cells to be replaced are written in the catalog file with the
G attribute, see \fBcatal\fP(5) for details on that file.
See also \fBring\fP(1) for more on pads.
Ouput can be generated in either cif or gds formats, to fit the manufacturer
requirements.
.br
.LP
Mainly two kinds of users are concerned with \fBs2r\fP :
.TP 21
experts
they should be able to parametrize the technology file for a new process
technology file is described in \fBtechno(5)\fP.
.TP
designers
they are not directly concerned with the target process, but need to be able to
compute real capacitances for simulation.
.PP
The \fIsource\fP argument is the name of the symbolic layout file to be
translated.
The optional \fIresult\fP argument indicates the name to be given to the real
layout output.
This name is also the name of the top level model of the layout hierarchy.
If \fIresult\fP name is omitted, then \fIsource\fP name is used.
.PP
Six environment variables must be set for proper usage of \fBs2r\fP,
all of them having default values, thus ensuring the possibility of using it
``as it is''.
.TP 21
MBK_IN_PH
The input format for symbolic layout is given by this environment variable.
The possible values are \fI cp, ap\fP. Default is \fIcp\fP.
See \fBMBK_IN_PH\fP(1) for details.
.TP
MBK_CATA_LIB
Sets the directories that are to be searched thru for reading files.
The seaching mecanism first look in MBK_WORK_LIB(1)
MBK_WORK_LIB
defines the path where the generated file is saved.
Make sure the write permissions are set up correctly, otherwise no save
will occur.
.TP
MBK_CATAL_NAME
This indicates the name of the catalog file used for pad substitution.
For the appropriate syntax of this file, see \fBcatal\fP(5).
.TP
RDS_IN
Defines the format to be used as input for cell substitution.
The available ones are \fIcif\fP and \fIgds\fP (default one).
The cells to be parsed must not containt 45
.ie t \(de
.el degrees
wires. If an unknown layer is encountered, the entire cell will be skipped.
.TP
RDS_OUT
Gives the format of the output file.
This may be either \fIcif\fP or \fIgds\fP (default is \fIgds\fP).
.TP
RDS_TECHNO_NAME
This points to the technology file to be used for symbolic to real translation.
This file is in general shared between all the designers.
it is the full path name to the file location, with the extension.
.SH OPTIONS
Without option, \fBs2r\fP should produce a layout that fits for the foundry.
Nevertheless, its behaviour can be modified when invoked with the
following options:
.TP 21
\-s
Suppress the denotching phase. \fBs2r\fP performs gap filling, denotching
in order to avoid DRC errors. This operation is time consuming.
It is mandatory for the foundry but not really useful for capacitance
evaluation.
.TP
\-c
Deletes connectors and node names at all hierarchy level.
Theses objects link the physical view and the logical view of a chip.
If simulation is to be done after physical mapping, connectors must appear,
so that the extractors and simulators can use them.
This must \fInot\fP be used when preparing a final layout for the foundry.
.br
For the factory, the top level connectors are forbidden, since they do not
represent any physical reality.
.TP
\-1
Creates the top level cell with the instances as black boxes.
This may be useful for hierarchical extractors, since the file size may be
greatly reduced.
.TP
\-r
does not replace black boxes.
Cells flagged with the \fBG\fP attribute in the \fBcatal\fP(5) file will not
be replaced by their equivalent layout loaded from disk.
.TP
\-v
verbose mode on.
.SH EXAMPLES
.RS
You should first have a correct execution environment :
.br
It is recommanded to put it in the ``.cshrc'' file if in c shell, as in the
example below.
.RE
.br
.ie t \{\
.ft CR \}
.el \fB
.ta 30n
.nf
setenv MBK_IN_PH ap
setenv MBK_WORK_LIB ~fred/mbk/layout
setenv MBK_CATA_LIB ~franck/s2r:/alliance/cells
setenv MBK_CATAL_NAME catalog
setenv RDS_TECHNO_NAME /labo/etc/prol15.rds
setenv RDS_IN gds
setenv RDS_OUT gds
s2r -c na2_y
.fi
.ft R
.RS
This invocation will produce the cell \fBna2_y\fP from the standard cell
library in real layout, without connectors, scotches if needed, in gds format.
.RE
.SH SEE ALSO
.BR mbk (1),
.BR ring(1),
.BR MBK_IN_PH (1),
.BR MBK_CATA_LIB (1),
.BR MBK_WORK_LIB (1),
.BR MBK_CATAL_NAME (1),
.BR RDS_IN (1),
.BR RDS_OUT (1),
.BR RDS_TECHNO_NAME (1),
.BR techno(5),
.BR catal(5).
.SH DIAGNOSTICS
.br
The actual version of the gds parser and driver doesn't translate neither
connectors, nor node names.
If an extraction on s2r output is needed, cif format will create the
connectors using cif extension \fB4X\fP, and the node names with \fB4N\fP.
.so man1/alc_bug_report.1

View File

@ -0,0 +1,15 @@
## Process this file with automake to produce Makefile.in
bin_PROGRAMS = s2r
CFLAGS = @CFLAGS@ @ALLIANCE_CFLAGS@
s2r_LDADD = @ALLIANCE_LIBS@ \
-lMpu -lMcp -lMap -lMmg \
-lRtl -lRgs -lRcf -lRfm -lRpr -lRwi -lRut -lRds\
-lMph -lMut
s2r_SOURCES = generic.h hash.h maxima.h merge.h\
postrat.h rdsacces.h statistics.c hash.c\
main.c merge.c postrat.c rdsacces.c\
statistics.h

View File

@ -0,0 +1,29 @@
/*
* 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.
*/
# include <stdio.h>
# include <math.h>
# include <stdlib.h>
# include <string.h>
# include <time.h>

107
alliance/src/s2r/src/hash.c Normal file
View File

@ -0,0 +1,107 @@
/*
* 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.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "hash.h"
static int primes[] = {
101, 223, 311, 419, 547, 659, 727, 877, 967,
1061, 2053, 3299, 4391, 5309, 6421, 7069, 8543, 9397,
10337, 20143, 32423, 43151, 52223, 63179, 0
};
void htremove (ht_t * htable)
{
int i;
for (i = 1; i < (int)htable[0]; i++)
freechain (htable[i]);
free (htable);
}
ht_t *htinit (int size)
{
int i;
ht_t *htable;
/* prend le premier nombre premier au dela de size */
for (i = 0; primes[i] && (size > primes[i]); i++);
if (primes[i] == 0)
{
fprintf (stderr, "Erreur : hash table trop grande (> %d)\n", primes[i - 1]);
exit (1);
}
size = primes[i];
if ((htable = calloc (size + 1, sizeof (chain_list *))) == NULL)
{
perror ("htinit");
exit (1);
}
htable[0] = (chain_list *) size; /* taille de la table dans premiere case */
return htable;
}
static int hash (ht_t * htable, char *key)
{
int alveole = 0;
int length = strlen (key);
int segment;
int l;
if ((key == NULL) || (length == 0))
{
fprintf (stderr, "Error : hash (NULL)\n");
exit (1);
}
for (l = 0; l < length; l += 2)
{
segment = 0xFFFF & ((key[l] << 8) | key[l + 1]);
alveole = alveole ^ ((segment << 1) | (segment >> 15));
}
alveole %= (int) htable[0]; /* htable[0] == la taille de la table */
return (alveole + 1); /* +1 car on ne doit rien mettre dans case 0 */
}
chain_list *htget (ht_t * htable, char *key)
{
int alveole = hash (htable, key);
chain_list *p;
for (p = htable[alveole]; p && strcmp (p->DATA, key); p = p->NEXT);
return p;
}
chain_list *htset (ht_t * htable, char *key)
{
int alveole = hash (htable, key);
chain_list *p;
for (p = htable[alveole]; p && strcmp (p->DATA, key); p = p->NEXT);
if (p)
return p;
htable[alveole] = addchain (htable[alveole], strdup (key));
return htable[alveole];
}

View File

@ -0,0 +1,37 @@
/*
* 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.
*/
#ifndef HASH_H
#define HASH_H
#include <mut.h>
typedef chain_list *ht_t; /* def d'1 table de hachage table de htele_t */
extern ht_t *htinit (int size);
extern void htremove (ht_t * htable);
extern chain_list *htset (ht_t * htable, char *key);
extern chain_list *htget (ht_t * htable, char *key);
#endif

354
alliance/src/s2r/src/main.c Normal file
View File

@ -0,0 +1,354 @@
/*
* 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.
*/
/****************************************************************************/
/* */
/* ALLIANCE CAO & VLSI CAD */
/* */
/* Product : (S)ymbolic (2)to (R)eal translater */
/* File : main.c */
/* */
/* (c) copyright 1992 MASI laboratory CAO & VLSI team */
/* All Right Reserved */
/* Support : e-mail cao-vlsi@masi.ibp.fr */
/* */
/****************************************************************************/
/* */
/* Main of Symbolic to Real */
/* */
/****************************************************************************/
#ident "@(#)s2r 3.8 30/01/02 ALLIANCE 4.5 (S)ymbolic (2)to (R)eal converter"
#include <string.h>
#include <mph.h>
#include <mut.h>
#include <rds.h>
#include <rwi.h>
#include <rut.h>
#include <rtl.h>
#include <rfm.h>
#include <rpr.h>
#include "generic.h"
#include "rdsacces.h"
#include "statistics.h"
#include "postrat.h"
void Usage (Name)
char *Name;
{
fprintf (stderr, "\tUsage : %s [-cs1trv] source [result]\n\n", Name);
fprintf (stderr, "\tsource\t: filename of symbolic layout circuit\n");
fprintf (stderr, "\t\t to translate to real layout\n");
fprintf (stderr, "\tresult\t: result filename of real layout circuit\n");
fprintf (stderr, "\t\t source name is used, if result is absent\n\n");
fprintf (stderr, "\toptionnal options (any order, any occurence) :\n");
fprintf (stderr, "\t-c\t: deletes top-level (c)onnectors, keeps all others\n");
fprintf (stderr, "\t-C\t: keeps top-level (c)onnectors, deletes all others\n");
fprintf (stderr, "\t-n\t: deletes all signal names, but connectors\n");
fprintf (stderr, "\t-s\t: (s)cotchs are not created\n");
fprintf (stderr, "\t-1\t: only (1) level is translated, all otherwise.\n");
fprintf (stderr, "\t-t\t: layout is just (t)ranslated, not post-treated\n");
fprintf (stderr, "\t-r\t: black boxes are not (r)eplaced\n");
fprintf (stderr, "\t-v\t: (v)erbose mode armed\n");
exit (1);
}
int main (argc, argv)
int argc;
char **argv;
{
rdsfig_list *rds_model;
phfig_list *mbk_model;
/*\
* banner and parameters
\*/
char *source_name = NULL; /* need default values */
char *result_name = NULL; /* need default values */
int root_conn = 1; /* keep top-level figure connectors by default */
int sub_conn = 1; /* keep sub-level figure connectors by default */
int signal_name = 1; /* keep signal names by default */
int scotch_on = 1; /* scotchs are not created by default */
int one_level = 0; /* all hierarchy level translated by default */
int do_post_treat = 1; /* post-treatment is done by default */
int do_replace_cells = 1; /* cells_replacement is done by default */
int verbose = 0; /* verbose mode desarmed by default */
int flat = 0; /* flat mode desarmed by default */
int physical = 0; /* physical mode desarmed by default */
int split_layer = 0; /* split_layer mode desarmed by default */
int shift;
alliancebanner ("s2r", VERSION, "Symbolic to Real layout converter", "2002", ALLIANCE_VERSION);
{
char *debug_env;
if ((debug_env = getenv ("S2RDEBUG")) != NULL)
{
unsigned char v = *debug_env - '0';
s2rdebug = (v <= 9) ? v : 0;
}
}
if (argc < 2)
Usage (argv[0]);
mbkenv ();
rdsenv ();
for (shift = 1; shift < argc; shift++)
{
char *arg = argv[shift];
if (*arg == '-')
{
while (*++arg)
{
switch (*arg)
{
case 'C':
sub_conn = 0;
break;
case 'c':
root_conn = 0;
break;
case 'n':
signal_name = 0;
break;
case 's':
scotch_on = 0;
break;
case '1':
one_level = 1;
break;
case 't':
do_post_treat = 0;
break;
case 'r':
do_replace_cells = 0;
break;
case 'v':
verbose = 1;
break;
case 'l':
split_layer = 1;
break;
case 'f':
flat = 1;
break;
case 'p':
physical = 1;
break;
default:
Usage (argv[0]);
}
}
}
else
{
if (!source_name)
source_name = namealloc (argv[shift]);
else if (!result_name)
{
result_name = namealloc (argv[shift]);
}
else
Usage (argv[0]);
continue;
}
}
if (!source_name)
{
Usage (argv[0]);
}
if (!result_name)
{
result_name = source_name;
}
/*\
* setting environement
* MBK_CATAL_NAME : file where file name to be replaced are put
* MBK_CATA_LIB : where cells, catal file and techno file are
* MBK_WORK_LIB : where result file is written or where techno file is
* WORK_LIB is watched before CATA_LIB
* MBK_WORK_LIB : where result file is placed
* MBK_IN_PH : file format of symbolic figure
* RDS_TECHNO_NAME : techno file name
* RDS_IN : file format of real figures to replace
* RDS_OUT : file format of result file
\*/
/*\
* Read the techno file
\*/
printf ("\n\to loading technology file : %s\n", RDS_TECHNO_NAME);
fflush (stdout);
loadrdsparam ();
/*\
* Read the model file
\*/
if (physical)
{
printf ("\to loading %s level of real layout : %s\n", one_level ? "one" : "all", source_name);
fflush (stdout);
rds_model = getrdsfig (source_name, one_level ? 'P' : 'A', 0);
}
else
{
printf ("\to loading %s level of symbolic layout : %s\n", one_level ? "one" : "all", source_name);
fflush (stdout);
mbk_model = getphfig (source_name, 'A');
if (!root_conn)
mbk_model->PHCON = NULL;
rds_model = S2Rfigmbkrds (mbk_model, one_level ? 0 : 1);
/* Removing symbolic data structure */
printf ("\to removing symbolic data structure \n");
rds_mbk_kill ();
}
/*\
* flattening
\*/
if (flat)
{
printf ("\to flattening figure\n");
rflattenrdsfig (rds_model, RDS_NO, RDS_NO);
}
/*\
* post treatement
\*/
rds_model = rds_model_out (source_name);
if (do_post_treat)
{
printf ("\to layout post-treating\n ");
if (root_conn)
printf ("\t\twith top connectors,\n ");
else
printf ("\t\twithout top connector,\n ");
if (sub_conn)
printf ("\t\twith sub connectors,\n ");
else
printf ("\t\twithout sub connector,\n ");
if (signal_name)
printf ("\t\twith signal names,\n ");
else
printf ("\t\twithout signal name,\n ");
if (scotch_on)
printf ("\t\twith scotchs.\n");
else
printf ("\t\twithout scotch.\n");
post_treat (rds_model, scotch_on, verbose);
fflush (stdout);
}
/*\
* Replace cells
\*/
if (do_replace_cells)
{
replace_cells (verbose);
}
/*\
* save file
\*/
printf ("\to saving %s.%s\n", result_name, RDS_OUT);
rds_model->NAME = result_name;
if (split_layer)
{
char *RDS_CIF_LAYER_TABLE_BAK[RDS_ALL_LAYER][RDS_CIF_LAYER_FIELD];
unsigned char RDS_GDS_LAYER_TABLE_BAK[RDS_ALL_LAYER][RDS_GDS_LAYER_FIELD];
char WORK_LIB_TMP[256];
char WORK_LIB_BAK[256];
int layer;
strcpy (WORK_LIB_BAK, WORK_LIB);
for (layer = 0; layer < RDS_ALL_LAYER; layer++)
{
*strchr (RDS_LAYER_NAME[layer], ' ') = '\0';
RDS_CIF_LAYER_TABLE_BAK[layer][0] = RDS_CIF_LAYER_TABLE[layer][0];
RDS_GDS_LAYER_TABLE_BAK[layer][0] = RDS_GDS_LAYER_TABLE[layer][0];
RDS_GDS_LAYER_TABLE[layer][0] = RDS_GDS_LAYER_EMPTY;
RDS_CIF_LAYER_TABLE[layer][0] = RDS_CIF_LAYER_EMPTY;
}
for (layer = 0; layer < RDS_ALL_LAYER; layer++)
{
if (!strcmp (RDS_OUT, "gds"))
{
if (RDS_GDS_LAYER_TABLE_BAK[layer][0] != RDS_GDS_LAYER_EMPTY)
{
sprintf (WORK_LIB_TMP, "%s/%s/", WORK_LIB_BAK, RDS_LAYER_NAME[layer]);
WORK_LIB = WORK_LIB_TMP;
if (verbose)
{
printf ("\t - %s\n", WORK_LIB);
fflush (stdout);
}
RDS_GDS_LAYER_TABLE[layer][0] = RDS_GDS_LAYER_TABLE_BAK[layer][0];
saverdsfig (rds_model);
RDS_GDS_LAYER_TABLE[layer][0] = RDS_GDS_LAYER_EMPTY;
}
}
else
{
if (RDS_CIF_LAYER_TABLE_BAK[layer][0] != RDS_CIF_LAYER_EMPTY)
{
sprintf (WORK_LIB_TMP, "%s/%s/", WORK_LIB_BAK, RDS_LAYER_NAME[layer]);
WORK_LIB = WORK_LIB_TMP;
if (verbose)
{
printf ("\t - %s\n", WORK_LIB);
fflush (stdout);
}
RDS_CIF_LAYER_TABLE[layer][0] = RDS_CIF_LAYER_TABLE_BAK[layer][0];
saverdsfig (rds_model);
RDS_CIF_LAYER_TABLE[layer][0] = RDS_CIF_LAYER_EMPTY;
}
}
}
}
else
saverdsfig (rds_model);
if (verbose)
print_statistics (scotch_on);
return (0);
}

View File

@ -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 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.
*/
/**********************************************************************
* *
* Definitions to tune the program *
* *
**********************************************************************/
#ifndef MAX_WIN_SEG /* max. number of segments( rectangles) */
#define MAX_WIN_SEG 10000 /* in a window */
#endif
#ifndef MIN_WIN_SEG /* min. number of segments( rectangles) */
#define MIN_WIN_SEG 100 /* in a window */
#endif
#ifndef MRG_EXT_RATIO /* the approx. ratio between the num. */
#define MRG_EXT_RATIO 20 /* of operations done if a rect. is */
/* taken in a widow and the num of */
/* operations done to extract rect. */
#endif
#ifndef BUFFER_SIZE
#define BUFFER_SIZE 255
#endif
#ifndef MAX_STRING_SIZE
#define MAX_STRING_SIZE 30
#endif
#ifndef MAX_FILE_NAME_SIZE
#define MAX_FILE_NAME_SIZE 255
#endif
#ifndef MAX_PHYS_LAYER
#define MAX_PHYS_LAYER 20
#endif

1717
alliance/src/s2r/src/merge.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
/*
* 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.
*/
extern void merge_layer_2 (rdsfig_list *model, int layer_num, int verbose);
extern void merge_layer (rdsfig_list *model, int layer_num, int verbose);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
/*
* 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.
*/
#define TREAT 1
#define NOTREAT 0
extern void post_treat ();
extern void replace_cells ();

View File

@ -0,0 +1,649 @@
/*
* 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.
*/
/****************************************************************************/
/* */
/* ALLIANCE CAO & VLSI CAD */
/* */
/* Product : (S)ymbolic (2)to (R)eal translater */
/* File : rdsacces+.c */
/* */
/* (c) copyright 1992 MASI laboratory CAO & VLSI team */
/* All Right Reserved */
/* Support : e-mail cao-vlsi@masi.ibp.fr */
/* */
/****************************************************************************/
/* */
/* Access functions to the rds database objects */
/* */
/****************************************************************************/
#include "generic.h"
#include <rds.h>
#include <mph.h>
#include <mut.h>
#include <rfm.h>
#include <rpr.h>
#include "rdsacces.h"
#include "statistics.h"
int s2rdebug = 0;
rdsrec_list *Free_List = NULL; /* a global variable pointing to the free list
of rectangles */
void view_rec (rec)
rdsrec_list *rec;
{
viewrdsrec (rec);
}
/****************************************************************************
* rds_rectangle_in: adds the rectangle given by its data to the given list
* and returns a pointer to the new list.
* Before allocating memory for the new rectangle, the free
* list is checked and if it is not empty : we use the memory
* area pointed by the first element of this list.
****************************************************************************/
rdsrec_list *rds_rectangle_in (layer_list, x, y, dx, dy, layer_num, flags, name)
rdsrec_list *layer_list;
long x, y, dx, dy;
int layer_num;
long flags;
char *name;
{
rdsrec_list *npr;
STAT_RECT_REQRD++;
if (Free_List)
npr = pull_free_list ();
else
{
npr = allocrdsrec (0);
STAT_RECT_ALLOC++;
}
flags = flags & 0xFFFFFF00;
npr->NEXT = layer_list;
npr->X = x;
npr->Y = y;
npr->DX = dx;
npr->DY = dy;
npr->FLAGS = flags | (long) (layer_num);
npr->NAME = name;
return layer_list = npr;
}
/****************************************************************************
* rds_instance_in: adds the instance given by its data to the given list
* and returns a pointer to the new list.
****************************************************************************/
rdsins_list *rds_instance_in (instance, model, name, x, y, sym)
rdsins_list *instance;
char *model, *name;
long x, y;
char sym;
{
rdsins_list *npr;
int i;
npr = allocrdsins ();
npr->NEXT = instance;
npr->FIGNAME = namealloc (model);
npr->INSNAME = namealloc (name);
npr->X = x;
npr->Y = y;
npr->TRANSF = sym;
for (i = 0; i < RDS_MAX_LAYER; i++)
npr->COURONNE[i] = NULL;
return instance = npr;
}
/******************************************************************************
* rds_remove_model: removes the model with the specified name from the list
* of models.
****************************************************************************/
void rds_remove_model (name)
char *name;
{
rds_figurep_typ *modelp;
name = namealloc (name);
for (modelp = &(HEAD_RDSFIG); *modelp;)
if ((*modelp)->NAME == name)
*modelp = (*modelp)->NEXT;
/*****************************************************
*** return to system the free memory would be cue ***
*****************************************************/
else
modelp = &((*modelp)->NEXT);
}
/****************************************************************************
* rds_create_model: creates a new model with the given name and adds it to
* the list of models pointed by HeadFigureRds and returns
* a pointer to the created model.
* Note: if the model exists it creates a new model and
* remove the existing one.
****************************************************************************/
rdsfig_list *rds_create_model (name)
char *name;
{
rdsfig_list *npr;
rds_remove_model (name);
npr = allocrdsfig ();
npr->NEXT = HEAD_RDSFIG;
npr->NAME = namealloc (name);
npr->INSTANCE = NULL;
return HEAD_RDSFIG = npr;
}
/******************************************************************************
* rds_model_out: given a model name it returns a pointer to it by inspecting
* the model list pointed by HeadFigureRds.
****************************************************************************/
rdsfig_list *rds_model_out (name)
char *name;
{
rdsfig_list *pt;
name = namealloc (name);
for (pt = HEAD_RDSFIG; pt; pt = pt->NEXT)
if (pt->NAME == name)
return pt;
return NULL;
}
/*****************************************************************************
* rds_instance_out: given an instance name and a pointer to its father model
* it returns a poiner to the instance.
****************************************************************************/
rdsins_list *rds_instance_out (rds_model, name)
rdsfig_list *rds_model;
char *name;
{
rdsins_list *pt;
name = namealloc (name);
for (pt = rds_model->INSTANCE; pt; pt = pt->NEXT)
if (pt->INSNAME == name)
return pt;
return NULL;
}
/*****************************************************************************
* rds_mbk_kill: destroies mbk database. May take time ...
*****************************************************************************/
void rds_mbk_kill ()
{
phfig_list *pt, *pt_next;
for (pt = HEAD_PHFIG; pt; pt = pt_next)
{
pt_next = pt->NEXT;
delphfig (pt->NAME);
}
}
/*******************************************************************************
* mark_remove: marks the given rectangle as to be removed
******************************************************************************/
void mark_remove (rectangle)
rdsrec_list *rectangle;
{
if (!(is_remove (rectangle)))
rectangle->FLAGS += REMOVE;
}
/*******************************************************************************
* demark_flattenres: removes the flag of the given rectangle
******************************************************************************/
void demark_flattenres (rectangle)
rdsrec_list *rectangle;
{
if (is_flattenres (rectangle))
rectangle->FLAGS -= FLATTENRES;
}
/*******************************************************************************
* mark_flattenres: marks the given rectangle as a result of a flatten operation
******************************************************************************/
void mark_flattenres (rectangle)
rdsrec_list *rectangle;
{
if (!(is_flattenres (rectangle)))
rectangle->FLAGS += FLATTENRES;
}
/*******************************************************************************
* demark_used: removes the used flag
******************************************************************************/
void demark_used (rectangle)
rdsrec_list *rectangle;
{
if (is_used (rectangle))
rectangle->FLAGS -= USED;
}
/*******************************************************************************
* mark_used: marks the given rectangle as used
******************************************************************************/
void mark_used (rectangle)
rdsrec_list *rectangle;
{
if (!(is_used (rectangle)))
rectangle->FLAGS += USED;
}
/******************************************************************************
* mark_scotch: marks the given rectangle as a scotch.
******************************************************************************/
void mark_scotch (rectangle)
rdsrec_list *rectangle;
{
if (!(is_scotch (rectangle)))
{
rectangle->FLAGS += SCOTCH;
}
}
/******************************************************************************
* demark_scotch: removes the scotch flag from the rectangle.
******************************************************************************/
void demark_scotch (rectangle)
rdsrec_list *rectangle;
{
if (is_scotch (rectangle))
rectangle->FLAGS -= SCOTCH;
}
/******************************************************************************
* mark_old_scotch: marks the given rectangle as an old scotch
******************************************************************************/
void mark_old_scotch (rectangle)
rdsrec_list *rectangle;
{
if (!(is_old_scotch (rectangle)))
rectangle->FLAGS += OLD_SCOTCH;
}
/*****************************************************************************
* mark_empty: marks the given model at the specified layer as empty
****************************************************************************/
void mark_empty (model, layer_num)
rdsfig_list *model;
int layer_num;
{
if (!(is_empty (model, layer_num)))
model->FLAGTAB[layer_num] += EMPTY;
}
/*****************************************************************************
* mark_post: marks the given model at the specified layer as post_treated
****************************************************************************/
void mark_treat (model)
rdsfig_list *model;
{
model->FLAGS = S2R_TREAT;
}
/*******************************************************************************
* push_free_list: pushes the given pointer to a deleted rectangle into the free
* list.
******************************************************************************/
void push_free_list (rectp)
rdsrec_list *rectp;
{
rectp->NEXT = Free_List;
Free_List = rectp;
}
/*******************************************************************************
* pull_free_list: pulls from the free list - if not empty - a pointer to
* a ( rectangle) memory space area not used anymore.
******************************************************************************/
rdsrec_list *pull_free_list ()
{
rdsrec_list *temp;
if (Free_List)
{
temp = Free_List;
Free_List = Free_List->NEXT;
temp->X = 0;
temp->Y = 0;
temp->DX = 0;
temp->DY = 0;
temp->NAME = NULL;
temp->USER = (void *) NULL;
temp->FLAGS = 0;
return (temp);
}
else
return (NULL);
}
/***************************************************************************
* rds_remove_rectangle: removes from the specified list at the specified
* layer all the rectangles that are marked to be removed.
* The removed rectangles are put in a free list, to minimize
* memory consumption: if we need to allocate memory for a new
* rectangle we check the free list first.
***************************************************************************/
void rds_remove_rectangle (list)
rds_rectanglep_typ *list;
{
register rds_rectanglep_typ *rectanglep;
register rdsrec_list *temp;
for (rectanglep = list; *rectanglep;)
{
if (is_remove (*rectanglep))
{
temp = (*rectanglep)->NEXT;
push_free_list ((*rectanglep));
*rectanglep = temp;
}
else
rectanglep = &((*rectanglep)->NEXT);
}
}
/***************************************************************************
* rds_clean_layer: removes from the specified model at the specified layer
* all the rectangles that have been flattened and were not used.
* The removed rectangles are put in a free list, to minimize
* memory consumption: if we need to allocate memory for a new
* rectangle we check the free list first.
***************************************************************************/
void rds_clean_layer (list)
rds_rectanglep_typ *list;
{
register rds_rectanglep_typ *rectanglep;
register rdsrec_list *temp;
for (rectanglep = list; *rectanglep;)
{
/* when a rectangle is issued from a subcell after a ring flattening
if is to be erased if it was not used by merge */
if ((is_flattenres (*rectanglep)) && (!(is_used (*rectanglep))))
{
/**** remove it ****/
temp = (*rectanglep)->NEXT;
push_free_list ((*rectanglep));
*rectanglep = temp;
}
else
{
/**** just erase using flag and flattenres ****/
/**** the rectangle owns to the current hierararchical level ***/
demark_flattenres (*rectanglep);
demark_used (*rectanglep);
rectanglep = &((*rectanglep)->NEXT);
}
}
}
/*****************************************************************************
* side_intersec: determines if 2 rectangles could intersect in the dimension
* of the specified sides.
* If yes it returns (1) and puts where and how long is the side
* of their intersection in rs and rds respectively.
* If not it returns (0).
*****************************************************************************/
int side_intersec (s1, s2, ds1, ds2, rs, rds)
long s1, s2, ds1, ds2, *rs, *rds;
{
if ((s2 >= s1) && (s2 <= (s1 + ds1)))
{
if ((s2 + ds2) >= (s1 + ds1))
{
*rs = s2;
*rds = s1 + ds1 - s2;
}
else
{
*rs = s2;
*rds = ds2;
}
return (1);
}
if ((s2 <= s1) && ((s2 + ds2) >= s1))
{
if ((s2 + ds2) >= (s1 + ds1))
{
*rs = s1;
*rds = ds1;
}
else
{
*rs = s1;
*rds = s2 + ds2 - s1;
}
return (1);
}
return (0);
}
/*****************************************************************************
* rect_intersec: determines if 2 rectangles intersect.
* If yes it returns (1) and puts the data of the rectangle
* of their intersection in rx, ry, rdx and rdy.
* If not it returns (0).
*****************************************************************************/
int rect_intersec (x1, x2, dx1, dx2, y1, y2, dy1, dy2, rx, rdx, ry, rdy)
long x1, x2, dx1, dx2, y1, y2, dy1, dy2, *rx, *rdx, *ry, *rdy;
{
if (side_intersec (x1, x2, dx1, dx2, rx, rdx))
return (side_intersec (y1, y2, dy1, dy2, ry, rdy));
else
return (0);
}
static chain_list *MODEL_CHAIN;
static chain_list *rmake_model_list (pt_phfig)
phfig_list *pt_phfig;
{
phins_list *pt_ins;
chain_list *pt_chain;
for (pt_ins = pt_phfig->PHINS; pt_ins != NULL; pt_ins = pt_ins->NEXT)
{
for (pt_chain = MODEL_CHAIN; pt_chain != NULL; pt_chain = pt_chain->NEXT)
{
if (((phfig_list *) pt_chain->DATA)->NAME == pt_ins->FIGNAME)
{
break;
}
}
if (pt_chain == NULL)
{
/* if not already in model list , add a new model to it */
phfig_list *pt_model;
pt_model = getphfig (pt_ins->FIGNAME, 'A');
/* cells whose have got gds equivalent must have been shifted to zero */
if (incataloggds (pt_model->NAME))
zero (pt_model);
(void) rmake_model_list (pt_model);
}
}
MODEL_CHAIN = addchain (MODEL_CHAIN, (char *) pt_phfig);
return (MODEL_CHAIN);
}
static chain_list *make_model_list (fig)
phfig_list *fig;
{
if (MODEL_CHAIN != NULL)
freechain (MODEL_CHAIN);
MODEL_CHAIN = NULL;
return rmake_model_list (fig);
}
/*------------------------------------------------------\
| Transform a hierarchy Mbk -> Rds |
\------------------------------------------------------*/
rdsfig_list *S2Rfigmbkrds (FigureMbk, All)
phfig_list *FigureMbk;
char All;
{
rdsfig_list *FigureRds;
chain_list *Pt;
if (All)
{
Pt = make_model_list (FigureMbk);
if (s2rdebug)
{
chain_list *pc = Pt;
fprintf (stderr, "MODELS :\n");
for (; pc; pc = pc->NEXT)
{
fprintf (stderr, " %s\t", ((phfig_list *) (pc->DATA))->NAME);
if ((((phfig_list *) (pc->DATA))->PHINS) == NULL)
fprintf (stderr, "FEUILLE");
fprintf (stderr, "\n");
}
}
FigureRds = figmbkrds ((phfig_list *) Pt->DATA, 0, 0);
for (Pt = Pt->NEXT; Pt != NULL; Pt = Pt->NEXT)
figmbkrds ((phfig_list *) Pt->DATA, 0, 0);
}
else
{
FigureRds = figmbkrds (FigureMbk, 0, 0);
for (Pt = FigureMbk->MODELCHAIN; Pt != NULL; Pt = Pt->NEXT)
figmbkrds (getphfig ((char *) Pt->DATA, 'P'), 0, 0);
}
return FigureRds;
}
void zero (phfig)
phfig_list *phfig;
{
long x, y;
phins_list *phins;
phcon_list *phcon;
phseg_list *phseg;
phvia_list *phvia;
phref_list *phref;
x = phfig->XAB1;
y = phfig->YAB1;
phfig->XAB1 = phfig->YAB1 = 0;
phfig->XAB2 -= x;
phfig->YAB2 -= y;
for (phins = phfig->PHINS; phins != NULL; phins = phins->NEXT)
{
phins->XINS -= x;
phins->YINS -= y;
}
for (phcon = phfig->PHCON; phcon != NULL; phcon = phcon->NEXT)
{
phcon->XCON -= x;
phcon->YCON -= y;
}
for (phseg = phfig->PHSEG; phseg != NULL; phseg = phseg->NEXT)
{
phseg->X1 -= x;
phseg->Y1 -= y;
phseg->X2 -= x;
phseg->Y2 -= y;
}
for (phvia = phfig->PHVIA; phvia != NULL; phvia = phvia->NEXT)
{
phvia->XVIA -= x;
phvia->YVIA -= y;
}
for (phref = phfig->PHREF; phref != NULL; phref = phref->NEXT)
{
phref->XREF -= x;
phref->YREF -= y;
}
}

View File

@ -0,0 +1,150 @@
/*
* 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.
*/
extern int s2rdebug;
/******************************************************************************
* *
* Rectangle Data Base : Structures and Access functions *
* *
*****************************************************************************/
#include "maxima.h"
/******************************************************************************
* definitions of flags
*****************************************************************************/
#define is_remove(rectangle) ( (rectangle)->FLAGS & REMOVE)
#define is_flattenres(rectangle) ( (rectangle)->FLAGS & FLATTENRES)
#define is_used(rectangle) ( (rectangle)->FLAGS & USED)
#define is_scotch(rectangle) ( (rectangle)->FLAGS & SCOTCH)
#define is_old_scotch(rectangle) ( (rectangle)->FLAGS & OLD_SCOTCH)
#define REC_INIT 0x00000000 /* rectangle: default */
#define REMOVE 0x01000000 /* rectangle: to be removed */
#define FLATTENRES 0x02000000 /* rectangle: resulted from a flatten */
#define USED 0x04000000 /* rectangle: used in merge */
#define SCOTCH 0x08000000 /* rectangle: a scotch */
#define OLD_SCOTCH 0x10000000 /* rectangle: an old scotch */
#define EMPTY 1 /* model(specific for a layer):
it contains nothing in this layer */
#define POST 1 /* model->FLAGS: the model is postrated */
#define READ 2 /* model->FLAGS: model already read from disk */
/* when a cell contains a model which has been */
/* already read in another cell, this flag */
/* prevents from reading it twice from disk */
/* Rectangles */
typedef rdsrec_list *rds_rectanglep_typ;
/*****************************************************************************
* Instances :
* The coordinates and symetry semantics are the gds & cif 's one, that's
* completly different from mbk's
*****************************************************************************/
/* Models */
typedef rdsfig_list *rds_figurep_typ;
/************************************************************************
* types and definitions of rectangle data base access
*************************************************************************/
/************************************************************************
* free list of rectangles removed to be
* allocated when a creation of a rectangle is requested
************************************************************************/
extern rdsrec_list *Free_List;
/************************************************************************
* declaration of the functions defined in rds_access.c
************************************************************************/
extern rdsfig_list *S2Rfigmbkrds ();
extern void zero ();
extern rdsrec_list *rds_rectangle_in ();
extern rdsins_list *rds_instance_in ();
extern void rds_remove_model ();
extern rdsfig_list *rds_create_model ();
extern rdsfig_list *rds_model_out ();
extern rdsins_list *rds_instance_out ();
extern void rds_mbk_kill ();
extern void mark_treat ();
extern void mark_remove ();
extern void mark_flattenres ();
extern void mark_used ();
extern void mark_scotch ();
extern void mark_old_scotch ();
extern void mark_empty ();
extern void mark_post ();
extern void demark_flattenres ();
extern void demark_scotch ();
extern void demark_used ();
extern void push_free_list ();
extern rdsrec_list *pull_free_list ();
extern void rds_remove_rectangle ();
extern void rds_clean_layer ();
extern int side_intersec ();
extern int rect_intersec ();
/*******************************************************************************
* macro definitions to test the flags fields of rectangles and models
******************************************************************************/
/******************************************************************************
* rectangles
*****************************************************************************/
#define is_remove(rectangle) ( (rectangle)->FLAGS & REMOVE)
#define is_flattenres(rectangle) ( (rectangle)->FLAGS & FLATTENRES)
#define is_used(rectangle) ( (rectangle)->FLAGS & USED)
#define is_scotch(rectangle) ( (rectangle)->FLAGS & SCOTCH)
#define is_old_scotch(rectangle) ( (rectangle)->FLAGS & OLD_SCOTCH)
/*****************************************************************************
* are_rect_intersec: tests if the 2 given rectangles ( given by their
* coordinates) intersect or not.
******************************************************************************/
#define are_rect_intersec(x1,y1,dx1,dy1,x2,y2,dx2,dy2) (\
(( ((x2) >= (x1)) && ((x2) <= ((x1)+(dx1))))\
||\
(( (x2) <= (x1)) && ( ((x2)+(dx2)) >= (x1))))\
&&\
(( ((y2) >= (y1)) && ((y2) <= ((y1)+(dy1))))\
||\
(( (y2) <= (y1)) && ( ((y2)+(dy2)) >= (y1))))\
)
/****************************************************************************
* models
****************************************************************************/
#define is_empty(model,layer_num) ( (model)->FLAGTAB[layer_num] & EMPTY)
#define is_post(model) ( (model)->FLAGS & POST)
#define is_read(model) ( (model)->FLAGS & READ)

View File

@ -0,0 +1,97 @@
/*
* 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.
*/
/****************************************************************************/
/* */
/* ALLIANCE CAO & VLSI CAD */
/* */
/* Product : (S)ymbolic (2)to (R)eal translater */
/* File : rdsx2y.c */
/* */
/* (c) copyright 1992 MASI laboratory CAO & VLSI team */
/* All Right Reserved */
/* Support : e-mail cao-vlsi@masi.ibp.fr */
/* */
/****************************************************************************/
/* */
/* Main of cif or gds translater */
/* */
/****************************************************************************/
#include "generic.h"
#include <mph.h>
#include <mut.h>
#include <rds.h>
#include <rfm.h>
#include <rpr.h>
#include <rwi.h>
#include <rut.h>
#include <rtl.h>
getarg (argc, argv, model_name)
int argc;
char **argv;
char **model_name;
{
char *option1;
char *option2;
if (argc != 2)
{
fprintf (stderr, "usage : %s <file> \n", argv[0]);
exit (1);
}
*model_name = namealloc (argv[1]);
}
main (argc, argv)
int argc;
char **argv;
{
char *model_name;
rdsfig_list *pf;
/**** banner and parameters ****/
getarg (argc, argv, &model_name);
/*\
* setting environement
* MBK_CATAL_NAME : file where file name to be replaced are put
* MBK_CATA_LIB : where cells, catal file and techno file are
* MBK_WORK_LIB : where result file is written or where techno file is
* WORK_LIB is watched before CATA_LIB
* MBK_WORK_LIB : where result file is placed
* MBK_IN_PH : file format of symbolic figure
* RDS_TECHNO_NAME : techno file name
* RDS_IN : file format of real figures to replace
* RDS_OUT : file format of result file
\*/
mbkenv ();
rdsenv ();
loadrdsparam ();
pf = getrdsfig (model_name, 'A', 0);
saverdsfig (pf);
return (0);
}

View File

@ -0,0 +1,66 @@
/*
* 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.
*/
/****************************************************************************/
/* */
/* ALLIANCE CAO & VLSI CAD */
/* */
/* Product : (S)ymbolic (2)to (R)eal translater */
/* File : statistics.c */
/* */
/* (c) copyright 1992 MASI laboratory CAO & VLSI team */
/* All Right Reserved */
/* Support : e-mail cao-vlsi@masi.ibp.fr */
/* */
/****************************************************************************/
/* */
/* Statistics functions */
/* */
/****************************************************************************/
#include <stdio.h>
#include "statistics.h"
long STAT_RECT_REQRD = 0; /* number of rectangles required to be allocated */
long STAT_RECT_ALLOC = 0; /* number of rectangles really allocated in memory */
long STAT_SCTCH_RQRD = 0; /* number of scotchs needed */
long STAT_SCTCH_CRTD = 0; /* number of scotchs created */
extern long mbkalloc_stat; /* memory allocated by mbk */
/*******************************************************************************
* print_statistics: prints statistics
******************************************************************************/
void print_statistics (scotch_on_flag)
int scotch_on_flag;
{
printf ("\to memory allocation informations\n");
printf ("\t--> required rectangles = %ld ", STAT_RECT_REQRD);
printf (" really allocated = %ld\n", STAT_RECT_ALLOC);
if (scotch_on_flag)
{
printf ("\t--> required scotchs = %ld ", STAT_SCTCH_RQRD);
printf (" really created = %ld\n", STAT_SCTCH_CRTD);
}
printf ("\t--> Number of allocated bytes: %ld\n", mbkalloc_stat);
}

View File

@ -0,0 +1,28 @@
/*
* 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.
*/
extern void print_statistics ();
extern long STAT_RECT_REQRD;
extern long STAT_RECT_ALLOC;
extern long STAT_SCTCH_RQRD;
extern long STAT_SCTCH_CRTD;