diff --git a/include/jtag/part.h b/include/jtag/part.h index 98b49ced..dda8917e 100644 --- a/include/jtag/part.h +++ b/include/jtag/part.h @@ -51,6 +51,7 @@ part *part_alloc( void ); void part_free( part *p ); part *read_part( FILE *f, const tap_register *idr ); instruction *part_find_instruction( part *p, const char *iname ); +data_register *part_find_data_register( part *p, const char *drname ); void part_set_signal( part *p, const char *pname, int out, int val ); int part_get_signal( part *p, const char *pname ); diff --git a/jtag/src/part/part.c b/jtag/src/part/part.c index e4755359..6c8b16e9 100644 --- a/jtag/src/part/part.c +++ b/jtag/src/part/part.c @@ -111,6 +111,24 @@ part_find_instruction( part *p, const char *iname ) return i; } +data_register * +part_find_data_register( part *p, const char *drname ) +{ + data_register *dr; + + if (!p || !drname) + return NULL; + + dr = p->data_registers; + while (dr) { + if (strcmp( drname, dr->name ) == 0) + break; + dr = dr->next + } + + return dr; +} + void part_set_signal( part *p, const char *pname, int out, int val ) {