diff ueda/uschem-netlist/dowork.c @ 0:cd92449fdb51

initial import of ueda and ifctf-part-lib from ifctfvax CVS
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 20 Jul 2015 00:24:37 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ueda/uschem-netlist/dowork.c	Mon Jul 20 00:24:37 2015 +0000
@@ -0,0 +1,55 @@
+#include <sys/types.h>
+#include <stdio.h>
+#include "netlist.h"
+#include "../libuschem/schemstruct.h"
+
+extern struct nlcomp *mclcomp_to_nlcomp();
+extern struct pinconn *alloc_pinconn();
+extern char *get_compinst_attr();
+extern char *pinname_to_pinnumber();
+
+extern struct schem *curschem;
+extern int global_errflag;
+
+extern struct net noconnect_pseudo_net;
+
+do_connect(net, compinst, soughtpin, bynum, lineno)
+	struct net *net;
+	struct schemobj *compinst;
+	char *soughtpin;
+	int bynum, lineno;
+{
+	register struct component *comp;
+	register char *pinnum;
+	char *slot;
+	register struct pinconn *pc;
+
+	comp = compinst->compobj_mclcomp;
+	if (bynum)
+		pinnum = soughtpin;
+	else {
+		slot = get_compinst_attr(compinst, "slot");
+		pinnum = pinname_to_pinnumber(comp, soughtpin, slot);
+		if (!pinnum) {
+			/* error msg already printed */
+			global_errflag++;
+			return;
+		}
+	}
+	pc = alloc_pinconn();
+	pc->comp = mclcomp_to_nlcomp(comp);
+	pc->pinnum = pinnum;
+	pc->net = net;
+	pc->origin_file = curschem->orig_filename;
+	pc->origin_line = lineno;
+	if (record_pin_connection(pc))
+		free(pc);
+}
+
+do_noconnect(compinst, soughtpin, bynum, lineno)
+	struct schemobj *compinst;
+	char *soughtpin;
+	int bynum, lineno;
+{
+	do_connect(&noconnect_pseudo_net, compinst, soughtpin, bynum, lineno);
+}