From ac77ca2bfe6d184c13da7ba90e8276ed0fc35765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Mon, 21 May 2018 17:50:37 +0200 Subject: Removed the sbox word mux. Removed ports for sbox access in the encipher datapath since it now has its own sboxes. --- src/rtl/aes_core.v | 26 +------------------------- src/rtl/aes_encipher_block.v | 3 --- src/tb/tb_aes_encipher_block.v | 14 -------------- 3 files changed, 1 insertion(+), 42 deletions(-) (limited to 'src') diff --git a/src/rtl/aes_core.v b/src/rtl/aes_core.v index 5196a1f..7c5720d 100644 --- a/src/rtl/aes_core.v +++ b/src/rtl/aes_core.v @@ -94,7 +94,6 @@ module aes_core( wire [3 : 0] enc_round_nr; wire [127 : 0] enc_new_block; wire enc_ready; - wire [31 : 0] enc_sboxw; reg dec_next; wire [3 : 0] dec_round_nr; @@ -107,7 +106,6 @@ module aes_core( wire [31 : 0] keymem_sboxw; - reg [31 : 0] muxed_sboxw; wire [31 : 0] new_sboxw; @@ -124,9 +122,6 @@ module aes_core( .round(enc_round_nr), .round_key(round_key), - .sboxw(enc_sboxw), - .new_sboxw(new_sboxw), - .block(block), .new_block(enc_new_block), .ready(enc_ready) @@ -166,7 +161,7 @@ module aes_core( ); - aes_sbox sbox_inst(.sboxw(muxed_sboxw), .new_sboxw(new_sboxw)); + aes_sbox sbox_inst(.sboxw(keymem_sboxw), .new_sboxw(new_sboxw)); //---------------------------------------------------------------- @@ -206,25 +201,6 @@ module aes_core( end // reg_update - //---------------------------------------------------------------- - // sbox_mux - // - // Controls which of the encipher datapath or the key memory - // that gets access to the sbox. - //---------------------------------------------------------------- - always @* - begin : sbox_mux - if (init_state) - begin - muxed_sboxw = keymem_sboxw; - end - else - begin - muxed_sboxw = enc_sboxw; - end - end // sbox_mux - - //---------------------------------------------------------------- // encdex_mux // diff --git a/src/rtl/aes_encipher_block.v b/src/rtl/aes_encipher_block.v index c3e672c..c4440d7 100644 --- a/src/rtl/aes_encipher_block.v +++ b/src/rtl/aes_encipher_block.v @@ -49,9 +49,6 @@ module aes_encipher_block( output wire [3 : 0] round, input wire [127 : 0] round_key, - output wire [31 : 0] sboxw, - input wire [31 : 0] new_sboxw, - input wire [127 : 0] block, output wire [127 : 0] new_block, output wire ready diff --git a/src/tb/tb_aes_encipher_block.v b/src/tb/tb_aes_encipher_block.v index cc08d8e..87bab2c 100644 --- a/src/tb/tb_aes_encipher_block.v +++ b/src/tb/tb_aes_encipher_block.v @@ -74,9 +74,6 @@ module tb_aes_encipher_block(); wire [3 : 0] tb_round; wire [127 : 0] tb_round_key; - wire [31 : 0] tb_sboxw; - wire [31 : 0] tb_new_sboxw; - reg [127 : 0] tb_block; wire [127 : 0] tb_new_block; @@ -92,13 +89,6 @@ module tb_aes_encipher_block(); //---------------------------------------------------------------- // Device Under Test. //---------------------------------------------------------------- - // We need an sbox for the tests. - aes_sbox sbox( - .sboxw(tb_sboxw), - .new_sboxw(tb_new_sboxw) - ); - - // The device under test. aes_encipher_block dut( .clk(tb_clk), @@ -110,9 +100,6 @@ module tb_aes_encipher_block(); .round(tb_round), .round_key(tb_round_key), - .sboxw(tb_sboxw), - .new_sboxw(tb_new_sboxw), - .block(tb_block), .new_block(tb_new_block), .ready(tb_ready) @@ -172,7 +159,6 @@ module tb_aes_encipher_block(); $display("Internal data values"); $display("round_key = 0x%016x", dut.round_key); - $display("sboxw = 0x%08x, new_sboxw = 0x%08x", dut.sboxw, dut.new_sboxw); $display("block_w0_reg = 0x%08x, block_w1_reg = 0x%08x, block_w2_reg = 0x%08x, block_w3_reg = 0x%08x", dut.block_w0_reg, dut.block_w1_reg, dut.block_w2_reg, dut.block_w3_reg); $display(""); -- cgit v1.2.3 '>60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147