Urukul 9910: Incompatible types: Option[artiq.coredevice.ttl.TTLOut] and artiq.coredevice.ttl.TTLOut #271

Closed
opened 2022-04-21 17:26:32 +08:00 by mwojcik · 1 comment
Member

Urukul 9910 2-EEM no sync. Frequency/amplitude looks OK, RF switch control fails:

Testing RF switch control. Check LEDs at urukul RF ports.
Press ENTER when done.
Traceback (most recent call last):
  File "/nix/store/b0ai3cffsrn33brd790fwgvh6qnpmz00-python3.9-artiq-8.8219.4e7b1c7.beta/bin/.artiq_sinara_tester-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/frontend/artiq_sinara_tester.py", line 808, in main
    experiment.run(tests)
  File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/frontend/artiq_sinara_tester.py", line 759, in run
    getattr(self, f"test_{name}")()
  File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/frontend/artiq_sinara_tester.py", line 342, in test_urukuls
    self.rf_switch_wave([swi.sw for swi in sw])
  File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/language/core.py", line 79, in run_on_core
    self.core.run(fake_method, args, kwargs)
  File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/coredevice/core.py", line 83, in run
    kernel_library = self.compile(function, args, kwargs, embedding_map)
  File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/coredevice/core.py", line 77, in compile
    return self.compiler.compile_method_to_mem(obj, name, args, embedding_map)
nac3artiq.CompileError: type error (Incompatible types: Option[artiq.coredevice.ttl.TTLOut] and artiq.coredevice.ttl.TTLOut) at parameter #0 when calling kernel function
Urukul 9910 2-EEM no sync. Frequency/amplitude looks OK, RF switch control fails: ``` Testing RF switch control. Check LEDs at urukul RF ports. Press ENTER when done. Traceback (most recent call last): File "/nix/store/b0ai3cffsrn33brd790fwgvh6qnpmz00-python3.9-artiq-8.8219.4e7b1c7.beta/bin/.artiq_sinara_tester-wrapped", line 9, in <module> sys.exit(main()) File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/frontend/artiq_sinara_tester.py", line 808, in main experiment.run(tests) File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/frontend/artiq_sinara_tester.py", line 759, in run getattr(self, f"test_{name}")() File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/frontend/artiq_sinara_tester.py", line 342, in test_urukuls self.rf_switch_wave([swi.sw for swi in sw]) File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/language/core.py", line 79, in run_on_core self.core.run(fake_method, args, kwargs) File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/coredevice/core.py", line 83, in run kernel_library = self.compile(function, args, kwargs, embedding_map) File "/nix/store/9bc18l7dm0wq75v99p1icf69zd9h5wqg-python3-3.9.11-env/lib/python3.9/site-packages/artiq/coredevice/core.py", line 77, in compile return self.compiler.compile_method_to_mem(obj, name, args, embedding_map) nac3artiq.CompileError: type error (Incompatible types: Option[artiq.coredevice.ttl.TTLOut] and artiq.coredevice.ttl.TTLOut) at parameter #0 when calling kernel function ```
Collaborator

It seems to me that [swi.sw for swi in sw] will give a list of type list[Option[TTLOut]] (because swi is of type AD9910, whose field sw is of type Option[TTLOut]), but method rf_switch_wave expects list[TTLOUT]? Maybe use [swi.sw.unwrap() for swi in sw]?

The error message can be improved indeed, will look into it. Thanks for reporting this!

It seems to me that `[swi.sw for swi in sw]` will give a list of type `list[Option[TTLOut]]` (because `swi` is of type `AD9910`, whose field `sw` is of type `Option[TTLOut]`), but method `rf_switch_wave` expects `list[TTLOUT]`? Maybe use `[swi.sw.unwrap() for swi in sw]`? The error message can be improved indeed, will look into it. Thanks for reporting this!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#271
No description provided.