Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/coredevice: Add input gate/timestamp test #1136

Closed
wants to merge 1 commit into from

Conversation

dnadlinger
Copy link
Collaborator

Expected to be broken based on local tests.

def run(self):
# Make sure there are no leftover events.
self.core.break_realtime()
self.loop_in.count()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be leftover events because of the very bug you are testing against (due to the gateware latency in the timestamp counter to gate path, the timeout - referenced to the timestamp counter - is too small and the kernel thinks the gateware has closed the gate when it has not). Use core.reset() instead.

self.core.reset()

# Determine loop delay.
self.core.break_realtime()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reset() already does break_realtime().

if not (gate_start_mu < in_mu < gate_end_mu):
raise PulseNotReceived("Input event should occur during gate")
if not (-2 < (in_mu - out_mu - loop_delay_mu) < 2):
raise PulseNotReceived("Loop delay should not change")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PulseNotReceived?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about IncorrectPulseTiming?

if in_mu < 0:
raise PulseNotReceived("No input event")
if not (gate_start_mu < in_mu < gate_end_mu):
raise PulseNotReceived("Input event should occur during gate")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now there is an uncompensated latency offset between the gate and the input. So, the received timestamps can be slightly outside the gate. This offset also causes the pulse not to be received above.

self.loop_in.gate_rising_mu(24)
gate_end_mu = now_mu()

out_mu = gate_start_mu - loop_delay_mu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ 3*8 compensates for latency offset (then the pulse arrives in the middle of the gate).

sbourdeauducq added a commit that referenced this pull request Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants