From 084feb4bf323e72dda5d651af3aa8de7351d8d9e Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 1 May 2007 21:18:51 +0000 Subject: [PATCH] monitor tdi, too --- jtagkey.c | 2 +- jtagmon.c | 10 +++++++++- jtagmon.h | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/jtagkey.c b/jtagkey.c index 19011fa..6ed7375 100644 --- a/jtagkey.c +++ b/jtagkey.c @@ -209,7 +209,7 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase, DPRINTF("write byte: %d\n", val); if (tr[i].cmdTrans == 13) - tapmon(val & PP_TCK, val & PP_TMS); + jtagmon(val & PP_TCK, val & PP_TMS, val & PP_TDI); #endif /* Pad writebuf for read-commands in stream */ diff --git a/jtagmon.c b/jtagmon.c index 198a2c6..1a71ce0 100644 --- a/jtagmon.c +++ b/jtagmon.c @@ -21,8 +21,9 @@ enum tap_states { UPDATE_IR }; -void tapmon(unsigned char tck, unsigned char tms) { +void jtagmon(unsigned char tck, unsigned char tms, unsigned char tdi) { static unsigned char last_tck = 1; + static char tdi_written = 0; static int state = TEST_LOGIC_RESET; static char state_text[32] = "Test Logic Reset"; char last_state_text[32]; @@ -198,7 +199,14 @@ void tapmon(unsigned char tck, unsigned char tms) { } if (last_state != state) { + if (tdi_written) + fprintf(stderr,"\n"); + fprintf(stderr,"TAP state transition from %s to %s\n", last_state_text, state_text); + tdi_written = 0; + } else { + fprintf(stderr,"%d",(tdi ? 1 : 0)); + tdi_written = 1; } } diff --git a/jtagmon.h b/jtagmon.h index 26dea79..030db23 100644 --- a/jtagmon.h +++ b/jtagmon.h @@ -1 +1 @@ -void tapmon(unsigned char tck, unsigned char tms); +void jtagmon(unsigned char tck, unsigned char tms, unsigned char tdi);