FreeCalypso > hg > ueda-linux
comparison ueda/uschem-netlist/pinlist.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 /* | |
2 * Informal pin list output | |
3 */ | |
4 | |
5 #include <stdio.h> | |
6 #include "../libueda/mcl.h" | |
7 #include "netlist.h" | |
8 | |
9 extern struct nlcomp *netlist_comps; | |
10 extern int ncomponents; | |
11 | |
12 extern FILE *outfile; | |
13 | |
14 static | |
15 list_pins_tab(comp) | |
16 struct nlcomp *comp; | |
17 { | |
18 register struct pinconn **ppc, *pc; | |
19 register struct net *n; | |
20 int i, npins; | |
21 | |
22 npins = comp->npins; | |
23 for (ppc = comp->pintab, i = 1; i <= npins; ppc++, i++) { | |
24 if (pc = *ppc) { | |
25 n = pc->net; | |
26 if (n->netname) | |
27 fprintf(outfile, "\tPin %d = %s (%s line %d)\n", | |
28 i, n->netname, pc->origin_file, | |
29 pc->origin_line); | |
30 else | |
31 fprintf(outfile, | |
32 "\tPin %d = unnamed net (%s line %d)\n", | |
33 i, pc->origin_file, pc->origin_line); | |
34 } else | |
35 fprintf(outfile, "\tPin %d left unconnected\n", i); | |
36 } | |
37 } | |
38 | |
39 static | |
40 list_pins_chain(comp) | |
41 struct nlcomp *comp; | |
42 { | |
43 register struct pinconn *pc; | |
44 register struct net *n; | |
45 | |
46 for (pc = comp->pinchain; pc; pc = pc->next_in_comp) { | |
47 n = pc->net; | |
48 if (n->netname) | |
49 fprintf(outfile, "\tPin %s = %s (%s line %d)\n", | |
50 pc->pinnum, n->netname, pc->origin_file, | |
51 pc->origin_line); | |
52 else | |
53 fprintf(outfile, | |
54 "\tPin %s = unnamed net (%s line %d)\n", | |
55 pc->pinnum, pc->origin_file, pc->origin_line); | |
56 } | |
57 } | |
58 | |
59 pinlist_output() | |
60 { | |
61 register struct nlcomp *comp; | |
62 register int i; | |
63 | |
64 open_output_file(); | |
65 for (comp = netlist_comps, i = 0; i < ncomponents; comp++, i++) { | |
66 fprintf(outfile, "%s:\n", comp->mclcomp->name); | |
67 if (!comp->nconnects) | |
68 fputs("\tNo connections\n", outfile); | |
69 else if (comp->pintab) | |
70 list_pins_tab(comp); | |
71 else | |
72 list_pins_chain(comp); | |
73 } | |
74 } | |
75 | |
76 check_for_unused_comps() | |
77 { | |
78 register struct nlcomp *comp; | |
79 register int i; | |
80 | |
81 for (comp = netlist_comps, i = 0; i < ncomponents; comp++, i++) | |
82 if (!comp->nconnects) | |
83 fprintf(stderr, | |
84 "Warning: component %s has no connections\n", | |
85 comp->mclcomp->name); | |
86 } |