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

Patch fpga.FPGAProgram at runtime to detect if the FPGA was actually programmed #36

Merged
merged 1 commit into from
Feb 15, 2021

Conversation

alphan
Copy link
Contributor

@alphan alphan commented Feb 13, 2021

We currently don't force reprogramming the FPGA on CW305 if it's already programmed. This is fine except when you have a bitstream and forget about this behavior (like me). This change prints a more accurate message indicating whether the FPGA was actually programmed or not.

…programmed

Signed-off-by: Alphan Ulusoy <alphan@google.com>
@alphan alphan requested review from moidx and vogelpi February 13, 2021 15:03
Copy link
Collaborator

@moidx moidx left a comment

Choose a reason for hiding this comment

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

LGTM

I do agree, this solution seems fragile. Maybe we should look at pushing a patch to CW to determine if an update is going to take effect, or something else?

cw/cw305/util/device.py Show resolved Hide resolved
@alphan
Copy link
Contributor Author

alphan commented Feb 13, 2021

Thanks for the quick review @moidx.

I do agree, this solution seems fragile. Maybe we should look at pushing a patch to CW to determine if an update is going to take effect, or something else?

Yes, we should try doing that. I took a quick look at _con in CW305.py and it looks like the code both connects to the FPGA and programs it there so we don't really have a way to check this before programming and after programming the FPGA is already programmed. Since the function doesn't return anything now, we could ask NewAE to consider returning something to indicate if the FPGA was actually programmed or not.

@alphan
Copy link
Contributor Author

alphan commented Feb 13, 2021

I took another look at CW305.py and noticed that there is get_fpga_buildtime but unfortunately it doesn't seem to work properly now. Created newaetech/chipwhisperer#306 #39 and newaetech/chipwhisperer#307.

@alphan alphan mentioned this pull request Feb 13, 2021
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 @alphan for checking this out (and for triggering the other discussions). This may be a bit fragile but it's definitely suitable until we have the option working that can read the build time of the programmed bitstream.

@alphan alphan merged commit 23621d0 into lowRISC:master Feb 15, 2021
@alphan alphan deleted the fpga-program-runtime-patch branch February 16, 2021 13:54
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

3 participants