changeset 149:d1a507d34e77

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