From 03bbc7f938a65c732f770c57bc8d438a958458aa Mon Sep 17 00:00:00 2001 From: Pascal Nasahl Date: Tue, 9 Apr 2024 14:44:02 +0200 Subject: [PATCH] [fi] Add SRAM static cmd handler This commit adds the command handler for the ibex_char_sram_write test. The device PR is located in lowRISC/opentitan#22272 Signed-off-by: Pascal Nasahl --- ...global_fi.ibex.char.sram_static.cw310.yaml | 39 +++++++++++++++++++ target/communication/fi_ibex_commands.py | 9 +++++ 2 files changed, 48 insertions(+) create mode 100644 fault_injection/configs/pen.global_fi.ibex.char.sram_static.cw310.yaml diff --git a/fault_injection/configs/pen.global_fi.ibex.char.sram_static.cw310.yaml b/fault_injection/configs/pen.global_fi.ibex.char.sram_static.cw310.yaml new file mode 100644 index 00000000..b51dbfba --- /dev/null +++ b/fault_injection/configs/pen.global_fi.ibex.char.sram_static.cw310.yaml @@ -0,0 +1,39 @@ +target: + target_type: cw310 + fpga_bitstream: "../objs/lowrisc_systems_chip_earlgrey_cw310_0.1.bit" + force_program_bitstream: False + fw_bin: "../objs/sca_ujson_fpga_cw310.bin" + output_len_bytes: 16 + target_clk_mult: 0.24 + target_freq: 24000000 + baudrate: 115200 + protocol: "ujson" + port: "/dev/ttyACM4" +fisetup: + fi_gear: "husky" + fi_type: "voltage_glitch" + parameter_generation: "random" + # Voltage glitch width in cycles. + glitch_width_min: 5 + glitch_width_max: 150 + glitch_width_step: 3 + # Range for trigger delay in cycles. + trigger_delay_min: 0 + trigger_delay_max: 500 + trigger_step: 10 + # Number of iterations for the parameter sweep. + num_iterations: 100 +fiproject: + # Project database type and memory threshold. + project_db: "ot_fi_project" + project_mem_threshold: 10000 + # Store FI plot. + show_plot: True + num_plots: 10 + plot_x_axis: "trigger_delay" + plot_x_axis_legend: "[cycles]" + plot_y_axis: "glitch_width" + plot_y_axis_legend: "[cycles]" +test: + which_test: "ibex_char_sram_write" + expected_result: '{"err_status":0,"addresses":[0,0,0,0,0,0,0,0]}' diff --git a/target/communication/fi_ibex_commands.py b/target/communication/fi_ibex_commands.py index e693e06e..11ea40b5 100644 --- a/target/communication/fi_ibex_commands.py +++ b/target/communication/fi_ibex_commands.py @@ -90,6 +90,15 @@ def ibex_char_sram_write(self) -> None: time.sleep(0.01) self.target.write(json.dumps("CharSramWrite").encode("ascii")) + def ibex_char_sram_static(self) -> None: + """ Starts the ibex.char.sram_static test. + """ + # IbexFi command. + self._ujson_ibex_fi_cmd() + # CharSramWrite command. + time.sleep(0.01) + self.target.write(json.dumps("CharSramStatic").encode("ascii")) + def ibex_char_unconditional_branch(self) -> None: """ Starts the ibex.char.unconditional_branch test. """