Skip to content

Commit

Permalink
[aes,dv] Do not set gcm phase on fatal alert
Browse files Browse the repository at this point in the history
When a fatal alert has occured, do not set the GCM phase
with the set_gcm_phase() function as we cannot guarantee
that the AES is idle. Simply ignore the request as we
will reset anyways.

Signed-off-by: Pascal Nasahl <[email protected]>
  • Loading branch information
nasahlpa committed Feb 12, 2025
1 parent 1c386a1 commit e132595
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/ip/aes/dv/env/seq_lib/aes_base_vseq.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ class aes_base_vseq extends cip_base_vseq #(
csr_update(.csr(ral.ctrl_shadowed), .en_shadow_wr(1'b1), .blocking(is_blocking));
end

if (cfg_item.mode == AES_GCM) begin
if (cfg_item.mode == AES_GCM && !status.alert_fatal_fault) begin
set_gcm_phase(GCM_INIT, 16, 1);
end

Expand All @@ -1043,7 +1043,7 @@ class aes_base_vseq extends cip_base_vseq #(
write_iv(cfg_item.iv, is_blocking);
if (cfg_item.mode == AES_GCM) begin
int valid_bytes = data_item.data_len == 0 ? 16 : data_item.data_len;
if (new_msg == 0) begin
if (new_msg == 0 && !status.alert_fatal_fault) begin
if (data_item.item_type == AES_GCM_AAD) begin
set_gcm_phase(GCM_AAD, valid_bytes, 1);
add_data(data_item.data_in, cfg_item.do_b2b);
Expand Down

0 comments on commit e132595

Please sign in to comment.