Machine learning model in CWLITE CW305

Hi,

I am intending to scan power traces of an AI model (CNN ,MLP,…) runing on a Cortex-M3 processor implemented on an FPGA Card (like this tutorial which implemented AES on M3 ) but I can’t figure out how to run my inference model on this card via chipwhisperer I know there’s capture traces but it requires plain text and key so is there any ideas how to execute my main.cpp code on the fpga card (it is already veresed on the FPGA memory) and at the same time start mesuring the consumption traces?

I will be really grateful

Thanks in adavance,

To capture traces, you need to call scope.arm(), have the target toggle the trigger pin, then call scope.capture(). The trace can then be retrieved with scope.get_last_trace(). You may find the source code for capture_trace() helpful: chipwhisperer/software/chipwhisperer at develop · newaetech/chipwhisperer · GitHubinit.py#L422. In the usual case, sending the plaintext to the target is what causes it to toggle the trigger pin.

Alex

Thank you for your response.

Actually I am new with chipwhisperer so can you please tell me how to "have the target toggle the trigger pin " is it in the C++ model code that I developped with keil or in jupyter ? It is not clear for me sorry.
If you have tutorials for custom programming that we capture their traces after , it will be really helpful .

Thank you for your time.

You need to connect a pin of your target board to GPIO4 of the ChipWhisperer’s 20-pin connector and toggle that pin (by default from low to high) to trigger the trace capture.

You may find the Jupyter Notebook for our third party glitch lab useful here. This lab deals with voltage glitching, but the hardware setup for power analysis is mostly the same. I’d also recommend using the same clock between the ChipWhisperer and the target, as this improves capture performance.

Alex

Hello sir ,

Actually I am working with CWlite Chipwhisperer and CW305 FPGA and I have connected them with the SMA cable to measure the traces and IDE cable to control the FPGA via CWlite so hardware setup I think there’s nothing to change here’s a photo of that:


On the other hand i followed a tutorial on implementing an AES on an ARM Cortex-M3 processor on the FPGA CW305 (the AES was implemented in Keil to generate the bitstream),after that I tried the with an ML model using tensorflow and I succeeded in generating its bitstream , but what I am not able to do now is to measure the consumption power of the FPGA card and get the traces .
How to toggle the trigger pin and where ?
Can you help me please ?
Thanks in advance.

I’m assuming you’re referring to our Arm DesignStart tutorial? https://github.com/newaetech/CW305-Arm-DesignStart

Part of this tutorial includes compiling our simpleserial-aes application.
In the source, the trigger_high() and trigger_low() calls are what set the the trigger pin:

To learn how to capture power traces, go through our Jupyter tutorials. For the CW305 target, you can either use this one:

Or, as noted here, most other AES tutorials with a small modification to use Setup_DesignStart.ipynb.