From c37577f1b333fb72e6042f9fc0fd06d7a2fb5d01 Mon Sep 17 00:00:00 2001
From: dam1n19 <d.a.mapstone@soton.ac.uk>
Date: Mon, 16 Jan 2023 15:08:43 +0000
Subject: [PATCH] ATO2-24: Removed seeding from ID issuer and fixed dynamic
 stall value bug in testbenches

---
 hdl/verif/tb_sha256_engine.sv           | 14 +++++++-------
 hdl/verif/tb_sha256_hash_compression.sv |  8 ++++----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/hdl/verif/tb_sha256_engine.sv b/hdl/verif/tb_sha256_engine.sv
index 165a318..7b00a73 100644
--- a/hdl/verif/tb_sha256_engine.sv
+++ b/hdl/verif/tb_sha256_engine.sv
@@ -89,7 +89,7 @@ module tb_sha256_engine;
             data_in_gap             <=   0;
             data_in_wait_queue      <=   1'b1;
         end else if (data_in_drive_en) begin
-            if (data_in_gap > 0) begin
+            if (data_in_gap > 1) begin
                 data_in_gap <= data_in_gap -1;
                 data_in_valid <= 1'b0;
             end else begin
@@ -127,7 +127,7 @@ module tb_sha256_engine;
             cfg_gap              <=   0;
             cfg_wait_queue      <=   1'b1;
         end else if (cfg_drive_en) begin
-            if (cfg_gap > 0) begin
+            if (cfg_gap > 1) begin
                 cfg_gap <= cfg_gap -1;
                 cfg_valid <= 1'b0;
             end else begin
@@ -173,7 +173,7 @@ module tb_sha256_engine;
         // Check Override Control on Ready
         if (data_out_drive_ready) begin
             // Count down to zero before enabling Ready
-            if (data_out_stall > 0) begin
+            if (data_out_stall > 1) begin
                 data_out_stall <= data_out_stall - 1;
                 data_out_ready <= 1'b0;
             end else begin
@@ -205,12 +205,12 @@ module tb_sha256_engine;
                 $error("data_out missmatch! packet %d | recieve: %x != check: %x", packet_num, data_out, data_out_check);
                 $finish;
             end
-            if ($test$plusargs ("DEBUG")) $display("data_out match! packet %d | recieve: %x != check: %x", packet_num, data_out, data_out_check);
+            if ($test$plusargs ("DEBUG")) $display("data_out match! packet %d | recieve: %x == check: %x", packet_num, data_out, data_out_check);
             assert (data_out_last == data_out_last_check) else begin
                 $error("data_out_last missmatch! packet %d | recieve: %x != check: %x", packet_num, data_out_last, data_out_last_check);
                 $finish;
             end
-            if ($test$plusargs ("DEBUG")) $display("data_out_last match! packet %d | recieve: %x != check: %x", packet_num, data_out_last, data_out_last_check);
+            if ($test$plusargs ("DEBUG")) $display("data_out_last match! packet %d | recieve: %x == check: %x", packet_num, data_out_last, data_out_last_check);
             if ((data_out_queue.size() > 0) && (data_out_last_queue.size() > 0)) begin
                 data_out_check      <= data_out_queue.pop_front();
                 data_out_last_check <= data_out_last_queue.pop_front();
@@ -229,12 +229,12 @@ module tb_sha256_engine;
                 $error("message block missmatch! packet %d | recieve: %x != check: %x", message_block_packet_num, data_out, message_block_data_out_check);
                 $finish;
             end
-            if ($test$plusargs ("DEBUG")) $display("message block match! packet %d | recieve: %x != check: %x", message_block_packet_num, message_builder_out_data, message_block_data_out_check);
+            if ($test$plusargs ("DEBUG")) $display("message block match! packet %d | recieve: %x == check: %x", message_block_packet_num, message_builder_out_data, message_block_data_out_check);
             assert (message_builder_out_data_last == message_block_data_out_last_check) else begin
                 $error("message block last missmatch! packet %d | recieve: %x != check: %x", message_block_packet_num, message_builder_out_data_last, message_block_data_out_last_check);
                 $finish;
             end
-            if ($test$plusargs ("DEBUG")) $display("message block last match! packet %d | recieve: %x != check: %x", message_block_packet_num, message_builder_out_data_last, message_block_data_out_last_check);
+            if ($test$plusargs ("DEBUG")) $display("message block last match! packet %d | recieve: %x == check: %x", message_block_packet_num, message_builder_out_data_last, message_block_data_out_last_check);
             if ((message_block_queue.size() > 0) && (message_block_last_queue.size() > 0)) begin
                 message_block_data_out_check      <= message_block_queue.pop_front();
                 message_block_data_out_last_check <= message_block_last_queue.pop_front();
diff --git a/hdl/verif/tb_sha256_hash_compression.sv b/hdl/verif/tb_sha256_hash_compression.sv
index 8bd1905..8d24828 100644
--- a/hdl/verif/tb_sha256_hash_compression.sv
+++ b/hdl/verif/tb_sha256_hash_compression.sv
@@ -66,7 +66,7 @@ module tb_sha256_hash_compression;
             data_in_gap             <=   0;
             data_in_wait_queue      <=   1'b1;
         end else if (data_in_drive_en) begin
-            if (data_in_gap > 0) begin
+            if (data_in_gap > 1) begin
                 data_in_gap <= data_in_gap -1;
                 data_in_valid <= 1'b0;
             end else begin
@@ -107,7 +107,7 @@ module tb_sha256_hash_compression;
         // Check Override Control on Ready
         if (data_out_drive_ready) begin
             // Count down to zero before enabling Ready
-            if (data_out_stall > 0) begin
+            if (data_out_stall > 1) begin
                 data_out_stall <= data_out_stall - 1;
                 data_out_ready <= 1'b0;
             end else begin
@@ -139,12 +139,12 @@ module tb_sha256_hash_compression;
                 $error("data_out missmatch! packet %d | recieve: %x != check: %x", packet_num, data_out, data_out_check);
                 $finish;
             end
-            if ($test$plusargs ("DEBUG")) $display("data_out match! packet %d | recieve: %x != check: %x", packet_num, data_out, data_out_check);
+            if ($test$plusargs ("DEBUG")) $display("data_out match! packet %d | recieve: %x == check: %x", packet_num, data_out, data_out_check);
             assert (data_out_last == data_out_last_check) else begin
                 $error("data_out_last missmatch! packet %d | recieve: %x != check: %x", packet_num, data_out_last, data_out_last_check);
                 $finish;
             end
-            if ($test$plusargs ("DEBUG")) $display("data_out_last match! packet %d | recieve: %x != check: %x", packet_num, data_out_last, data_out_last_check);
+            if ($test$plusargs ("DEBUG")) $display("data_out_last match! packet %d | recieve: %x == check: %x", packet_num, data_out_last, data_out_last_check);
             if ((data_out_queue.size() > 0) && (data_out_last_queue.size() > 0)) begin
                 data_out_check      <= data_out_queue.pop_front();
                 data_out_last_check <= data_out_last_queue.pop_front();
-- 
GitLab