fscareply version 22062100
Tool to parse and display a sequence of bytes as a GBT-SCA reply frame,
optionally as a request (command) frame (option -c)
or as a sequence representing an IC frame (option -I).
It will indicate the CTRL byte, transaction ID, channel, error byte,
data size and data word, if any.
Note that the length (LEN) word in a GBT-SCA reply has little meaning,
the actual number of bytes in the message defines the size of it.
In addition the type of error, if any, will be indicated,
and whether the frame contains an incorrect CRC.
Usage:
 fscareply [-h|V] [-c] [-I] [-r] [<byte0>] [<byte1>] ...
  -h         : Show this help text.
  -V         : Show version.
  -c         : Interpret the sequence as a GBT-SCA (or IC) *request* frame.
  -I         : Interpret the sequence as an *IC* frame.
  -r         : Reverse the byte order before interpretation.
 <byteX>     : Byte X of the reply frame to be parsed (provide it as hex numbers)

Examples:
> fscareply 00 0e 7d 00 00 03 00 fe e6 fb
CTRL=0E(r=0,s=7) TRID=125 Chan=CONF ERR=00 LEN=3 data=0xFE00

> fscareply 00 ec 28 14 00 06 00 00 f3 0b fd 9b
CTRL=EC(r=7,s=6) TRID=40 Chan=ADC ERR=00 LEN=6 data=0x00000BF3

Bytes provided in reversed order:
> fscareply -r 5c 09 06 00 13 36 ec 00
0 ec 36 13 0 6 9 5c : CTRL=EC(r=7,s=6) TRID=54 Chan=JTAG ERR=00 LEN=6 

Indication of a CRC error (could be in CRC itself or in the data bytes),
(here CRC has been changed from 095C to 195C):
> fscareply 00 ec 36 13 00 06 19 5c
CTRL=EC(r=7,s=6) TRID=54 Chan=JTAG ERR=00 LEN=6  ###CRC=095C
