BBN-Q / libx6

C/C++ driver for BBN X6-1000 firmware
Apache License 2.0
1 stars 1 forks source link

run_tests: check_kernel failing #53

Open matthewware opened 5 years ago

matthewware commented 5 years ago

Seems the read_kernel: https://github.com/BBN-Q/libx6/blob/9f2f298d1cf171ca84a896bb16706e37dae68fb2/test/test_libx6.cpp#L98 isn't updating val. run_tests produces:

/home/qlab/BBN/libx6/test/test_libx6.cpp:100: FAILED:
  CHECK( std::real(val) == Approx( std::real(kernel[checkIdx[ct]])).epsilon( 2.0 / (1 << 15)) )
with expansion:
  0.2486648152 == Approx( -0.7290501595 )
with message:
  Read back: (0.248665,-0.613575) ; expected: (-0.72905,0.629422)

/home/qlab/BBN/libx6/test/test_libx6.cpp:101: FAILED:
  CHECK( std::imag(val) == Approx( std::imag(kernel[checkIdx[ct]])).epsilon( 2.0 / (1 << 15)) )
with expansion:
  -0.613574633 == Approx( 0.6294224262 )
with message:
  Read back: (0.248665,-0.613575) ; expected: (-0.72905,0.629422)

/home/qlab/BBN/libx6/test/test_libx6.cpp:100: FAILED:
  CHECK( std::real(val) == Approx( std::real(kernel[checkIdx[ct]])).epsilon( 2.0 / (1 << 15)) )
with expansion:
  0.2486648152 == Approx( -0.9229994416 )
with message:
  Read back: (0.248665,-0.613575) ; expected: (-0.922999,0.864578)

/home/qlab/BBN/libx6/test/test_libx6.cpp:101: FAILED:
  CHECK( std::imag(val) == Approx( std::imag(kernel[checkIdx[ct]])).epsilon( 2.0 / (1 << 15)) )
with expansion:
  -0.613574633 == Approx( 0.8645778894 )
with message:
  Read back: (0.248665,-0.613575) ; expected: (-0.922999,0.864578)

...

gribeill commented 5 years ago

So it seems like it does update the value as it works when you fill the kernel to a constant value. Seems like this change tracks to the addition of the correlators -- possibly an offset into memory changed? @BillyKalfus can you investigate?

BillyKalfus commented 5 years ago

When new features were added in August (see commit here) before the correlators were added (in December), register locations did indeed move. I would suspect it is working for a constant-value kernel because there is a mismatch between the register address that libx6 is using for the kernel memory interface and the actual register address, so it's just writing the single kernel value to that (incorrect) register and "successfully" reading it back. However, this didn't change with the addition of the correlators. Can you confirm that this was functioning after the time of the referenced commit? Additionally, I would check to make sure that the X6 is running the latest firmware.

@gribeill Can you provide some more context about tracking the change to the correlators?

gribeill commented 5 years ago

@BillyKalfus what I meant was that the tests pass before that commit. It does indeed seem that the kernel is being read back from some "invalid" memory address. This is actually a board with older firmware, though... I will update the firmware and report back. We should make a decision about how to handle boards with older firmware at some point.