running kernels from different objects on the same core driver breaks #296

Closed
opened 2022-06-06 23:01:02 +08:00 by sb10q · 1 comment

Running tests one by one works:

> ARTIQ_ROOT=/home/sb/artiq/artiq/examples/kc705_nist_clock python -m unittest test_i2c.I2CTest.test_i2c_switch -v
test_i2c_switch (test_i2c.I2CTest) ... Mismatch between gateware (7.8070.4ddd273.beta) and software (8.0.beta) versions
ok

----------------------------------------------------------------------
Ran 1 test in 0.211s

OK
> ARTIQ_ROOT=/home/sb/artiq/artiq/examples/kc705_nist_clock python -m unittest test_i2c.I2CTest.test_nonexistent_bus -v
test_nonexistent_bus (test_i2c.I2CTest) ... Mismatch between gateware (7.8070.4ddd273.beta) and software (8.0.beta) versions
ok

----------------------------------------------------------------------
Ran 1 test in 0.154s

OK

But running them in the same session breaks, likely because the test infrastructure (artiq.test.hardware_testbench) is reusing the core device driver with different kernel objects:

> ARTIQ_ROOT=/home/sb/artiq/artiq/examples/kc705_nist_clock python -m unittest test_i2c.I2CTest -v
test_i2c_switch (test_i2c.I2CTest) ... Mismatch between gateware (7.8070.4ddd273.beta) and software (8.0.beta) versions
ok
test_nonexistent_bus (test_i2c.I2CTest) ... ERROR

======================================================================
ERROR: test_nonexistent_bus (test_i2c.I2CTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/sb/artiq/artiq/test/coredevice/test_i2c.py", line 57, in test_nonexistent_bus
    self.execute(NonexistentI2CBus)
  File "/home/sb/artiq/artiq/test/hardware_testbench.py", line 59, in execute
    raise error from None
  File "/home/sb/artiq/artiq/test/hardware_testbench.py", line 54, in execute
    exp.run()
  File "/home/sb/artiq/artiq/language/core.py", line 79, in run_on_core
    return self.core.run(fake_method, args, kwargs)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 83, in run
    kernel_library = self.compile(function, args, kwargs, embedding_map)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 77, in compile
    return self.compiler.compile_method_to_mem(obj, name, args, embedding_map)
nac3artiq.CompileError: compilation failed
----------
type error inside object launching kernel: <class 'test_i2c.NonexistentI2CBus'> is not registered with NAC3 (@nac3 decorator missing?)

----------------------------------------------------------------------
Ran 2 tests in 0.212s

FAILED (errors=1)

(This can probably be worked around in artiq.test.hardware_testbench, but points to deeper problems with NAC3).

Running tests one by one works: ``` > ARTIQ_ROOT=/home/sb/artiq/artiq/examples/kc705_nist_clock python -m unittest test_i2c.I2CTest.test_i2c_switch -v test_i2c_switch (test_i2c.I2CTest) ... Mismatch between gateware (7.8070.4ddd273.beta) and software (8.0.beta) versions ok ---------------------------------------------------------------------- Ran 1 test in 0.211s OK > ARTIQ_ROOT=/home/sb/artiq/artiq/examples/kc705_nist_clock python -m unittest test_i2c.I2CTest.test_nonexistent_bus -v test_nonexistent_bus (test_i2c.I2CTest) ... Mismatch between gateware (7.8070.4ddd273.beta) and software (8.0.beta) versions ok ---------------------------------------------------------------------- Ran 1 test in 0.154s OK ``` But running them in the same session breaks, likely because the test infrastructure (``artiq.test.hardware_testbench``) is reusing the core device driver with different kernel objects: ``` > ARTIQ_ROOT=/home/sb/artiq/artiq/examples/kc705_nist_clock python -m unittest test_i2c.I2CTest -v test_i2c_switch (test_i2c.I2CTest) ... Mismatch between gateware (7.8070.4ddd273.beta) and software (8.0.beta) versions ok test_nonexistent_bus (test_i2c.I2CTest) ... ERROR ====================================================================== ERROR: test_nonexistent_bus (test_i2c.I2CTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sb/artiq/artiq/test/coredevice/test_i2c.py", line 57, in test_nonexistent_bus self.execute(NonexistentI2CBus) File "/home/sb/artiq/artiq/test/hardware_testbench.py", line 59, in execute raise error from None File "/home/sb/artiq/artiq/test/hardware_testbench.py", line 54, in execute exp.run() File "/home/sb/artiq/artiq/language/core.py", line 79, in run_on_core return self.core.run(fake_method, args, kwargs) File "/home/sb/artiq/artiq/coredevice/core.py", line 83, in run kernel_library = self.compile(function, args, kwargs, embedding_map) File "/home/sb/artiq/artiq/coredevice/core.py", line 77, in compile return self.compiler.compile_method_to_mem(obj, name, args, embedding_map) nac3artiq.CompileError: compilation failed ---------- type error inside object launching kernel: <class 'test_i2c.NonexistentI2CBus'> is not registered with NAC3 (@nac3 decorator missing?) ---------------------------------------------------------------------- Ran 2 tests in 0.212s FAILED (errors=1) ``` (This can probably be worked around in ``artiq.test.hardware_testbench``, but points to deeper problems with NAC3).
sb10q added this to the Alpha milestone 2022-06-06 23:01:02 +08:00
sb10q added the
high-priority
label 2022-06-06 23:01:02 +08:00
ychenfo was assigned by sb10q 2022-06-06 23:01:04 +08:00
Poster
Owner

This was fairly simple after all. Fixed in ba30705fa5

This was fairly simple after all. Fixed in https://github.com/m-labs/artiq/commit/ba30705fa5778a9621e22b28b44010c3e8dd18df
sb10q closed this issue 2022-06-06 23:14:41 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
1 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#296
There is no content yet.