Browse Source

Initial logicexp parser and gate generator.

pre-master-46
Brian Taylor 3 years ago
committed by Holger Vogt
parent
commit
a54aa4d1f7
  1. 3
      src/frontend/Makefile.am
  2. 1358
      src/frontend/logicexp.c
  3. 9
      src/frontend/udevices.c
  4. 9
      src/include/ngspice/logicexp.h

3
src/frontend/Makefile.am

@ -136,6 +136,8 @@ libfte_la_SOURCES = \
inventory.c \ inventory.c \
linear.c \ linear.c \
linear.h \ linear.h \
logicexp.c \
logicexp.h \
measure.c \ measure.c \
misccoms.c \ misccoms.c \
misccoms.h \ misccoms.h \
@ -185,6 +187,7 @@ libfte_la_SOURCES = \
typesdef.c \ typesdef.c \
typesdef.h \ typesdef.h \
udevices.c \ udevices.c \
udevices.h \
vectors.c \ vectors.c \
vectors.h \ vectors.h \
where.c \ where.c \

1358
src/frontend/logicexp.c
File diff suppressed because it is too large
View File

9
src/frontend/udevices.c

@ -54,6 +54,7 @@
#include "ngspice/cpextern.h" #include "ngspice/cpextern.h"
#include "ngspice/macros.h" #include "ngspice/macros.h"
#include "ngspice/udevices.h" #include "ngspice/udevices.h"
#include "ngspice/logicexp.h"
extern struct card* insert_new_line( extern struct card* insert_new_line(
struct card* card, char* line, int linenum, int linenum_orig); struct card* card, char* line, int linenum, int linenum_orig);
@ -3433,7 +3434,13 @@ BOOL u_check_instance(char *line)
printf("WARNING "); printf("WARNING ");
printf("Instance %s type %s is not supported\n", printf("Instance %s type %s is not supported\n",
hdr->instance_name, itype); hdr->instance_name, itype);
if (ps_udevice_msgs >= 2) {
if (eq(itype, "logicexp")) {
if (ps_udevice_msgs == 3)
(void) f_logicexp(line);
} else if (eq(itype, "pindly")) {
if (ps_udevice_msgs == 3)
(void) f_pindly(line);
} else if (ps_udevice_msgs == 3) {
printf("%s\n", line); printf("%s\n", line);
} }
} }

9
src/include/ngspice/logicexp.h

@ -0,0 +1,9 @@
/* logicexp.h */
#ifndef INCLUDED_LOGICEXP_H
#define INCLUDED_LOGICEXP_H
BOOL f_logicexp(char *line);
BOOL f_pindly(char *line);
#endif
Loading…
Cancel
Save