[Cryptech-Commits] [core/cipher/aes] branch master updated: Added wait_ready task to allow test cases to wait for the core to complete an operation. This makes it possible to measure cycles for an operation.

git at cryptech.is git at cryptech.is
Tue May 22 08:22:08 UTC 2018


This is an automated email from the git hooks/post-receive script.

joachim at secworks.se pushed a commit to branch master
in repository core/cipher/aes.

The following commit(s) were added to refs/heads/master by this push:
     new e747458  Added wait_ready task to allow test cases to wait for the core to complete an operation. This makes it possible to measure cycles for an operation.
e747458 is described below

commit e7474587db169f990fb4d762c69c0fcd096cc891
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Tue May 22 10:21:58 2018 +0200

    Added wait_ready task to allow test cases to wait for the core to complete an operation. This makes it possible to measure cycles for an operation.
---
 src/tb/tb_aes.v | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/tb/tb_aes.v b/src/tb/tb_aes.v
index 188a21a..35fc1d9 100644
--- a/src/tb/tb_aes.v
+++ b/src/tb/tb_aes.v
@@ -306,6 +306,25 @@ module tb_aes();
   endtask // read_word
 
 
+  //----------------------------------------------------------------
+  // wait_ready
+  //
+  // Wait for the DUT to signal that the result is ready
+  //----------------------------------------------------------------
+  task wait_ready;
+    begin : wait_ready
+      reg rdy;
+      rdy = 1'b0;
+
+      while (rdy != 1'b1)
+        begin
+          read_word(ADDR_STATUS);
+          rdy = tb_read_data[STATUS_READY_BIT];
+        end
+    end
+  endtask // wait_ready
+
+
   //----------------------------------------------------------------
   // read_result()
   //
@@ -386,8 +405,9 @@ module tb_aes();
       write_word(ADDR_CONFIG, (8'h00 + (key_length << 1)+ encdec));
       write_word(ADDR_CTRL, 8'h02);
 
-      #(100 * CLK_PERIOD);
-
+      wait_ready();
+      $display("*** Ready has been set!");
+      dump_dut_state();
       read_result();
 
       if (result_data == expected)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list