Hi,

I made a small overview about the current parent structure in the config
file. (see attached pdf file)

To generate this you have to apply the attached patch, run avrdude at
least once (this generated for each read config file a corresponding
file "xxxx.parts.dot") and use then 'LC_ALL=C sort -r
<avrdude.conf.parts.dot | dot -Tpdf -o avrdude.conf.parts.pdf'

The more lines an entry needs the more red it is rendered. Also all
parts are sorted and not in the order as they appear in the config file.
The second line in the boxes is the signature.

Kind regards

René Liebscher

Am 27.01.2012 22:20, schrieb Rene Liebscher:
> Follow-up Comment #11, bug #34302 (project avrdude):
>
> Now in main.c parts starting with '.' are not longer listed as valid parts for
> the -p option.
>
> This way one can define "abstract" parts as base for several other devices.
> See xmegas definitions in current svn which base on ".xmega".
>
>     _______________________________________________________
>
> Reply to this item at:
>
>   <http://savannah.nongnu.org/bugs/?34302>
>
>

Attachment: avrdude.conf.parts.pdf
Description: Adobe PDF document

Index: config_gram.y
===================================================================
--- config_gram.y       (revision 1045)
+++ config_gram.y       (working copy)
@@ -64,6 +64,8 @@
 static int parse_cmdbits(OPCODE * op);
 
 static int pin_name;
+static AVRPART * parent_part = NULL;
+static FILE* dot_parts;
 %}
 
 %token K_READ
@@ -248,7 +250,17 @@
 %%
 
 configuration :
-  /* empty */ | config
+  /* empty */ | 
+  {
+    char buf[1024];
+    strcpy(buf,infile);
+    strcat(buf,".parts.dot");
+    dot_parts = fopen(buf,"w");
+    fprintf(dot_parts," digraph parts { rankdir=LR; ordering=out; node 
[shape=box,style=filled];\n");
+  } config {
+    fprintf(dot_parts,"   }\n");
+    fclose(dot_parts);
+  }
 ;
 
 config :
@@ -403,7 +415,21 @@
         lrmv_d(part_list, existing_part);
         avr_free_part(existing_part);
       }
-      PUSH(part_list, current_part); 
+      PUSH(part_list, current_part);
+      {
+        int lines = lineno-current_part->lineno;
+        if (lines > 255) lines = 255;
+        fprintf(dot_parts,"  \"%-16s\" [label=\"%s\\n%02x %02x 
%02x\",fillcolor=\"#ff%02x%02x\"];\n",
+                current_part->id,
+                current_part->id,
+                current_part->signature[0],
+                current_part->signature[1],
+                current_part->signature[2],
+                255-lines,
+                255-lines);
+        if(parent_part!=NULL)
+          fprintf(dot_parts,"  \"%-16s\" -> 
\"%-16s\";\n",parent_part->id,current_part->id);
+      }
       current_part = NULL; 
     }
 ;
@@ -414,10 +440,11 @@
       current_part = avr_new_part();
       strcpy(current_part->config_file, infile);
       current_part->lineno = lineno;
+      parent_part = NULL;
     } |
   K_PART K_PARENT TKN_STRING 
     {
-      AVRPART * parent_part = locate_part(part_list, $3->value.string);
+      parent_part = locate_part(part_list, $3->value.string);
       if (parent_part == NULL) {
         fprintf(stderr, 
               "%s: error at %s:%d: can't find parent part",
_______________________________________________
avrdude-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev

Reply via email to