changeset 37:ce887659d12e

unet-bind: implemented hier=flip:... hack for 2-pin components
author Space Falcon <falcon@ivan.Harhan.ORG>
date Sun, 16 Aug 2015 01:51:12 +0000
parents a0d227fc9569
children aa0539cc3d41
files ueda/sverp-bind/enterinst.c ueda/sverp-bind/readunet.c ueda/sverp-bind/struct.h
diffstat 3 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ueda/sverp-bind/enterinst.c	Sun Aug 09 06:38:32 2015 +0000
+++ b/ueda/sverp-bind/enterinst.c	Sun Aug 16 01:51:12 2015 +0000
@@ -13,6 +13,16 @@
 {
 	register struct instance *inst;
 
+	if (!strncmp(hier, "flip:", 5)) {
+		if (oc->npins != 2 || oc->grid_pkg) {
+			fprintf(stderr,
+				"error: hier=flip:... makes no sense for %s\n",
+				oc->name);
+			exit(1);
+		}
+		oc->reverse_2pin = 1;
+		hier += 5;
+	}
 	oc->altname = hier;
 	inst = enter_instance(hier);
 	inst->outcomp = oc;
--- a/ueda/sverp-bind/readunet.c	Sun Aug 09 06:38:32 2015 +0000
+++ b/ueda/sverp-bind/readunet.c	Sun Aug 16 01:51:12 2015 +0000
@@ -116,6 +116,8 @@
 	register int pinidx;
 
 	pinidx = resolve_pinnum(oc, pinnumstr);
+	if (oc->reverse_2pin)
+		pinidx = !pinidx;
 	if (oc->conn_array[pinidx]) {
 		fprintf(stderr,
 	"error: multiple connections to %s pin %s (input lines %d and %d)\n",
--- a/ueda/sverp-bind/struct.h	Sun Aug 09 06:38:32 2015 +0000
+++ b/ueda/sverp-bind/struct.h	Sun Aug 16 01:51:12 2015 +0000
@@ -15,6 +15,7 @@
 	char	*altname;
 	struct	component *mclcomp;
 	int	npins;
+	int	reverse_2pin;
 	struct	grid_pkg_desc *grid_pkg;
 	struct	pinconn **conn_array;
 	struct	outcomp *next;	/* used only for starpoints */