FreeCalypso > hg > ueda-linux
comparison ueda/sverp-bind/output.c @ 32:6c7c79d37eff
unet-bind: attribute output implemented
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Sat, 08 Aug 2015 21:52:33 +0000 |
parents | 558269596a5c |
children |
comparison
equal
deleted
inserted
replaced
31:61272ee5aadc | 32:6c7c79d37eff |
---|---|
3 #include <string.h> | 3 #include <string.h> |
4 #include <strings.h> | 4 #include <strings.h> |
5 #include "../libueda/xga.h" | 5 #include "../libueda/xga.h" |
6 #include "../libunet/nethash.h" | 6 #include "../libunet/nethash.h" |
7 #include "struct.h" | 7 #include "struct.h" |
8 | |
9 extern char *get_comp_attr(); | |
8 | 10 |
9 extern char *MCLfile; | 11 extern char *MCLfile; |
10 extern char *input_filename; | 12 extern char *input_filename; |
11 extern char *output_filename; | 13 extern char *output_filename; |
12 | 14 |
13 extern struct net *net_list_head; | 15 extern struct net *net_list_head; |
14 extern int ncomponents; | 16 extern int ncomponents; |
15 extern struct outcomp *netlist_comps; | 17 extern struct outcomp *netlist_comps; |
16 extern struct outcomp *starpoint_list_head; | 18 extern struct outcomp *starpoint_list_head; |
19 extern struct wantattr *want_attr_list; | |
17 | 20 |
18 static FILE *outF; | 21 static FILE *outF; |
19 | 22 |
20 generate_output() | 23 generate_output() |
21 { | 24 { |
111 register int pinidx; | 114 register int pinidx; |
112 | 115 |
113 fprintf(outF, "\n%s %s {\n", comp_type_kw, oc->name); | 116 fprintf(outF, "\n%s %s {\n", comp_type_kw, oc->name); |
114 if (oc->altname) | 117 if (oc->altname) |
115 fprintf(outF, " ALTNAME %s\n", oc->altname); | 118 fprintf(outF, " ALTNAME %s\n", oc->altname); |
119 if (want_attr_list && oc->mclcomp) | |
120 emit_component_attributes(oc->mclcomp); | |
116 for (pinidx = 0; pinidx < oc->npins; pinidx++) { | 121 for (pinidx = 0; pinidx < oc->npins; pinidx++) { |
117 if (oc->grid_pkg && oc->grid_pkg->holes_array[pinidx]) | 122 if (oc->grid_pkg && oc->grid_pkg->holes_array[pinidx]) |
118 continue; | 123 continue; |
119 emit_output_pin_line(oc, pinidx); | 124 emit_output_pin_line(oc, pinidx); |
120 } | 125 } |
121 fputs("}\n", outF); | 126 fputs("}\n", outF); |
122 } | 127 } |
128 | |
129 emit_component_attributes(comp) | |
130 struct component *comp; | |
131 { | |
132 register struct wantattr *wa; | |
133 register char *value; | |
134 | |
135 for (wa = want_attr_list; wa; wa = wa->next) { | |
136 value = get_comp_attr(comp, wa->name); | |
137 if (!value) | |
138 continue; | |
139 fprintf(outF, " ATTR %s=%s\n", wa->name, value); | |
140 } | |
141 } |