Boundary Scan with OpenOCD?

It would be extremely useful feature (for me in my current project), if OpenOCD would be able to execute steps of an SVF file. If OpenOCD is already able to do this somehow, please let me know. If not, I will start on this project. Syntax example:

SDR 2157 TDI (000000000000000080492412092412092400000000080412

0120000804100020804000120120804000000020924120924

9249249248040008000200001241200048048040040041001

0480410012010490000082090092092412092092410002402

4924920124124024924104924904124800100004804104100

1040049049249249249249249249000000000000000201249

2492492490482490000000002412480480002010400082010

0004804820100000000024904824904824920100000000000

0000249249040048241240240240201240248209000248000

0490002492482092492412010482492480092412492090492

0920120020000104104820800820100104004024024024000

TDO (0492492492492492090090402492402000492492492090402

4024920900000000904924024020904924924920004020004

9249240209049249249249249248249009049049249041241

0090412412412412492092012002000402002000090000000

4924804000800000004100000124800924124900904924124

9249049209209201049209249241249249249249248241009

2492480010080012492492482410090092482400000002412

4900900824124924924800100924900824024124924924924

9248249249049208048249248049241249049209248009249

0012480000082000000400492490000080480400002010002

0024024824924124124820920824124104904904904804920

MASK (049249249249249209000040200040200049249249209040

2402492090000000090492402402090492492482000402000

0000000000904920924824924000000000000000000004000

0000000000000000000000001200000000000000001000000

0000000400000000000000000010400090000000000000000

0000000000000000000000000000124924924924924824000

0000000001008001249249248040009009248240000000241

2490090082412492492480010080010080002412492492492

4924800000000000000000004800824000000000000000004

1000200000000000000000040000000008000000000000000

0002400000000010000000000000000010000000000000000

00);

Apparently there was an attempt to get SVF support built into OpenOCD and even STAPL (message from September 17th, 2005):

"

XSVF player working

Openocd has been successfully used to program the Xilinx CPLD inside an Amontec Chameleon (Coolrunner XCR3128XL) using the bitbang interface on a PC parallel port. This is the first real use of the new codebase I’ve been working on. I’m looking to integrate SVF and STAPL support, too, but that’ll take some time, I guess.

Documentation for the JTAG API (this should be final for now) will follow soon.

"

Dominic, do you have some news about this?

Hello Albert,

the XSVF player is working nicely, but it’s only been tested with XSVF files for Xilinx CPLDs (CoolRunner). The XSVF player is available from the telnet interface via the “xsvf” command.

SVF support requires a lot more parsing, and I only have Xilinx devices for which XSVF is sufficient.

STAPL would be a nice feature, but it’s rather complex, and I haven’t even started working on this.

Do you want to use SVF for boundary-scan testing, i.e. to verify your PCBs, or do you want to use it for in-system programming of EEPROMs/CPLDs/FPGAs?

Regards,

Dominic

Hi Dominic,

Boundary scan based in system programming would be interesting in the future, but currently I am only looking for an easy to use and inexpensive (like OpenOCD) solution to play test vectors step-by-step. For testing purpose. Just playing a complete SVN file is not enough for me, because I would want to extend the boundary scan with external sensors (for example couple of MAX7300 I2C 28bit GPIO ICs).

For my task it would be ideal to extend the TELNET command set with one which would execute a single vector, and it would return OK or ERROR with the diff vector, where the diff vector would be the ((TDO specified) XOR (actual TDO received) ) AND (MASK specified).

It would be convenient if this TELNET command’s syntax would match the syntax of a vector inside an SVN file. For example:

SDR 2157 TDI (000000000000000080492412092412092400000000080412

0120000804100020804000120120804000000020924120924

9249249248040008000200001241200048048040040041001

0480410012010490000082090092092412092092410002402

4924920124124024924104924904124800100004804104100

1040049049249249249249249249000000000000000201249

2492492490482490000000002412480480002010400082010

0004804820100000000024904824904824920100000000000

0000249249040048241240240240201240248209000248000

0490002492482092492412010492492480092412492090492

0920120020000104104820800820100104004024024024000

TDO (0492492492492492090090402492402000492492492090402

4024920900000000904924024020904924924920004020004

9249240209049249249249249248249009049049249041241

0090412412412412492092012002000402002000090000000

4924804000800000004100000124800924124900904924124

9249049209209201049209249241249249249249248241009

2492480010080012492492482410090092482400000002412

4900900824124924924800100924900824024124924924924

9248249249049208048249248049241249049209248009249

0012480000082000000400492490000080480400002010002

0024024824924124124820920824124104904904904804920

MASK (049249249249249209000040200040200049249249209040

2402492090000000090492402402090492492482000402000

0000000000904920924824924000000000000000000004000

0000000000000000000000001200000000000000001000000

0000000400000000000000000010400090000000000000000

0000000000000000000000000000124924924924924824000

0000000001008001249249248040009009248240000000241

2490090082412492492480010080010080002412492492492

4924800000000000000000004800824000000000000000004

1000200000000000000000040000000008000000000000000

0002400000000010000000000000000010000000000000000

00);

I notice one problem however with this syntax.

The TELNET command interpreter will try to interpret each line separately.

And this command would be too long to fit into one line. It would probably cause some buffer overflow. What do you think? How would you implement? Should I put each vector to a separate file and the telnet command just points to the file? Or put each vector into a single SVF file (they are already there) and the telnet command would select the vector to run by index. There could be a from and a to index in the command syntax for multiple vector execution. If none is specified, this imaginary telnet command would just execute each vector from the specified SVF file. The error message would have to show the index too, not just the diff vector.

By the way is there a link where I could find more information about the var combined with the drscan commands. They might be sufficient for my job.