#ifndef _SVF_H #define _SVF_H #include "jtag_core/jtag_core.h" /* * SVF player (single-device chain). * * Plays a standard subset of Serial Vector Format over the currently * open probe, using the bscan_* TAP primitives. SVF is what Libero, * Diamond/Radiant, Vivado, … export with the vendor programming * algorithm already baked in, so one player programs many targets with * no per-vendor code. * * Supported: SIR / SDR with TDI/TDO/MASK/SMASK and a masked TDO compare; * RUNTEST (TCK/SCK counts and SEC delays); STATE (RESET / IDLE); * ENDIR / ENDDR (IDLE only); HIR/HDR/TIR/TDR (length 0 only); TRST; * FREQUENCY. SMASK is parsed but not applied. * * Not supported (single-device tool): non-zero header/trailer scans * (multi-device chains) and non-IDLE stable end states — both rejected * with a clear error. * * log() receives progress / error lines (is_error != 0 on failure). * Returns 0 on success, < 0 on parse error or a TDO compare mismatch. * stats may be NULL. */ typedef void (*svf_log_fn)(void *user, int is_error, const char *msg); typedef struct { long commands; /* commands executed */ long scans; /* SIR + SDR */ long compares; /* TDO compares performed */ } svf_stats; int svf_play_file(jtag_core *jc, const char *path, svf_log_fn log, void *user, svf_stats *stats); #endif