From fc01557987ac754c156fb4ed7f9e0f95a3b2c8e4 Mon Sep 17 00:00:00 2001
From: dam1n19 <d.a.mapstone@soton.ac.uk>
Date: Fri, 6 Jan 2023 19:04:48 +0000
Subject: [PATCH] fixed lint warnings

---
 hdl/src/hash_process.sv | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/hdl/src/hash_process.sv b/hdl/src/hash_process.sv
index f5946db..6b55857 100644
--- a/hdl/src/hash_process.sv
+++ b/hdl/src/hash_process.sv
@@ -228,6 +228,9 @@ module hash_process (
         for (int i=0; i < 64; i++) begin
             next_W[i] = W[i];
         end
+        // Logic for Temporary Words
+        T1 = h + bsig1(e) + ch(e,f,g) + K[hash_iter] + W[hash_iter];
+        T2 = bsig0(a) + maj(a,b,c);
         
         // Override
         case (state)
@@ -257,12 +260,12 @@ module hash_process (
                     if (data_in_valid && data_in_ready) begin
                         // Valid Handshake and data can be processed
                         // Use the Message chunks to populate the message schedule
-                        for (logic [31:0] t = 0; t < 16; t++) begin
-                            next_W[t] = M[t];
-                        end
-                        for (logic [31:0] t = 16; t < 64; t++) begin
-                            next_W[t] = ssig1_next_W[t-2] + next_W[t-32'd7] + ssig0_next_W[t-15] + next_W[t-32'd16];
-                            // next_W[t] = next_W[t-32'd7] + ssig0(t-15) + next_W[t-32'd16];
+                        for (logic [31:0] t = 0; t < 64; t++) begin
+                            if (t < 16) begin
+                                next_W[t] = M[t];
+                            end else begin
+                                next_W[t] = ssig1_next_W[t-2] + next_W[t-32'd7] + ssig0_next_W[t-15] + next_W[t-32'd16];
+                            end
                         end
                         // Set Working Variables
                         next_a = H[0];
@@ -288,8 +291,6 @@ module hash_process (
                         next_data_out_valid = 1'b0;
                     end
                     // Perform Hash Function
-                    T1 = h + bsig1(e) + ch(e,f,g) + K[hash_iter] + W[hash_iter];
-                    T2 = bsig0(a) + maj(a,b,c);
                     next_a = T1 + T2;
                     next_b = a;
                     next_c = b;
@@ -374,6 +375,10 @@ module hash_process (
                         next_data_in_ready = 1'b0;
                     end
                 end
+            
+            default: begin
+                    next_state = 3'd0;
+                end
         endcase
     end
 endmodule
\ No newline at end of file
-- 
GitLab