m-labs / artiq

A leading-edge control system for quantum information experiments
https://m-labs.hk/artiq
GNU Lesser General Public License v3.0
434 stars 201 forks source link

Gateware build fails if there are no moninj probes #1202

Closed cjbe closed 5 years ago

cjbe commented 5 years ago

Bug Report

One-Line Summary

If a gateware target has no moninj probes (for example, consists only of an SUServo) the gateware build errors-out.

Issue Details

Steps to Reproduce

The following gateware target results in an error:

class Satellite(_SatelliteBase):
    def __init__(self, *args, **kwargs):
        _SatelliteBase.__init__(self, *args, rtio_clk_freq=125e6, **kwargs)
        platform = self.platform

        self.rtio_channels = []

        eem.SUServo.add_std(
            self, eems_sampler=(9,8),
            eems_urukul0=(1, 0), eems_urukul1=(3, 2))

        self.add_rtio(self.rtio_channels)

The error:

$ python -m artiq.gateware.targets.kasli_hoa2 -V satellite
SUServo (EEM9) starting at RTIO channel 0
Traceback (most recent call last):
  File "C:\Users\Chris\Miniconda3\envs\artiq-test\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Chris\Miniconda3\envs\artiq-test\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\scratch\artiq\artiq\gateware\targets\kasli_hoa2.py", line 89, in <module>
    main()
  File "C:\scratch\artiq\artiq\gateware\targets\kasli_hoa2.py", line 84, in main
    soc = cls(**soc_kasli_argdict(args))
  File "C:\scratch\artiq\artiq\gateware\targets\kasli_hoa2.py", line 63, in __init__
    self.add_rtio(self.rtio_channels)
  File "C:\scratch\artiq\artiq\gateware\targets\kasli.py", line 1079, in add_rtio
    self.submodules.rtio_moninj = rtio.MonInj(rtio_channels)
  File "C:\scratch\artiq\artiq\gateware\rtio\moninj.py", line 67, in __init__
    self.submodules.mon = Monitor(channels)
  File "C:\scratch\artiq\artiq\gateware\rtio\moninj.py", line 11, in __init__
    max_probe_len = max(len(p) for cp in chan_probes for p in cp)
ValueError: max() arg is an empty sequence

Your System

Using current Artiq master (57caa7b)

sbourdeauducq commented 5 years ago

You can remove the moninj core completely in that case; the firmware should handle this. I don't think there are cases where there is injection but not monitoring.