Skip to content

Commit

Permalink
Fatal error reporting on failure to open required ROM hex files
Browse files Browse the repository at this point in the history
  • Loading branch information
calebofearth committed Apr 29, 2024
1 parent b8e10d9 commit 3c8d41e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,22 @@ class soc_ifc_env_rom_bringup_sequence extends soc_ifc_env_reset_sequence_base;

// Read the PK Hash values extracted/calculated from the ROM image
fd = $fopen("key_manifest_pk_hash_val.hex", "r");
if (!fd) begin
integer errno;
string str;
errno = $ferror(fd, str);
`uvm_fatal("SOC_IFC_BRINGUP", $sformatf("fopen failed to open key_manifest_pk_hash_val.hex with code [0x%x] message [%s]", errno, str))
end
void'($fscanf(fd, "%x", key_manifest_pk_hash_val));
$fclose(fd);

fd = $fopen("owner_pk_hash_val.hex", "r");
if (!fd) begin
integer errno;
string str;
errno = $ferror(fd, str);
`uvm_fatal("SOC_IFC_BRINGUP", $sformatf("fopen failed to open owner_pk_hash_val.hex with code [0x%x] message [%s]", errno, str))
end
void'($fscanf(fd, "%x", owner_pk_hash_val ));
$fclose(fd);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ class soc_ifc_env_mbox_rom_fw_sequence extends soc_ifc_env_mbox_sequence_base;

//read FW size for command constraint
fd = $fopen("fw_update.size", "r");
if (!fd) begin
integer errno;
string str;
errno = $ferror(fd, str);
`uvm_fatal("SOC_IFC_BRINGUP", $sformatf("fopen failed to open fw_update.size with code [0x%x] message [%s]", errno, str))
end
void'($fscanf(fd, "%d", fw_img_size));
`uvm_info("MBOX_ROM_SEQ", $sformatf("Found firmware update image with size: [%d] bytes", fw_img_size), UVM_LOW)// UVM_HIGH)
$fclose(fd);
Expand Down

0 comments on commit 3c8d41e

Please sign in to comment.