changeset 21:f7b09a54c2ce

unet-bind: implemented the check for unclaimed instances
author Space Falcon <falcon@ivan.Harhan.ORG>
date Sun, 02 Aug 2015 06:34:09 +0000
parents dda8e455c863
children c7ebd6179f5d
files ueda/sverp-bind/insthash.c ueda/sverp-bind/main.c
diffstat 2 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ueda/sverp-bind/insthash.c	Sun Aug 02 03:23:44 2015 +0000
+++ b/ueda/sverp-bind/insthash.c	Sun Aug 02 06:34:09 2015 +0000
@@ -58,3 +58,23 @@
 			return(n);
 	return(0);
 }
+
+check_unclaimed_instances()
+{
+	int hb;
+	register struct instance *n;
+	unsigned unclaimed_count = 0;
+
+	for (hb = 0; hb < HASH_SIZE; hb++)
+		for (n = hashtab[hb]; n; n = n->nextinhash)
+			if (!n->claimed) {
+				fprintf(stderr,
+		"error: declared instance %s not claimed by input netlist\n",
+					n->name);
+				unclaimed_count++;
+			}
+	if (unclaimed_count) {
+		fprintf(stderr, "error: unclaimed instances found, aborting\n");
+		exit(1);
+	}
+}
--- a/ueda/sverp-bind/main.c	Sun Aug 02 03:23:44 2015 +0000
+++ b/ueda/sverp-bind/main.c	Sun Aug 02 06:34:09 2015 +0000
@@ -72,7 +72,8 @@
 			input_filename);
 		exit(1);
 	}
+	check_unclaimed_instances();
 
-	/* remaining functionality remains to be implemented */
+	/* output remains to be implemented */
 	exit(0);
 }