forked from M-Labs/artiq
1
0
Fork 0

frontend: add artiq_rtiomon

This commit is contained in:
Sebastien Bourdeauducq 2018-09-15 10:44:59 +08:00
parent 312256a18d
commit eaeab0c9bd
2 changed files with 40 additions and 0 deletions

39
artiq/frontend/artiq_rtiomon.py Executable file
View File

@ -0,0 +1,39 @@
#!/usr/bin/env python3
import argparse
import asyncio
from artiq.coredevice.comm_moninj import *
def get_argparser():
parser = argparse.ArgumentParser(
description="ARTIQ RTIO monitor")
parser.add_argument("core_addr", metavar="CORE_ADDR",
help="hostname or IP address of the core device")
parser.add_argument("channel", metavar="CHANNEL", type=lambda x: int(x, 0), nargs="+",
help="channel(s) to monitor")
return parser
def main():
args = get_argparser().parse_args()
loop = asyncio.get_event_loop()
try:
comm = CommMonInj(
lambda channel, probe, value: print("0x{:06x}: {}".format(channel, value)),
lambda channel, override, value: None)
loop.run_until_complete(comm.connect(args.core_addr))
try:
for channel in args.channel:
comm.monitor_probe(True, channel, 0)
loop.run_forever()
finally:
loop.run_until_complete(comm.close())
finally:
loop.close()
if __name__ == "__main__":
main()

View File

@ -29,6 +29,7 @@ console_scripts = [
"artiq_influxdb = artiq.frontend.artiq_influxdb:main",
"artiq_master = artiq.frontend.artiq_master:main",
"artiq_mkfs = artiq.frontend.artiq_mkfs:main",
"artiq_rtiomon = artiq.frontend.artiq_rtiomon:main",
"artiq_session = artiq.frontend.artiq_session:main",
"artiq_rpctool = artiq.frontend.artiq_rpctool:main",
"artiq_run = artiq.frontend.artiq_run:main",