[Cryptech-Commits] [user/js/keywrap] branch master updated: (1) Fixed dump of core_addr in testbench to actually show the core_addr. Fixed boundaries for the block counter. Now we don't read mem out of bounds.

git at cryptech.is git at cryptech.is
Fri Jul 6 07:47:18 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 user/js/keywrap.

The following commit(s) were added to refs/heads/master by this push:
     new 694ff57  (1) Fixed dump of core_addr in testbench to actually show the core_addr. Fixed boundaries for the block counter. Now we don't read mem out of bounds.
694ff57 is described below

commit 694ff57dc365f0b51eaea0afc1a808d3f3f6f28c
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Fri Jul 6 09:47:05 2018 +0200

    (1) Fixed dump of core_addr in testbench to actually show the core_addr. Fixed boundaries for the block counter. Now we don't read mem out of bounds.
---
 src/rtl/keywrap_core.v | 4 ++--
 src/tb/tb_keywrap.v    | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/rtl/keywrap_core.v b/src/rtl/keywrap_core.v
index 1f180c9..35bdfa6 100644
--- a/src/rtl/keywrap_core.v
+++ b/src/rtl/keywrap_core.v
@@ -280,7 +280,7 @@ module keywrap_core (
 
       if (block_ctr_set)
         begin
-          block_ctr_new = (rlen - 1);
+          block_ctr_new = rlen;
           block_ctr_we  = 1'h1;
         end
 
@@ -483,7 +483,7 @@ module keywrap_core (
 
         CTRL_NEXT_UCHECK:
           begin
-            if (block_ctr_reg > 0)
+            if (block_ctr_reg > 1)
               begin
                 block_ctr_dec         = 1'h1;
                 keywrap_core_ctrl_new = CTRL_NEXT_LOOP;
diff --git a/src/tb/tb_keywrap.v b/src/tb/tb_keywrap.v
index 0b9eda3..a13521c 100644
--- a/src/tb/tb_keywrap.v
+++ b/src/tb/tb_keywrap.v
@@ -269,7 +269,7 @@ module tb_keywrap();
           $display("a_reg  = 0x%0x  a_new = 0x%0x  a_we = 0x%0x",
                    dut.core.a_reg, dut.core.a_new, dut.core.a_we);
           $display("core_we = 0x%0x  core_addr = 0x%0x",
-                   dut.core.core_we, dut.core.block_ctr_reg);
+                   dut.core.core_we, dut.core.core_addr);
           $display("core_rd_data = 0x%0x  core_wr_data = 0x%0x ",
                    dut.core.core_rd_data, dut.core.core_wr_data);
           $display("");
@@ -292,6 +292,7 @@ module tb_keywrap();
         end
 
       $display("");
+      $display("");
     end
   endtask // dump_dut_state
 

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


More information about the Commits mailing list