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

Add A1 bitstream and pentest firmware #376

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrea-caforio
Copy link
Collaborator

@andrea-caforio andrea-caforio commented Sep 17, 2024

This commit adds the OpenTitan Earl Grey A1 FPGA bitstream and the pentest binary to the repository. The previous binaries for the Earl Grey Z1 version are retained with the filename suffix z1.

The FPGA bitstream was generated from commit lowRISC/opentitan@282d863 and created with the command:
/bazelisk.sh build //hw/bitstream/vivado:fpga_cw310_test_rom

The pentest binary was generated from commit lowRISC/opentitan@b2cee40 and created with the command:
./bazelisk.sh build //sw/device/tests/penetrationtests/firmware:firmware_fpga_cw310_test_rom

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 @andrea-caforio and @nasahlpa for this PR! This looks good to me.

Two comments:

  • It would be worth mentioning the in the commit message that the simple-serial based binaries are untouched and remain based on Z1. This is perfectly fine as we plan to remove these eventually.
  • It's great that you mention the commit hashes used to build the the binaries and bitstreams. Please note however that in the ot-sca repo, opentitan hashes have no / a different meaning which can cause confusion. Please disambiguate using e.g. lowRISC/opentitan@282d863 . The GitHub UI automatically generates a link to the corresponding commit in the OpenTitan repo which helps a lot.

@vogelpi
Copy link
Collaborator

vogelpi commented Sep 17, 2024

Ah and of course, we need to debug the CI failures. I suspect there is an issue with the FPGA/ASIC mode for SHA3/KMAC. We've disables this feature in Earlgrey for the production tapeout such that the FPGA is again closer to the ASIC. See lowRISC/opentitan#23157

@nasahlpa
Copy link
Member

Yes you are right, the tests are failing because of these parameters. In PR #378 I have updated the instruction how to build the bitstreams for the FPGA. I am currently building it for the CW310 and we test again :-)

@nasahlpa
Copy link
Member

nasahlpa commented Sep 17, 2024

Another question regarding the bitstreams @vogelpi, do you know why we have lowrisc_systems_chip_earlgrey_cw310_0.1.bit and lowrisc_systems_chip_earlgrey_cw310_0.1_kmac_dom.bit in the objs/ folder? I couldn't find build instructions for the latter one.

@vogelpi
Copy link
Collaborator

vogelpi commented Sep 17, 2024

Another question regarding the bitstreams @vogelpi, do you know why we have lowrisc_systems_chip_earlgrey_cw310_0.1.bit and lowrisc_systems_chip_earlgrey_cw310_0.1_kmac_dom.bit in the objs/ folder? I couldn't find build instructions for the latter one.

The latter one has the masking for KMAC enabled. Doing this is not straightforward as you need to change the top-level to enough resources available. If you check the commit / PR where I've updated this bitstream, you should find a tag / branch of mine containing all the required commits.

For a more update to date version that also changes the clock ratios to have again 20x oversampling with Husky, refer to this branch: https://github.com/vogelpi/opentitan/commits/ot-sca-cw310-trivium/

@nasahlpa
Copy link
Member

Ah I see, thanks for the clarification. I've only checked the last git commit of the KMAC FPGA bitstream and there I couldn't find the tag / branch used for that - but an older commit had the information.

Not sure how we want to proceed with that. Relying on a OpenTitan fork for building this bitstream seems to be quite hacky, difficult for others to reproduce, and not so easy to keep the bitstream up to date with the master branch but on the other hand generating a new top just for the KMAC SCA measurements seems to be a bit too radical.

@vogelpi
Copy link
Collaborator

vogelpi commented Sep 17, 2024

I agree with your assessment but I also have an idea. Let's discuss offline on THU or FRI.

This commit adds the OpenTitan Earl Grey A1 FPGA bitstream and the
pentest binary to the repository. The previous binaries for the Earl
Grey Z1 version are retained with the filename suffix z1.

The FPGA bitstream was generated from commit
lowRISC/opentitan@282d863 and created with
the command:
  `/bazelisk.sh build //hw/bitstream/vivado:fpga_cw310_test_rom`

The pentest binary was generated from commit
lowRISC/opentitan@b2cee40 and created with
the command:
  `./bazelisk.sh build //sw/device/tests/penetrationtests/firmware:firmware_fpga_cw310_test_rom`

Signed-off-by: Andrea Caforio <[email protected]>
Co-authored-by: Pascal Nasahl <[email protected]>
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.

3 participants