Starting to add logen

This commit is contained in:
Frederic Petrot 2002-04-11 07:25:11 +00:00
parent 7b69d5fde4
commit 345a3b477f
2 changed files with 70 additions and 11 deletions

View File

@ -2611,7 +2611,7 @@ void **now, *next;
/*******************************************************************************
* logical user functions *
*******************************************************************************/
#include <varargs.h>
#include <stdarg.h>
long num_index = 0;
@ -2708,18 +2708,16 @@ int external; /* more that one external connector on the same net? */
/*******************************************************************************
* function LOINS *
*******************************************************************************/
void genLOINS(va_alist)
va_dcl
void genLOINS(char *insname, ...)
{
losig_list *ptsig;
chain_list *ptchain = NULL, *ptchain1, *ptchain2 = NULL , *ptchain3;
va_list arg;
char *figname, *insname, *signame;
char *figname, *signame;
lofig_list *ptfig;
va_start(arg);
va_start(arg, instance);
figname = namealloc(va_arg(arg, char *));
insname = va_arg(arg, char *);
if (WORK_LOFIG == NULL) {
(void)fflush(stdout);
(void)fputs("*** genlib error ***\n", stderr);
@ -2938,11 +2936,10 @@ void genLOINSA(char *model, char *instance, char *signals[])
/*******************************************************************************
* function LOINSE *
*******************************************************************************/
void genLOINSE(va_alist)
va_dcl
void genLOINSE(char *insname, ...)
{
va_list arg;
char *figname, *insname, *signame;
char *figname, *signame;
lofig_list *ptfig;
char con[100], sig[100];
int icon, jcon, isig, jsig;
@ -2961,10 +2958,9 @@ chain_list *ptchain = NULL;
EXIT(1);
}
va_start(arg);
va_start(arg, insname);
figname = namealloc(va_arg(arg, char *));
ptfig = getlofig(figname, 'P');
insname = va_arg(arg, char *);
if (hassep(insname)) {
(void)fflush(stdout);
(void)fputs("*** genlib error ***\nIllegal LOINSE : the ", stderr);
@ -3450,6 +3446,37 @@ chain_list *chain;
(void)dellosig(WORK_LOFIG, ls2->INDEX);
}
/*******************************************************************************
* function LOGEN *
*******************************************************************************/
void genLOGEN(char *name, int type)
{
ptype_list *p = getptype(WORK_LOFIG->USER, LOGEN);
if (!p)
p = addptype(WORK_LOFIG->USER, LOGEN, NULL);
p->DATA = addlogen(name, type);
}
/*******************************************************************************
* function SETLOGEN *
*******************************************************************************/
void genSETLOGEN(char *instance, char *name, ...)
{
va_list ap; /* We have a single argument, but of unknown type yet! */
lofig_list *f = getlofig();
ptype_list *p;
va_start(ap, name);
ptype_list *p = getptype(WORK_LOFIG->USER, LOGEN);
if (!p)
p = addptype(WORK_LOFIG->USER, LOGEN, NULL);
p->DATA = addlogen(name, type);
}
/*******************************************************************************
* function FLATTEN_LOFIG *
*******************************************************************************/

View File

@ -108,6 +108,8 @@ extern void genSC_TOP();
extern void genSC_BOTTOM();
extern void genSC_CHANNEL();
extern void genSC_CON_CHANNEL();
extern void genLOGEN();
extern void genSETLOGEN();
/*******************************************************************************
* name forming functions, for both views *
*******************************************************************************/
@ -228,6 +230,8 @@ extern char *genNAME();
#define GENLIB_LOINS genLOINS
#define GENLIB_LOINSE genLOINSE
#define GENLIB_LOINSA genLOINSA
#define GENLIB_LOGEN genLOGEN
#define GENLIB_SETLOGEN genSETLOGEN
#define GENLIB_LOTRS(type,width,length,grid,source,drain) \
genLOTRS(type,(long)((width)*SCALE_X), \
(long)((length)*SCALE_X),grid,source,drain)
@ -350,3 +354,31 @@ extern char *genNAME();
#define CONT_VIA68 VIA68
#define CONT_VIA69 VIA69
#define CONT_VIA79 VIA79
/* Quick and dirty hack as required */
#define LOGEN 21
#define INTEGER_GEN 2
#define STRING_GEN 4
typedef struct logen
{
struct logen *NEXT;
char *NAME;
char TYPE;
union {
char CHAR;
long VAL;
char *TEXT;
struct logen *LIST;
} VALUE;
char TAG;
} logen_list;
extern logen_list *addlogen(logen_list *,char *);
extern logen_list *getlogen(logen_list *,char *);
extern logen_list *duplogen(logen_list *,logen_list *, char *);
extern logen_list *chklogen(logen_list *,logen_list *, char *, char *);
extern logen_list *dellogen(logen_list *, char *name);
/* End of hack */