[ 1964834 ] Add 'print instruction' support to print command

(Hartley Sweeten)


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1380 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent 4134133f78
commit 85ce6399f1

@ -1,3 +1,9 @@
2008-10-26 Arnim Laeuger <arniml@users.sourceforge.net>
* src/cmd/print.c, doc/UrJTAG.txt:
[ 1964834 ] Add 'print instruction' support to print command
(Hartley Sweeten)
2008-10-23 Arnim Laeuger <arniml@users.sourceforge.net>
* src/svf/svf_bison.y: initialize max_time to 0.0 if

@ -710,6 +710,8 @@ also the documentation for the "include" command.
===== print =====
Print a list of parts in the chain and the currently active instruction per part.
Further details of bus, signals and instructions can be obtained with dedicated
command options, see "help print".
===== initbus =====

@ -90,6 +90,43 @@ cmd_print_run( chain_t *chain, char *params[] )
}
return(1);
}
if (strcasecmp( params[1], "instructions") == 0) {
part_t *part;
instruction *inst;
snprintf( format, 128, _(" Active %%-%ds %%-%ds\n"),
MAXLEN_INSTRUCTION, MAXLEN_DATA_REGISTER );
#if HAVE_SWPRINTF
if (mbstowcs( wformat, format, 128 ) == -1)
printf( _("(%d) String conversion failed!\n"), __LINE__ );
swprintf( wheader, 128, wformat, _("Instruction"), _("Register") );
if (wcstombs( header, wheader, 128 ) == -1)
printf( _("(%d) String conversion failed!\n"), __LINE__ );
#else /* HAVE_SWPRINTF */
snprintf( header, 128, format, _("Instruction"), _("Register") );
if (mbstowcs( wheader, header, 128 ) == -1)
printf( _("(%d) String conversion failed!\n"), __LINE__ );
#endif /* HAVE_SWPRINTF */
printf( header );
for (i = 0; i < wcslen( wheader ); i++ )
putchar( '-' );
putchar( '\n' );
snprintf( format, 128, _(" %%c %%-%ds %%-%ds\n"),
MAXLEN_INSTRUCTION, MAXLEN_DATA_REGISTER );
part = chain->parts->parts[chain->active_part];
for (inst = part->instructions; inst != NULL; inst = inst->next) {
printf( format,
inst == part->active_instruction
? 'X'
: ' ',
inst->name, inst->data_register->name);
}
return(1);
}
}
if (noheader == 0) {
@ -170,7 +207,7 @@ static void
cmd_print_help( void )
{
printf( _(
"Usage: %s [chain|bus|signals]\n"
"Usage: %s [chain|bus|signals|instructions]\n"
"Display JTAG chain status.\n"
"\n"
"Display list of the parts connected to the JTAG chain including\n"

Loading…
Cancel
Save