comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:cd92449fdb51
1 #include <sys/types.h>
2 #include <stdio.h>
3 #include "netlist.h"
4 #include "../libuschem/schemstruct.h"
5
6 extern struct nlcomp *mclcomp_to_nlcomp();
7 extern struct pinconn *alloc_pinconn();
8 extern char *get_compinst_attr();
9 extern char *pinname_to_pinnumber();
10
11 extern struct schem *curschem;
12 extern int global_errflag;
13
14 extern struct net noconnect_pseudo_net;
15
16 do_connect(net, compinst, soughtpin, bynum, lineno)
17 struct net *net;
18 struct schemobj *compinst;
19 char *soughtpin;
20 int bynum, lineno;
21 {
22 register struct component *comp;
23 register char *pinnum;
24 char *slot;
25 register struct pinconn *pc;
26
27 comp = compinst->compobj_mclcomp;
28 if (bynum)
29 pinnum = soughtpin;
30 else {
31 slot = get_compinst_attr(compinst, "slot");
32 pinnum = pinname_to_pinnumber(comp, soughtpin, slot);
33 if (!pinnum) {
34 /* error msg already printed */
35 global_errflag++;
36 return;
37 }
38 }
39 pc = alloc_pinconn();
40 pc->comp = mclcomp_to_nlcomp(comp);
41 pc->pinnum = pinnum;
42 pc->net = net;
43 pc->origin_file = curschem->orig_filename;
44 pc->origin_line = lineno;
45 if (record_pin_connection(pc))
46 free(pc);
47 }
48
49 do_noconnect(compinst, soughtpin, bynum, lineno)
50 struct schemobj *compinst;
51 char *soughtpin;
52 int bynum, lineno;
53 {
54 do_connect(&noconnect_pseudo_net, compinst, soughtpin, bynum, lineno);
55 }