diff --git a/jtag/ChangeLog b/jtag/ChangeLog index c05a37c6..2dabd8d0 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2008-05-21 Jie Zhang + + [ 1951767 ] bsdl2jtag cannot parse some bsdl files + * src/bsdl2jtag.c (endline): Prevent `:' from being scanned in. + 2008-05-21 Jie Zhang [ 1968455 ] Enter UPDATE state after register shift diff --git a/jtag/src/bsdl2jtag.c b/jtag/src/bsdl2jtag.c index 3873ac8c..ee400c0f 100644 --- a/jtag/src/bsdl2jtag.c +++ b/jtag/src/bsdl2jtag.c @@ -70,13 +70,13 @@ int endline(void) { i=sscanf(pline, "attribute %s", att); if(i!=1) return -1; if(!strncmp(att, "INSTRUCTION_LENGTH", 18)) { - i=sscanf(pline, "attribute INSTRUCTION_LENGTH of %s : entity is %i ;", tmp, &j); + i=sscanf(pline, "attribute INSTRUCTION_LENGTH of %[^:] : entity is %i ;", tmp, &j); if(i!=2) return -2; IR_l=j; mode=0; } else if(!strncmp(att, "BOUNDARY_LENGTH", 15)){ - i=sscanf(pline, "attribute BOUNDARY_LENGTH of %s : entity is %i ;", tmp, &j); + i=sscanf(pline, "attribute BOUNDARY_LENGTH of %[^:] : entity is %i ;", tmp, &j); if(i!=2) return -3; BR_l=j; bs_bits=malloc(BR_l * sizeof(struct bsbit)); @@ -85,19 +85,19 @@ int endline(void) { mode=0; } else if(!strncmp(att, "IDCODE_REGISTER", 15)) { - i=sscanf(pline, "attribute IDCODE_REGISTER of %s : entity is %n", tmp, &j); + i=sscanf(pline, "attribute IDCODE_REGISTER of %[^:] : entity is %n", tmp, &j); if(i!=1) return -4; memmove(pline, pline+j, strlen(pline+j)+1); mode=4; } else if(!strncmp(att, "BOUNDARY_REGISTER", 17)) { - i=sscanf(pline, "attribute BOUNDARY_REGISTER of %s : entity is %n", tmp, &j); + i=sscanf(pline, "attribute BOUNDARY_REGISTER of %[^:] : entity is %n", tmp, &j); if(i!=1) return -5; memmove(pline, pline+j, strlen(pline+j)+1); mode=5; } else if(!strncmp(att, "INSTRUCTION_OPCODE", 18)) { - i=sscanf(pline, "attribute INSTRUCTION_OPCODE of %s : entity is %n", tmp, &j); + i=sscanf(pline, "attribute INSTRUCTION_OPCODE of %[^:] : entity is %n", tmp, &j); if(i!=1) return -6; memmove(pline, pline+j, strlen(pline+j)+1); mode=6;