
NAME	
	injtag2in -  preprocess .jin file into .in, handling JTAG extensions

SYNOPSIS

  injtag2in [options] file
  -J DIR  Search DIR for jtag register descriptions,
             in addition to checking current directory
  -c C    make TCK half-period C clk cycles, default 8
  -t T    produce Xs on TDO for T clk cycles after falling TCK; default 2C-1
  -r R    read back and check the first R instructions
  -v	  verbose

DESCRIPTION

Injtag2in is a preprocessor for .in files.  It accepts .in files with
an extended syntax describing JTAG operations, and produces normal .in files.

A jtag-extended .in file has two additions over the normal .in file:

1. A new header section "jtag", which must be the first one in the file
format:

	jtag:
	REGISTER-NAME INSTRUCTION-REGISTER-VALUE regdesc-file-name
	REGISTER-NAME INSTRUCTION-REGISTER-VALUE LENGTH

example:

	jtag:
	RESADJ 0xA mct.rreg
	BYPASS 0xf 1

If the lenggth is specified instead of a register-description file,
the register can only be used with the @continuity operation.
Note that register-description filenames may not start with a digit.


2. The "vectors:" section may contain meta-lines beginning with @ that
specify JTAG operations.  The formats of these are:

@set register-name bit=value bit=value bit=value
@expect register-name bit=value bit=value bit=value
@scan register-name - load IR if needed, then scan DR
@scandr register-name    scan DR without setting IR
      		   applies set/expect for the given register name
@setinst register-name - load IR unconditionaly

@continuity register-length scan an unnamed register of the given length

Bit names in @set and @expect can have bit-expansions of the form {msb:lsb}
or can have wildcards specified with the shell-style "*" (but not both)

We require the first two input fields in the .in
file to be the 3-bit field TCK TRST TMS and the one-bit field TDI.
the first output field must be the single bit TDO.

A jtag register description file can an output file from jtagtab or
may be hand-crafted.  In these files, comments begin with '#' and run
to end of line.  Other lines are expected to contain 4
whitespace-seperated fields, stop-number, cell-type, pin-number, and
sigal/function.


FUTURE WORK

The normal .in file parser could be extended with a system of plug-in modules
handling more general extensions including those handled by injtag2in.

Seperate the instruction name from the register name,
so that e.g. both SAMPLE/PRELOAD and EXTTEST can refere to the same
register with different instructions.

Unify register-description file format with the similar format used by the
Jtag:: perl modules.

Extend this preliminary document and convert it to docbook/refentry format.

BUGS

The "jtag:" section of the header is required to come before any other
header sections.

SEE ALSO

infile(5)
