aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2015-05-04 14:46:08 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2015-05-04 14:46:08 +0200
commit241a101d64f2f66ba53a8996d3499b23d5815f1b (patch)
tree57b4f1b78e8538350e9f6c5802a413ee52d8889c
parentb07918a0af5e077cbbde7757325ad8f620064981 (diff)
(1) Changed ordet of status and config addresses to conform to what we have in other cores. (2) Changed to localparam to stop polluting namespace.
-rw-r--r--src/rtl/aes.v76
-rw-r--r--src/tb/tb_aes.v86
2 files changed, 81 insertions, 81 deletions
diff --git a/src/rtl/aes.v b/src/rtl/aes.v
index 2ead578..5d6030b 100644
--- a/src/rtl/aes.v
+++ b/src/rtl/aes.v
@@ -55,44 +55,44 @@ module aes(
//----------------------------------------------------------------
// Internal constant and parameter definitions.
//----------------------------------------------------------------
- parameter ADDR_NAME0 = 8'h00;
- parameter ADDR_NAME1 = 8'h01;
- parameter ADDR_VERSION = 8'h02;
-
- parameter ADDR_CTRL = 8'h08;
- parameter CTRL_INIT_BIT = 0;
- parameter CTRL_NEXT_BIT = 1;
-
- parameter ADDR_CONFIG = 8'h09;
- parameter CTRL_ENCDEC_BIT = 0;
- parameter CTRL_KEYLEN_BIT = 1;
-
- parameter ADDR_STATUS = 8'h0a;
- parameter STATUS_READY_BIT = 0;
- parameter STATUS_VALID_BIT = 1;
-
- parameter ADDR_KEY0 = 8'h10;
- parameter ADDR_KEY1 = 8'h11;
- parameter ADDR_KEY2 = 8'h12;
- parameter ADDR_KEY3 = 8'h13;
- parameter ADDR_KEY4 = 8'h14;
- parameter ADDR_KEY5 = 8'h15;
- parameter ADDR_KEY6 = 8'h16;
- parameter ADDR_KEY7 = 8'h17;
-
- parameter ADDR_BLOCK0 = 8'h20;
- parameter ADDR_BLOCK1 = 8'h21;
- parameter ADDR_BLOCK2 = 8'h22;
- parameter ADDR_BLOCK3 = 8'h23;
-
- parameter ADDR_RESULT0 = 8'h30;
- parameter ADDR_RESULT1 = 8'h31;
- parameter ADDR_RESULT2 = 8'h32;
- parameter ADDR_RESULT3 = 8'h33;
-
- parameter CORE_NAME0 = 32'h6165732d; // "aes-"
- parameter CORE_NAME1 = 32'h31323820; // "128 "
- parameter CORE_VERSION = 32'h302e3530; // "0.50"
+ localparam ADDR_NAME0 = 8'h00;
+ localparam ADDR_NAME1 = 8'h01;
+ localparam ADDR_VERSION = 8'h02;
+
+ localparam ADDR_CTRL = 8'h08;
+ localparam CTRL_INIT_BIT = 0;
+ localparam CTRL_NEXT_BIT = 1;
+
+ localparam ADDR_STATUS = 8'h09;
+ localparam STATUS_READY_BIT = 0;
+ localparam STATUS_VALID_BIT = 1;
+
+ localparam ADDR_CONFIG = 8'h0a;
+ localparam CTRL_ENCDEC_BIT = 0;
+ localparam CTRL_KEYLEN_BIT = 1;
+
+ localparam ADDR_KEY0 = 8'h10;
+ localparam ADDR_KEY1 = 8'h11;
+ localparam ADDR_KEY2 = 8'h12;
+ localparam ADDR_KEY3 = 8'h13;
+ localparam ADDR_KEY4 = 8'h14;
+ localparam ADDR_KEY5 = 8'h15;
+ localparam ADDR_KEY6 = 8'h16;
+ localparam ADDR_KEY7 = 8'h17;
+
+ localparam ADDR_BLOCK0 = 8'h20;
+ localparam ADDR_BLOCK1 = 8'h21;
+ localparam ADDR_BLOCK2 = 8'h22;
+ localparam ADDR_BLOCK3 = 8'h23;
+
+ localparam ADDR_RESULT0 = 8'h30;
+ localparam ADDR_RESULT1 = 8'h31;
+ localparam ADDR_RESULT2 = 8'h32;
+ localparam ADDR_RESULT3 = 8'h33;
+
+ localparam CORE_NAME0 = 32'h6165732d; // "aes-"
+ localparam CORE_NAME1 = 32'h31323820; // "128 "
+ localparam CORE_VERSION = 32'h302e3580; // "0.80"
//----------------------------------------------------------------
diff --git a/src/tb/tb_aes.v b/src/tb/tb_aes.v
index 4413ded..3c1f7cc 100644
--- a/src/tb/tb_aes.v
+++ b/src/tb/tb_aes.v
@@ -50,52 +50,52 @@ module tb_aes();
//----------------------------------------------------------------
// Internal constant and parameter definitions.
//----------------------------------------------------------------
- parameter DEBUG = 0;
+ localparam DEBUG = 0;
- parameter CLK_HALF_PERIOD = 1;
- parameter CLK_PERIOD = 2 * CLK_HALF_PERIOD;
+ localparam CLK_HALF_PERIOD = 1;
+ localparam CLK_PERIOD = 2 * CLK_HALF_PERIOD;
// The DUT address map.
- parameter ADDR_NAME0 = 8'h00;
- parameter ADDR_NAME1 = 8'h01;
- parameter ADDR_VERSION = 8'h02;
-
- parameter ADDR_CTRL = 8'h08;
- parameter CTRL_INIT_BIT = 0;
- parameter CTRL_NEXT_BIT = 1;
- parameter CTRL_ENCDEC_BIT = 2;
- parameter CTRL_KEYLEN_BIT = 3;
-
- parameter ADDR_CONFIG = 8'h09;
-
- parameter ADDR_STATUS = 8'h0a;
- parameter STATUS_READY_BIT = 0;
- parameter STATUS_VALID_BIT = 1;
-
- parameter ADDR_KEY0 = 8'h10;
- parameter ADDR_KEY1 = 8'h11;
- parameter ADDR_KEY2 = 8'h12;
- parameter ADDR_KEY3 = 8'h13;
- parameter ADDR_KEY4 = 8'h14;
- parameter ADDR_KEY5 = 8'h15;
- parameter ADDR_KEY6 = 8'h16;
- parameter ADDR_KEY7 = 8'h17;
-
- parameter ADDR_BLOCK0 = 8'h20;
- parameter ADDR_BLOCK1 = 8'h21;
- parameter ADDR_BLOCK2 = 8'h22;
- parameter ADDR_BLOCK3 = 8'h23;
-
- parameter ADDR_RESULT0 = 8'h30;
- parameter ADDR_RESULT1 = 8'h31;
- parameter ADDR_RESULT2 = 8'h32;
- parameter ADDR_RESULT3 = 8'h33;
-
- parameter AES_128_BIT_KEY = 0;
- parameter AES_256_BIT_KEY = 1;
-
- parameter AES_DECIPHER = 1'b0;
- parameter AES_ENCIPHER = 1'b1;
+ localparam ADDR_NAME0 = 8'h00;
+ localparam ADDR_NAME1 = 8'h01;
+ localparam ADDR_VERSION = 8'h02;
+
+ localparam ADDR_CTRL = 8'h08;
+ localparam CTRL_INIT_BIT = 0;
+ localparam CTRL_NEXT_BIT = 1;
+ localparam CTRL_ENCDEC_BIT = 2;
+ localparam CTRL_KEYLEN_BIT = 3;
+
+ localparam ADDR_STATUS = 8'h09;
+ localparam STATUS_READY_BIT = 0;
+ localparam STATUS_VALID_BIT = 1;
+
+ localparam ADDR_CONFIG = 8'h0a;
+
+ localparam ADDR_KEY0 = 8'h10;
+ localparam ADDR_KEY1 = 8'h11;
+ localparam ADDR_KEY2 = 8'h12;
+ localparam ADDR_KEY3 = 8'h13;
+ localparam ADDR_KEY4 = 8'h14;
+ localparam ADDR_KEY5 = 8'h15;
+ localparam ADDR_KEY6 = 8'h16;
+ localparam ADDR_KEY7 = 8'h17;
+
+ localparam ADDR_BLOCK0 = 8'h20;
+ localparam ADDR_BLOCK1 = 8'h21;
+ localparam ADDR_BLOCK2 = 8'h22;
+ localparam ADDR_BLOCK3 = 8'h23;
+
+ localparam ADDR_RESULT0 = 8'h30;
+ localparam ADDR_RESULT1 = 8'h31;
+ localparam ADDR_RESULT2 = 8'h32;
+ localparam ADDR_RESULT3 = 8'h33;
+
+ localparam AES_128_BIT_KEY = 0;
+ localparam AES_256_BIT_KEY = 1;
+
+ localparam AES_DECIPHER = 1'b0;
+ localparam AES_ENCIPHER = 1'b1;
//----------------------------------------------------------------