Hello everyone,

I have to replay an XSVF file using openocd which uses the XSDRB, XSDRC
and XSDRE commands. I'm definitely not a JTAG expert, but I've hacked
together a patch to support these three commands. It seems to work on my
Spartan3A device, though I haven't done a lot of testing yet.

I've attached a diff against commit
20d1ef70e8417da7efc8a032992ee7672a19e296.

Could somebody with more JTAG/XSVF experience please have a look at the
patch and check whether this makes sense? I'd be happy to have this
included into the master tree later.

Many thanks,
Yours, Florian
-- 
0666 - Filemode of the Beast
diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c
index 539fbdc..dcb089d 100644
--- a/src/xsvf/xsvf.c
+++ b/src/xsvf/xsvf.c
@@ -269,7 +269,7 @@ COMMAND_HANDLER(handle_xsvf_command)
 		 */
 		if (collecting_path) {
 			tap_state_t	mystate;
-			uint8_t		uc;
+			uint8_t		uc = opcode;
 
 			switch (opcode) {
 			case XCOMMENT:
@@ -415,13 +415,23 @@ COMMAND_HANDLER(handle_xsvf_command)
 			break;
 
 		case XSDR:		/* these two are identical except for the dr_in_buf */
+		case XSDRB:
+		case XSDRC:
+		case XSDRE:
 		case XSDRTDO:
 			{
 				int limit = xrepeat;
 				int	matched = 0;
 				int attempt;
 
-				const char* op_name = (opcode == XSDR ? "XSDR" : "XSDRTDO");
+				const char* op_name = "";
+				switch (opcode) {
+					case XSDR:    op_name = "XSDR";    break;
+					case XSDRB:   op_name = "XSDRB";   break;
+					case XSDRC:   op_name = "XSDRC";   break;
+					case XSDRE:   op_name = "XSDRE";   break;
+					case XSDRTDO: op_name = "XSDRTDO"; break;
+				}
 
 				if (xsvf_read_buffer(xsdrsize, xsvf_fd, dr_out_buf) != ERROR_OK)
 				{
@@ -429,6 +439,14 @@ COMMAND_HANDLER(handle_xsvf_command)
 					break;
 				}
 
+				if ((opcode == XSDRB) || (opcode == XSDRC)) break;
+
+				if (opcode == XSDRE) {
+					if (xendir != TAP_DRPAUSE)
+						result = svf_add_statemove(xenddr);
+					break;
+				}
+
 				if (opcode == XSDRTDO)
 				{
 					if (xsvf_read_buffer(xsdrsize, xsvf_fd, dr_in_buf)  != ERROR_OK)
@@ -532,21 +550,6 @@ COMMAND_HANDLER(handle_xsvf_command)
 			unsupported = 1;
 			break;
 
-		case XSDRB:
-			LOG_ERROR("unsupported XSDRB\n");
-			unsupported = 1;
-			break;
-
-		case XSDRC:
-			LOG_ERROR("unsupported XSDRC\n");
-			unsupported = 1;
-			break;
-
-		case XSDRE:
-			LOG_ERROR("unsupported XSDRE\n");
-			unsupported = 1;
-			break;
-
 		case XSDRTDOB:
 			LOG_ERROR("unsupported XSDRTDOB\n");
 			unsupported = 1;
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to