-
Notifications
You must be signed in to change notification settings - Fork 25
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
Enable ChipWhisperer CW310 #47
Conversation
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
The scope gain and number of samples per trace often needs to be changed together with the bitstream/firmware. It's better to have all the corresponding knobs in the same config file. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vogelpi. Just some nits.
cw/cw305/util/device.py
Outdated
force_programming = False | ||
print('Connecting and loading FPGA... ', end='') | ||
if board == 'CW310': | ||
fpga = cw.target(None, cw.capture.targets.CW310, slurp=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What currently doesn't work is the feature to detect if the bitstream had already been programmed. This is not dramatic but since the FPGA is much larger, loading the bitstream takes around 15 seconds which is not so nice.
Could you try if fpga = cw.capture.targets.CW310()
works and can you add a comment if it doesn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, it doesn't work either. Created an issue here #48. But I've switched to fpga = cw.capture.targets.CW310()
.
cw/cw305/simple_capture_traces.py
Outdated
if re.search('cw310', device_cfg['fpga_bitstream']): | ||
board = 'CW310' | ||
else: | ||
board = 'CW305' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think board
should ideally be an enum, can you add a TODO for that?
Also:
if re.search('cw310', device_cfg['fpga_bitstream']): | |
board = 'CW310' | |
else: | |
board = 'CW305' | |
m = re.search('cw305|cw310', device_cfg['fpga_bitstream']) | |
if m: | |
if m.group() == 'cw305': | |
board = 'CW305' | |
else: | |
assert m.group() == 'cw310' | |
board = 'CW310' | |
else: | |
raise ValueError('Could not infer target board type from bitstream name') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an issue, and switched to your suggested code. Thanks for your review @alphan !
The version from OpenTitan contains some bug fixes, is lint clean and most importantly also supports the ChipWhisperer CW310 FPGA board. Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
Signed-off-by: Pirmin Vogel <vogelpi@lowrisc.org>
This PR contains the required changes to enable SCA for OpenTitan on the ChipWhisperer CW310 FPGA board. The most notable changes are:
I've tested these changes both on the CW305 (using the bitstreams and binaries in the tree) and the CW310. I will push a PR hopefully tomorrow to make the necessary changes in OpenTitan.
Below you can see two plots of 200 AES traces with DOM masking. Top is the CW310, bottom is the CW305. It doesn't look too bad here but when considering more traces, one sees that there is massive "background" activity that completely buries the AES traces. There will be some work needed to reduce the background noise. Disabling the entropy complex already helped a bit.