Merge branch 'master' into netgen-1.5

This commit is contained in:
Tim Edwards 2021-11-18 03:00:10 -05:00
commit 0d19868145
16 changed files with 80 additions and 23 deletions

View File

@ -1 +1 @@
1.5.209
1.5.210

View File

@ -23,12 +23,13 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <stdlib.h> /* for strtod() */
#include <stdarg.h>
#include <ctype.h>
#include "netgen.h"
#include "hash.h"
#include "objlist.h"
#include "netfile.h"
#include "print.h"
#include "hash.h"
void extCell(char *name, int filenum)
{
@ -186,7 +187,7 @@ char *ReadExt(char *fname, int doflat, int *fnum)
/* Make sure all .ext file reading is case sensitive */
matchfunc = match;
matchintfunc = matchfile;
hashfunc = hash;
hashfunc = hashcase;
if (LookupCellFile(fname, filenum) != NULL) {
Printf("Error: Duplicate cell name \"%s\"!\n", fname);
@ -652,7 +653,7 @@ char *ReadSim(char *fname, int *fnum)
/* Make sure all .sim file reading is case sensitive */
matchfunc = match;
matchintfunc = matchfile;
hashfunc = hash;
hashfunc = hashcase;
CellDef(fname, filenum);

7
base/flatten.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef _FLATTEN_H
#define _FLATTEN_H
extern int UniquePins(char *name, int filenum);
extern void flattenCell(char *name, int file);
#endif /* _FLATTEN_H */

View File

@ -30,8 +30,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif
#include "netgen.h"
#include "hash.h"
#include "objlist.h"
#include "hash.h"
unsigned long (*hashfunc)(char *, int) = NULL;
int (*matchfunc)(char *, char *) = NULL;
@ -148,7 +148,7 @@ unsigned long hashnocase(char *s, int hashsize)
return (hashsize == 0) ? hashval : (hashval % hashsize);
}
unsigned long hash(char *s, int hashsize)
unsigned long hashcase(char *s, int hashsize)
{
unsigned long hashval;

View File

@ -48,7 +48,7 @@ extern void *HashFirst(struct hashdict *dict);
extern void *HashNext(struct hashdict *dict);
extern unsigned long hashnocase(char *s, int hashsize);
extern unsigned long hash(char *s, int hashsize);
extern unsigned long hashcase(char *s, int hashsize);
extern int (*matchfunc)(char *, char *);
/* matchintfunc() compares based on the name and the first */

View File

@ -21,11 +21,13 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include <stdio.h>
#include <stdlib.h> /* for rand(), abs(), etc */
#include <setjmp.h>
#include <signal.h>
#include <time.h> /* for time() as a seed for random number generator */
#include <limits.h>
#include <math.h> /* for fabs() */
#include <ctype.h> /* for toupper() */
#ifdef IBMPC
#include <alloc.h>
@ -45,11 +47,13 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "netfile.h"
#include "print.h"
#include "dbug.h"
#include "hash.h"
#ifdef TCL_NETGEN
int InterruptPending = 0;
void (*oldinthandler)() = SIG_DFL;
extern Tcl_Interp *netgeninterp;
extern int check_interrupt();
#endif
/* define the following to debug core allocation */
@ -3757,7 +3761,7 @@ void CreateTwoLists(char *name1, int file1, char *name2, int file2, int dolist)
/* determine if matching will be case sensitive or case insensitive */
matchfunc = match;
matchintfunc = matchfile;
hashfunc = hash;
hashfunc = hashcase;
if (tc1 != NULL && tc2 != NULL) {
if ((tc1->flags & CELL_NOCASE) && (tc2->flags & CELL_NOCASE)) {
matchfunc = matchnocase;

View File

@ -54,6 +54,15 @@ extern void PrintIllegalElementClasses();
extern void DumpNetwork(struct objlist *ob, int cidx);
extern void DumpNetworkAll(char *name, int file);
extern void RegroupDataStructures();
extern void FormatIllegalElementClasses();
extern void FormatIllegalNodeClasses();
extern int ResolveAutomorphsByProperty();
extern int ResolveAutomorphsByPin();
extern void SummarizeElementClasses(struct ElementClass *EC);
extern int remove_group_tags(struct objlist *ob);
#ifdef TCL_NETGEN
extern int EquivalentNode();
extern int EquivalentElement();

View File

@ -22,6 +22,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <ctype.h>
#include <limits.h>
#ifdef IBMPC
#include <alloc.h>
#endif
@ -31,13 +32,13 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif
#include "netgen.h"
#include "hash.h"
#include "objlist.h"
#include "regexp.h"
#include "dbug.h"
#include "print.h"
#include "netfile.h"
#include "netcmp.h"
#include "hash.h"
#ifdef TCL_NETGEN
extern Tcl_Interp *netgeninterp;
@ -288,7 +289,7 @@ static struct hashdict cell_dict;
void InitCellHashTable(void)
{
hashfunc = hash;
hashfunc = hashcase;
matchfunc = NULL;
matchintfunc = matchfile;
InitializeHashTable(&cell_dict, CELLHASHSIZE);

View File

@ -312,6 +312,19 @@ extern void GarbageCollect(void);
extern void InitGarbageCollection(void);
extern void AddToGarbageList(struct objlist *head);
extern void DeleteProperties(struct keyvalue **topptr);
extern void AddProperty(struct keyvalue **topptr, char *key, char *value);
extern void AddScaledProperty(struct keyvalue **topptr, char *key, char *value, double scale);
extern void DeleteProperties(struct keyvalue **topptr);
extern struct objlist *LinkProperties(char *model, struct keyvalue *topptr);
extern void ClassDelete(char *class, int file);
extern void RemoveShorted(char *class, int file);
extern void CellRehash(char *name, char *newname, int file);
/* defined in netgen.c */
extern int ConvertStringToInteger(char *string, int *ival);
#ifdef HAVE_MALLINFO
void PrintMemoryStats(void);
#endif

View File

@ -1033,7 +1033,7 @@ void Query(void)
break;
case 'v':
promptstring("Write Verilog: circuit name: ", repstr);
VerilogModule(repstr, filenum, "");
VerilogTop(repstr, filenum, "");
break;
case 'E':
promptstring("Write ESACAP: circuit name: ", repstr);

View File

@ -26,6 +26,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif
#include <stdlib.h> /* for calloc(), free(), getenv() */
#include <ctype.h> /* for toupper(), isascii() */
#ifndef IBMPC
#include <sys/types.h> /* for getpwnam() tilde expansion */
#include <pwd.h>
@ -40,6 +41,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "objlist.h"
#include "netfile.h"
#include "print.h"
#include "query.h"
#include "objlist.h"
// Global storage for parameters from .PARAM
struct hashdict spiceparams;

8
base/tech.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef _TECH_H
#define _TECH_H
extern int ActelLibPresent(void);
extern void ActelLib(void);
extern void VerilogTop(char *name, int fnum, char *filename);
#endif /* _TECH_H */

View File

@ -52,10 +52,10 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif
#include "netgen.h"
#include "hash.h"
#include "objlist.h"
#include "netfile.h"
#include "print.h"
#include "hash.h"
// See netfile.c for explanation of delimiters. 'X'
// separates single-character delimiters from two-character delimiters.
@ -2239,7 +2239,7 @@ char *ReadVerilogTop(char *fname, int *fnum, int blackbox)
else {
matchfunc = match;
matchintfunc = matchfile;
hashfunc = hash;
hashfunc = hashcase;
}
InitializeHashTable(&verilogparams, OBJHASHSIZE);

View File

@ -23,6 +23,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
#include <time.h>
#ifdef IBMPC
#include <stdlib.h> /* for strtol on PC */
@ -33,6 +34,8 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "netfile.h"
#include "hash.h"
#include "print.h"
#include "xilinx.h"
#include "flatten.h"
#define XILINXHASHSIZE 99
static long xilinxhashbase = 0xA00;
@ -132,10 +135,8 @@ char *xilinx_class(model)
}
return(model);
}
void
Xilinx(cellname, filename)
char *cellname;
char *filename;
void Xilinx(char *cellname, char *filename)
{
char Path[500];
char FileName[500];
@ -163,8 +164,7 @@ Xilinx(cellname, filename)
CloseFile(FileName);
}
xilinxCell(cell)
char *cell;
int xilinxCell(char *cell)
{
struct nlist *nl;
struct objlist *ob;
@ -252,9 +252,7 @@ struct objlist *xilinx_gate(ob,nl)
return(nob);
}
xilinx_sym(nl,gob)
struct nlist *nl;
struct objlist *gob;
void xilinx_sym(struct nlist *nl, struct objlist *gob)
{
struct objlist *ob;
char *cp,*rindex();

10
base/xilinx.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef _XILINX_H
#define _XILINX_H
extern void xilinx_sym(struct nlist *nl, struct objlist *gob);
extern void Xilinx(char *cellname, char *filename);
extern int xilinxCell(char *cell);
extern int XilinxLibPresent(void);
extern void XilinxLib(void);
#endif /* _XILINX_H */

View File

@ -32,6 +32,9 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "print.h"
#include "query.h" /* for ElementNodes() */
#include "hash.h"
#include "xilinx.h"
#include "tech.h"
#include "flatten.h"
#ifndef TRUE
#define TRUE 1
@ -976,7 +979,7 @@ _netgen_writenet(ClientData clientData,
SpiceCell(repstr, filenum, "");
break;
case VERILOG_IDX:
VerilogModule(repstr, filenum, "");
VerilogTop(repstr, filenum, "");
break;
case WOMBAT_IDX:
Wombat(repstr,NULL);