changeset 148:64d4abf63e1e

netdiff: donl-pindiff factored out of donl-netmatch
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Nov 2020 04:11:01 +0000
parents 295b1e4534bf
children d1a507d34e77
files .hgignore netdiff/match/Makefile netdiff/match/pindiff.c
diffstat 3 files changed, 43 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Sun Nov 15 03:35:36 2020 +0000
+++ b/.hgignore	Sun Nov 15 04:11:01 2020 +0000
@@ -25,6 +25,7 @@
 ^netdiff/convert/tedax2donl$
 ^netdiff/flip2pin/donl-flip2pin$
 ^netdiff/match/donl-netmatch$
+^netdiff/match/donl-pindiff$
 ^netdiff/match/donl-pinreport$
 ^netdiff/renpart/donl-rename-parts$
 
--- a/netdiff/match/Makefile	Sun Nov 15 03:35:36 2020 +0000
+++ b/netdiff/match/Makefile	Sun Nov 15 04:11:01 2020 +0000
@@ -1,9 +1,10 @@
 CC=	gcc
 CFLAGS=	-O2
-PROGS=	donl-netmatch donl-pinreport
+PROGS=	donl-netmatch donl-pindiff donl-pinreport
 BINDIR=	/usr/local/bin
 
 NETMATCH_OBJS=	main.o rdpass.o
+PINDIFF_OBJS=	pindiff.o rdpass.o
 PINREPORT_OBJS=	main2.o rdpass.o
 
 all:	${PROGS}
@@ -11,6 +12,9 @@
 donl-netmatch:	${NETMATCH_OBJS}
 	${CC} ${CFLAGS} -o $@ ${NETMATCH_OBJS}
 
+donl-pindiff:	${PINDIFF_OBJS}
+	${CC} ${CFLAGS} -o $@ ${PINDIFF_OBJS}
+
 donl-pinreport:	${PINREPORT_OBJS}
 	${CC} ${CFLAGS} -o $@ ${PINREPORT_OBJS}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/netdiff/match/pindiff.c	Sun Nov 15 04:11:01 2020 +0000
@@ -0,0 +1,37 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "struct.h"
+
+char *infnames[2];
+struct pin_info *database;
+
+write_diffs_report()
+{
+	struct pin_info *p;
+
+	for (p = database; p; p = p->next) {
+		if (p->netnames[0] && !p->netnames[1])
+			printf("Pin %s only in %s: net %s\n", p->pin_name,
+				infnames[0], p->netnames[0]);
+		if (!p->netnames[0] && p->netnames[1])
+			printf("Pin %s only in %s: net %s\n", p->pin_name,
+				infnames[1], 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);
+	write_diffs_report();
+	exit(0);
+}