#!/usr/bin/env python
"""creates a CLK + TRG daisy chain using the SYNC (HDMI) ports
where UUTM is the ip-address or host name of first uut
trigger on UUTM triggers all other slaves in the chain
.. rst-class:: hidden
usage: make_clktrg_chain.py [-h] [--trg TRG] [--clk CLK] uuts [uuts ...]
make_clktrg_chain
positional arguments:
uuts uut : UUTM, UUTS ...
optional arguments:
-h, --help show this help message and exit
--trg TRG trigger fp|soft
--clk CLK clk 0=fp | intclk in Hz
"""
import sys
import acq400_hapi
import argparse
[docs]def make_chain(args):
uuts = [acq400_hapi.Acq400(u) for u in args.uuts]
uutm = uuts[0]
UUTS = uuts[1:]
uutm.set_sync_routing_master( \
trg_dx = "d0" if args.trg=="fp" else "d1", \
clk_dx = "d0" if args.clk==0 else "d1" )
if args.clk > 0:
uutm.set_mb_clk(args.clk)
for uut in UUTS:
uut.set_sync_routing_slave()
[docs]def get_parser():
parser = argparse.ArgumentParser(description='Sync routing chain')
parser.add_argument('--trg', default='fp', type=str, help="trigger fp|soft")
parser.add_argument('--clk', default='0', type=int, help='clk 0=fp | intclk in Hz')
parser.add_argument('uuts', nargs='+', help="uut : UUTM, UUTS ...")
return parser
if __name__ == '__main__':
make_chain(get_parser().parse_args())