changeset 145:5e91200bf609

netdiff: donl-pinreport utility written, compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Nov 2020 01:17:10 +0000
parents ffadaa339478
children 7ddfb9a67b0c
files .hgignore netdiff/match/Makefile netdiff/match/main2.c
diffstat 3 files changed, 50 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sun Sep 20 02:40:23 2020 +0000
+++ b/.hgignore	Sun Nov 15 01:17:10 2020 +0000
@@ -24,6 +24,7 @@
 ^netdiff/convert/protel2donl$
 ^netdiff/convert/tedax2donl$
 ^netdiff/match/donl-netmatch$
+^netdiff/match/donl-pinreport$
 ^netdiff/renpart/donl-rename-parts$
 
 ^pads2gpcb/pads2gpcb$
--- a/netdiff/match/Makefile	Sun Sep 20 02:40:23 2020 +0000
+++ b/netdiff/match/Makefile	Sun Nov 15 01:17:10 2020 +0000
@@ -1,16 +1,21 @@
 CC=	gcc
 CFLAGS=	-O2
-PROG=	donl-netmatch
-OBJS=	main.o rdpass.o
+PROGS=	donl-netmatch donl-pinreport
 BINDIR=	/usr/local/bin
 
-all:	${PROG}
+NETMATCH_OBJS=	main.o rdpass.o
+PINREPORT_OBJS=	main2.o rdpass.o
+
+all:	${PROGS}
 
-${PROG}:	${OBJS}
-	${CC} ${CFLAGS} -o $@ ${OBJS}
+donl-netmatch:	${NETMATCH_OBJS}
+	${CC} ${CFLAGS} -o $@ ${NETMATCH_OBJS}
+
+donl-pinreport:	${PINREPORT_OBJS}
+	${CC} ${CFLAGS} -o $@ ${PINREPORT_OBJS}
 
 install:
-	install -c -o bin -g bin -m 755 ${PROG} ${BINDIR}
+	install -c -o bin -g bin -m 755 ${PROGS} ${BINDIR}
 
 clean:
-	rm -f *.[ao] a.out core errs ${PROG}
+	rm -f *.[ao] a.out core errs ${PROGS}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netdiff/match/main2.c	Sun Nov 15 01:17:10 2020 +0000
@@ -0,0 +1,37 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "struct.h"
+
+char *infnames[2];
+struct pin_info *database;
+
+emit_output()
+{
+	struct pin_info *p;
+
+	for (p = database; p; p = p->next) {
+		if (!p->netnames[0])
+			p->netnames[0] = "-";
+		if (!p->netnames[1])
+			p->netnames[1] = "-";
+		printf("%s\t%s\t%s\n", p->pin_name, p->netnames[0],
+			p->netnames[1]);
+	}
+}
+
+main(argc, argv)
+	char **argv;
+{
+	int i;
+
+	if (argc != 3) {
+		fprintf(stderr, "usage: %s net1 net2\n", argv[0]);
+		exit(1);
+	}
+	infnames[0] = argv[1];
+	infnames[1] = argv[2];
+	for (i = 0; i < 2; i++)
+		read_pass(i);
+	emit_output();
+	exit(0);
+}