MCE script utilities
This page describes a few of the programs provided by MCE script. They can be found in the utilities subdirectory.
eat_packets
Located in eat_packets.c and sequence.[ch].
This is for doing quick analysis of frame data file integrity. Currently (07.10.15) it checks:
- contiguity of the frame sequence number
- contiguity of the sync box dv number
- frame checksum
Use it like this:
eat_packets -n <packet size> -f $DATADIR/scheduler.1191347010
Where:
- <packet size> = [(43 header words) + (num_rows_reported)*(8 columns)*(# RCs reporting) + (1 checksum word)] * 4
- = 1488 (for 1 RC & 41 rows) or
- = 5424 (for 4 RCs & 41 rows) or
- = 1232 (for 1 RC & 33 rows) or
- = 4400 (for 4 RCs & 33 rows)
- <filename> is the same filename that was used to capture a data file above.
Other options are:
-s offset in bytes (skip to some offset in the file/stream) -n frame_size in bytes -N frame_size in dwords -d [1|0] to enable/disable checking of the sync dv number -f filename otherwise data is read from stdin
The output looks like this:
frame_size=308 -> 1232 offset frm_idx frame# 0000000000 0 1 surprise frame_seq 1, after sequence [0,0) 0000000000 0 1 surprise sync_dv 63408271, after sequence [0,0) 0x0009c1b0 519 520 surprise sync_dv 63409822, after sequence [63408271,63408790) 0x0009c680 520 521 surprise sync_dv 63408791, after sequence [63409822,63409823) 0x0029b6f0 2219 2220 surprise sync_dv 63412538, after sequence [63408791,63410490) 0x0029bbc0 2220 2221 surprise sync_dv 63410491, after sequence [63412538,63412539) 0x004515f0 3675 3676 surprise sync_dv 63413994, after sequence [63410491,63411946) 0x00451ac0 3676 3677 surprise sync_dv 63411947, after sequence [63413994,63413995) 0x005b57f0 4859 4860 surprise sync_dv 63413134, after sequence [63411947,63413130) 0x005b5cc0 4860 4861 surprise sync_dv 63413131, after sequence [63413134,63413135) 0x006b6f70 5715 5716 surprise sync_dv 63413987, after sequence [63413131,63413986) 0x006b7440 5716 5717 surprise sync_dv 63413987, after sequence [63413987,63413988) 0x00863470 7139 7140 surprise sync_dv 63419507, after sequence [63413987,63415410) 0x00863940 7140 7141 surprise sync_dv 63415411, after sequence [63419507,63419508) 0x0099c170 8179 8180 surprise sync_dv 63416514, after sequence [63415411,63416450) 0x0099c640 8180 8181 surprise sync_dv 63416451, after sequence [63416514,63416515) 0x009c7b40 8324 8325 surprise sync_dv 63416603, after sequence [63416451,63416595) 0x009c8010 8325 8326 surprise sync_dv 63416596, after sequence [63416603,63416604) 0x00a85320 8954 8955 surprise sync_dv 63422349, after sequence [63416596,63417225) 0x00a857f0 8955 8956 surprise sync_dv 63417226, after sequence [63422349,63422350) 0x00b57240 9652 9653 surprise sync_dv 63417955, after sequence [63417226,63417923) 0x00b57710 9653 9654 surprise sync_dv 63417924, after sequence [63417955,63417956) 0x00bcda60 10046 10047 surprise sync_dv 63422413, after sequence [63417924,63418317) 0x00bcdf30 10047 10048 surprise sync_dv 63418318, after sequence [63422413,63422414) 0x00c38ba0 10402 10403 surprise sync_dv 63418801, after sequence [63418318,63418673) 0x00c39070 10403 10404 surprise sync_dv 63418674, after sequence [63418801,63418802) EOF, exiting after 11600 frames + 0 bytes
From which we conclude that sync_dv is not contiguous. Details:
surprise sync_dv 63413994, after sequence [63410491,63411946)
means that sync_dv numbers from 63410491 to 63411945 were all found, and were found in the right order. But when we expected 63411946, instead we encountered 63413994.
ascii_frame
Spits an ascii data packet out to stdio based on the parameters you pass below. The packets are zero indexed.
ascii_frame <rows> <columns> <filename> <index> [<format>]
i.e.
ascii_frame 41 8 mce_run_1047 0
extract_frames
Extracts a series of frames starting from a specified frame index in a data file. This utility dumps the frames to stdio, and must be re-routed to a file, or piped to hexdump.
extract_frames <filename> <frame_size> <first frame> <frame count>
runfile_scan
Scans the .run file associated with a data file to query the .run file for the values of parameters stored there.
runfile_scan [ -v ] [ -f runfile [ -b 'block_name' [ -k 'key_name' ] ] ]
Where:
- <block_name> = 'HEADER' or 'FRAMEACQ'
- <key_name> = 'RB cc fw_rev', for example