Skip to content

Commit

Permalink
[kmac,prim_sha2/rtl] Fix lint error in conv_endian32
Browse files Browse the repository at this point in the history
One linter flags an error when `conv_data` gets declared and initialized
in one statement.  Splitting this into two statements removes the lint
error.  This shouldn't make any functional difference, but it gets those
files lint-clean without the need for a waiver.

Signed-off-by: Andreas Kurth <adk@lowrisc.org>
  • Loading branch information
andreaskurth committed May 30, 2024
1 parent 9e6feec commit 0742a8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hw/ip/kmac/rtl/kmac_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ package kmac_pkg;

// Endian conversion functions (32-bit, 64-bit)
function automatic logic [31:0] conv_endian32( input logic [31:0] v, input logic swap);
logic [31:0] conv_data = {<<8{v}};
logic [31:0] conv_data;
conv_data = {<<8{v}};
conv_endian32 = (swap) ? conv_data : v ;
endfunction : conv_endian32

Expand Down
3 changes: 2 additions & 1 deletion hw/ip/prim/rtl/prim_sha2_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ package prim_sha2_pkg;
};

function automatic sha_word32_t conv_endian32(input sha_word32_t v, input logic swap);
sha_word32_t conv_data = {<<8{v}};
sha_word32_t conv_data;
conv_data = {<<8{v}};
conv_endian32 = (swap) ? conv_data : v;
endfunction : conv_endian32

Expand Down

0 comments on commit 0742a8e

Please sign in to comment.