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

[capture, WaveRunner] Handling cycle based cfg for WaveRunner and debug #242

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

johannheyszl
Copy link
Collaborator

@johannheyszl johannheyszl commented Dec 5, 2023

After scripting modifications and restructure re cycle based scope config for Husky, this PR now makes the modifications for WaveRunner to handle reasonably. Sampling rate is also given through cfg for cycle to sample converts, but then also fetched from scope and compared.

Also, some debug was required and fixes added.

Closes #210

Copy link
Member

@nasahlpa nasahlpa left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

capture/configs/aes_sca_cw310.yaml Outdated Show resolved Hide resolved
Copy link
Collaborator

@vogelpi vogelpi left a comment

Choose a reason for hiding this comment

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

Thanks for your PR @johannheyszl ! I have some question regarding the WaveRunner setup.

capture/configs/aes_sca_cw310.yaml Outdated Show resolved Hide resolved
Comment on lines -52 to +55
# TODO: Implement for Waverunner. Get sampling rate from scope and
# return.
return None
# Waverunner init not done yet, so cannot be read from WaveRunner.
raise RuntimeError("WAVERUNNER: ERROR: Sampling rate for WaveRunner "
"not given in configuration.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would there be an option to first init the scope with some example values, then read the configured sampling rate and do the config again with the proper values? This may sound very awkward but see my next comment for the motivation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The main issue is we want to convert cycles to samples before we create the scope because we hand those parameters to the constructor. But for the same reason we dont have a scope yet to read the sampling rate from it :)

Comment on lines +91 to +98
# Get current sampling rate from scope compare to cfg for sanity
setup_data = scope._ask("PANEL_SETUP?")
scope._get_and_print_cmd_error()
tmp_sampling_rate = int(re.findall(r'SampleRate = \d+', setup_data)[0][13:])
if self.scope_cfg.sampling_rate is not None:
if self.scope_cfg.sampling_rate != tmp_sampling_rate:
raise RuntimeError("WAVERUNNER: Error: WaveRunner sampling "
"rate does not match given configuration!")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is really non-ideal in the sense that if you want to change the sampling rate, you now have to configure the proper value on the scope and then also in the config file. So the user has to change the same value in two positions. I thought the whole reason for reading out the sampling rate value from the scope was to easily tune it without having to modify the config file. Instead of simplifying working with the framework, we now make it more difficult.

I suggest to do either:

  • Removing the option to read out the sampling rate from the scope and make the framework more stupid but simpler.
  • If a sampling rate is defined in the config, use that. If not, do an init of the WaveRunner scope before knowing the correct sample values, then read the sampling rate from the scope, compute the sample values and reconfigure the scope.

Do you think that would work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah it's not nice for the reason I stated in he above comment.

I am fine with different ways to deal with it:

  • We could have two alternative scope constructors on the 'API', one based on samples, one based on cycles and internally they can nicely share the code.
  • We can also remove the cycle cfg for waverunner alltogether.
  • others ...

The only one I am opposed to is setting the sampling rate through config and loading it to the scope because it will mess up with the other settings very often and unpleasantly surprise lab technicians :D

…ng after scripting changes

Signed-off-by: Johann Heyszl <[email protected]>
@nasahlpa nasahlpa merged commit 1da5f85 into lowRISC:master Dec 8, 2023
5 checks passed
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.

[scope] Adapt waverunner to cycle-based config
3 participants