# HG changeset patch # User Space Falcon # Date 1439070753 0 # Node ID 6c7c79d37eff20a18f5bf7235a8472fb80763c9e # Parent 61272ee5aadc4c928ab300654063569f2bada188 unet-bind: attribute output implemented diff -r 61272ee5aadc -r 6c7c79d37eff ueda/sverp-bind/output.c --- a/ueda/sverp-bind/output.c Sat Aug 08 21:44:10 2015 +0000 +++ b/ueda/sverp-bind/output.c Sat Aug 08 21:52:33 2015 +0000 @@ -6,6 +6,8 @@ #include "../libunet/nethash.h" #include "struct.h" +extern char *get_comp_attr(); + extern char *MCLfile; extern char *input_filename; extern char *output_filename; @@ -14,6 +16,7 @@ extern int ncomponents; extern struct outcomp *netlist_comps; extern struct outcomp *starpoint_list_head; +extern struct wantattr *want_attr_list; static FILE *outF; @@ -113,6 +116,8 @@ fprintf(outF, "\n%s %s {\n", comp_type_kw, oc->name); if (oc->altname) fprintf(outF, " ALTNAME %s\n", oc->altname); + if (want_attr_list && oc->mclcomp) + emit_component_attributes(oc->mclcomp); for (pinidx = 0; pinidx < oc->npins; pinidx++) { if (oc->grid_pkg && oc->grid_pkg->holes_array[pinidx]) continue; @@ -120,3 +125,17 @@ } fputs("}\n", outF); } + +emit_component_attributes(comp) + struct component *comp; +{ + register struct wantattr *wa; + register char *value; + + for (wa = want_attr_list; wa; wa = wa->next) { + value = get_comp_attr(comp, wa->name); + if (!value) + continue; + fprintf(outF, " ATTR %s=%s\n", wa->name, value); + } +}