Hi all,

I spent a few hours** playing with Perl and followed through with a
couple of ideas that had floated through the list in the past.  The
results of that work are attached.  Share and enjoy.

The first file, JTAG.pm, is a Perl module that defines the TAP state
machine and provides routines for accessing and traversing it.  These
were loosely modeled on the existing OpenOCD APIs and could probably
stand to be improved and extended.

The second script, jtag_state_graph.pl, will create a SVG image of the
state machine using the GraphViz perl module (jtag_state_machine.svg).
It too needs a little clean-up, as I seem to have exposed a bug with the
'rank' node attributes that creates a phantom 'node17'.  Annoying, but
this graph would suffice for the JTAG Primer after some post-processing.

The third file, jtag_state_table.pl, creates a C source file that
contains the complete TAP transition table and associated path lengths.
The generated code file contains replacements for existing functions of
the same name; however, this is _NOT_ intended for immediate integration
into the system (maybe for 0.3.0).  I have not even tried to compile it.
It is proof-of-concept for an idea posted on this list in the past few
months by another contributor, but I cannot find that reference now.

The last file is a trivial Makefile used for testing purposes.

I am thinking about adding these scripts in the tree (in tools/), but I
would like to hear some feedback about them first.

Cheers,

Zach

** I did this work before turning to project management tasks, but I
thought it still worth providing a constructive diversion. :)

Attachment: JTAG.pm
Description: Perl program

Attachment: jtag_state_graph.pl
Description: Perl program

Attachment: jtag_state_table.pl
Description: Perl program

TARGETS = jtag_state_table.c jtag_state_graph.svg

all: $(TARGETS)

%.c: %.pl
	perl $<
	
%.svg: %.pl
	perl $<

clean:
	rm -f $(TARGETS)
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to