-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[doc] Update Bitstream Building Tutorial
This commit updates the instructions how to build the FPGA bitstream for CW310. Moreover, the instructions how to compile the pen. testing framework is replaced with a link to the OpenTitan repository. Signed-off-by: Pascal Nasahl <[email protected]>
- Loading branch information
Showing
2 changed files
with
79 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Building FPGA Bitstreams for OT-SCA | ||
|
||
The idea of this tutorial is to document how to build FPGA bitstreams that can | ||
be used for performing side-channel analysis on the ChipWhisperer boards using | ||
ot-sca. | ||
|
||
## Prerequisites | ||
|
||
Bitstreams are created inside the [OpenTitan](https://github.com/lowRISC/OpenTitan) | ||
repository. Make sure to follow the getting started | ||
[guide](https://opentitan.org/book/doc/getting_started/index.html) before attempting | ||
to build bitstreams. A Xilinx Vivado installation with a valid licence is needed. | ||
|
||
Then, clone the OpenTitan repository and select a suitable commit. Make sure that | ||
the selected commit is compatible with the penetration testing | ||
[framework](https://github.com/lowRISC/opentitan/tree/master/sw/device/tests/penetrationtests). | ||
When using the latest commit available in the OpenTitan master branch, the framework | ||
and the FPGA bitstream should be compatible. | ||
|
||
|
||
## Building CW310 Bitstreams | ||
|
||
To simplify SCA measurements, please change the following parameters marked in | ||
bold in the | ||
[chip_earlgrey_cw310.sv](https://github.com/lowRISC/opentitan/blob/master/hw/top_earlgrey/rtl/autogen/chip_earlgrey_cw310.sv) | ||
file: | ||
|
||
<pre> | ||
top_earlgrey #( | ||
.SecAesMasking(1'b1), | ||
.SecAesSBoxImpl(aes_pkg::SBoxImplDom), | ||
.SecAesStartTriggerDelay(<b>320</b>), | ||
.SecAesAllowForcingMasks(1'b1), | ||
.CsrngSBoxImpl(aes_pkg::SBoxImplLut), | ||
.OtbnRegFile(otbn_pkg::RegFileFPGA), | ||
.SecOtbnMuteUrnd(<b>1'b1</b>), | ||
.SecOtbnSkipUrndReseedAtStart(<b>1'b0</b>), | ||
.OtpCtrlMemInitFile(OtpCtrlMemInitFile), | ||
.RvCoreIbexPipeLine(1), | ||
.SramCtrlRetAonInstrExec(0), | ||
.UsbdevRcvrWakeTimeUs(10000), | ||
.KmacEnMasking(0), | ||
.KmacSwKeyMasked(1), | ||
.KeymgrKmacEnMasking(0), | ||
.SecKmacCmdDelay(<b>320</b>), | ||
.SecKmacIdleAcceptSwMsg(<b>1'b1</b>), | ||
.RomCtrlBootRomInitFile(BootRomInitFile), | ||
.RvCoreIbexRegFile(ibex_pkg::RegFileFPGA), | ||
.RvCoreIbexSecureIbex(0), | ||
.SramCtrlMainInstrExec(1), | ||
.PinmuxAonTargetCfg(PinmuxTargetCfg) | ||
``` | ||
</pre> | ||
|
||
Then, use the following commands to retrieve the bitstream: | ||
|
||
```console | ||
./bazelisk.sh build //hw/bitstream/vivado:fpga_cw310_test_rom | ||
cp bazel-bin/hw/bitstream/vivado/build.fpga_cw310/synth-vivado/lowrisc_systems_chip_earlgrey_cw310_0.1.bit ../ot-sca/objs/ | ||
``` | ||
|
||
## Building CW305 Bitstreams | ||
|
||
# TODO(lowrisc/ot-sca#377): Add instructions how to build bitstreams for CW305. | ||
|
||
## Pushing Bitstreams to OT-SCA | ||
|
||
When pushing bitstream to the ot-sca repository, please make sure: | ||
- To include the git commit hash used for building the bitstream in the commit message. | ||
- That the bitstream is compatible with the penetration testing firmware. | ||
- That the bitstream is tracked in git lfs and is not pushed in plain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters