Added part_set_instruction(), parts_shift_instructions() and parts_shift_data_regsiters().

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@126 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Marcel Telka 23 years ago
parent 07bd219715
commit 29ded645bc

@ -49,6 +49,7 @@ void part_free( part *p );
part *read_part( FILE *f, 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_instruction( part *p, const char *iname );
void part_shift_instruction( part *p, int exit );
void part_shift_data_register( part *p, int exit );
void part_set_signal( part *p, const char *pname, int out, int val );
@ -65,5 +66,7 @@ parts *parts_alloc( void );
void parts_free( parts *ps );
int parts_add_part( parts *ps, part *p );
void parts_set_instruction( parts *ps, const char *iname );
void parts_shift_instructions( parts *ps );
void parts_shift_data_registers( parts *ps );
#endif /* JTAG_PART_H */

@ -121,6 +121,12 @@ part_find_data_register( part *p, const char *drname )
return dr;
}
void part_set_instruction( part *p, const char *iname )
{
if (p)
p->active_instruction = part_find_instruction( p, iname );
}
void
part_shift_instruction( part *p, int exit )
{
@ -266,17 +272,47 @@ parts_add_part( parts *ps, part *p )
void
parts_set_instruction( parts *ps, const char *iname )
{
int j;
int i;
for (i = 0; i < ps->len; i++)
ps->parts[i]->active_instruction = part_find_instruction( ps->parts[i], iname );
}
void
parts_shift_instructions( parts *ps )
{
int i;
if (!ps)
return;
tap_capture_ir();
for (j = 0; j < ps->len; j++) {
instruction *i = part_find_instruction( ps->parts[j], iname );
if (!i) {
printf( "Instruction '%s' not found\n", iname );
return;
for (i = 0; i < ps->len; i++) {
if (!ps->parts[i]->active_instruction) {
printf( "%s(%s:%d) Part without active instruction\n", __FUNCTION__, __FILE__, __LINE__ );
continue;
}
tap_shift_register( ps->parts[i]->active_instruction->value, NULL, (i + 1) == ps->len );
}
}
void
parts_shift_data_registers( parts *ps )
{
int i;
if (!ps)
return;
tap_capture_dr();
for (i = 0; i < ps->len; i++) {
if (!ps->parts[i]->active_instruction) {
printf( "%s(%s:%d) Part without active instruction\n", __FUNCTION__, __FILE__, __LINE__ );
continue;
}
ps->parts[j]->active_instruction = i;
tap_shift_register( i->value, NULL, (j + 1) == ps->len );
tap_shift_register( ps->parts[i]->active_instruction->data_register->in,
ps->parts[i]->active_instruction->data_register->out, (i + 1) == ps->len );
}
}

Loading…
Cancel
Save