SAKURA-G Target Example


#1

Hi,

I want to implement the SAKURA-G Target example, which is explained in the following link:

http://www.newae.com/sidechannel/cwdocs/hwsakurag.html

In the link, it is stated that FPGA #1 (the main FPGA) on SAKURA-G has been programmed by the AES example. However, I cannot find this AES example in the GIT repository.

Can you please guide me where I can find this example AES implementation?

Regards,

Bilgiday


#2

Hi Bilgiday,

That AES example is actually provided by SAKURA. They publish a quick-start at http://satoh.cs.uec.ac.jp/SAKURA/hardware/SAKURA-G.html which has the details you need. You can first confirm the board is working using those details.

Once you have that working, you can reprogram the LX9 chip with the special version that adds the OpenADC support. You will need to use the ChipWhisperer software after that instead of the program they provide.

Regards,

-Colin


#3

Hi Colin,

Thank you for your prompt answer.

I tried to use this AES implementation. First, I verified that the board is working fine via the quick-start example. Then I programmed the control FPGA with “sakurag-chipwhisperer.mcs” file. However, I encountered a few problems:

First, I executed “SAKURA-G AES-128 FPGA Target” script in CWCapture. However, CWCapture crashed every time when I executed this script.
Then, I manually set Scope and Target Module Settings using CWCapture GUI. I verified that I can connect openADC and I can see the heartbeat of OpenADC on the LEDs.
After this verification, I connected to the target by clicking ‘con/disconnect button’ of CWCaptureGUI. It seems this also works. However, when I clicked “get 1 capture” button, CWCapture crashed and started not responding. Examining “sakura-aes.py” script, I recognized that ‘capture1()’ function causes CWCapture to crash.
In addition, I cannot not see the heartbeat signal of the AES implementation on the LEDs of SKAURA-G. Therefore, I think the problem might be related to clock and reset signals of the main FPGA or communication between the control and main FPGAs.

I will check the Verilog and UCF files of the designs to see if there is a problem. I am sorry for this long post, I just wanted to verify that I did not do any critical mistake during the process.

Thanks,

Bilgiday


#4

That sounds about right - when the CW window crashes, does it print debug? What might help is starting it from the command prompt, to do so open a command prompt with Python in the path (either a normal windows command prompt, or one started from the WinPython directory if using WinPython). Then execute the CW Capture software from that, using the command ‘python ChipWhispererCapture.py’ in the appropriate directory.

When it crashes it should generate some debug telling you more details! You can post that here and I might have a better idea what is happening.

Regards,

-Colin


#5

Hi Colin,

I did what you suggest and I got the following output in the terminal:

C:\chipwhisperer\software\chipwhisperer\capture>python ChipWhispererCapture.py
***** Starting User Script *****
No phase shift loaded
For address 0x06=6 Sent data: e4010002
Read data: a4010002

No phase shift loaded

C:\chipwhisperer\software\chipwhisperer\capture>

After giving this output, program halts. I think the program calls ‘cap.capture1()’ function in ‘sakura-aes.py’ file and waits for an acknowledgment signal from the main FPGA (i.e, AES implementation). I checked the Verilog codes and UCF files of SAKURA-G example of the SAKURA team ( satoh.cs.uec.ac.jp/SAKURA/hardware/SAKURA-G.html) and ChipWhisperer for SAKURA-G:

It seems there is a problem with the communication between ChipWhisperer and their AES code. ChipWhisperer control FPGA implementation, throuhg local bus, sends 16-bit data input to the main FPGA and waits for a 16-bit data from it. However, their AES implementation data input and output ports are 8-bit. I think this causes problems in the communication between their AES implementation and the ChipWhisperer control FPGA.

Because of this problem, there are mismatches in UCF files as it can be seen in the following table.

When I use the pin assignments shown in the last column instead of the pin assignments in the original ChipWhisperer UCF file, I can see the heartbeat signal of the AES. However, the behavior of ChipWhispererCapture.py program does not change because of the ‘16-bit/8-bit’ problem.

We can be using the different versions of SAKURA-G AES example. Can you please send me your version if it is possible?

Regards,

Bilgiday


#6

Yikes! I wasn’t aware of the change in AES implementations, thanks for informing me. I assumed it would be the same basic design…

I’ve attached the implementation I was using here. I’ll update the documentation to make a note of this, thanks again for pointing that out!

Regards,

-Colin
sakura-g_control_lx9.zip (1.25 MB)


#7

Thank you for the response.

The attached code is for the control FPGA as far as I understand. Is it possible for you to send your AES implementation for the main FPGA as well?

Regards,

Bilgiday


#8

Oops - yes sorry about that! I zipped the wrong directory somehow :confused: See attached.
sakura-g_main_lx75.zip (1.72 MB)


#9

Hi Colin,

Thank you for your help. It works now!

Regards,

Bilgiday


#10

Hi Bilgiday,

Could you send me the project materials that you used for this one? Thanks. I cannot work this out.

Bests,
Jiaji