aboutsummaryrefslogtreecommitdiff
path: root/src/rtl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtl')
-rw-r--r--src/rtl/keywrap.v4
-rw-r--r--src/rtl/keywrap_core.v18
-rw-r--r--src/rtl/keywrap_mem.v2
3 files changed, 9 insertions, 15 deletions
diff --git a/src/rtl/keywrap.v b/src/rtl/keywrap.v
index 3117f61..69295ed 100644
--- a/src/rtl/keywrap.v
+++ b/src/rtl/keywrap.v
@@ -287,7 +287,7 @@ module keywrap(
if ((address >= ADDR_KEY0) && (address <= ADDR_KEY7))
key_we = 1'h1;
- if (address <= ADDR_R_DATA0 && address <= ADDR_R_DATA127)
+ if (address >= ADDR_R_DATA0 && address <= ADDR_R_DATA127)
core_api_we = 1'h1;
end // if (we)
@@ -320,7 +320,7 @@ module keywrap(
if (address == ADDR_A1)
tmp_read_data = core_a_result[31 : 0];
- if (address <= ADDR_R_DATA0 && address <= ADDR_R_DATA127)
+ if (address >= ADDR_R_DATA0 && address <= ADDR_R_DATA127)
tmp_read_data = core_api_rd_data;
end
end
diff --git a/src/rtl/keywrap_core.v b/src/rtl/keywrap_core.v
index e7b7749..07a079b 100644
--- a/src/rtl/keywrap_core.v
+++ b/src/rtl/keywrap_core.v
@@ -127,6 +127,7 @@ module keywrap_core (
reg aes_init;
reg aes_next;
wire aes_ready;
+ wire aes_valid;
reg [127 : 0] aes_block;
wire [127 : 0] aes_result;
@@ -170,7 +171,7 @@ module keywrap_core (
.ready(aes_ready),
.result(aes_result),
- .result_valid()
+ .result_valid(aes_valid)
);
@@ -351,7 +352,10 @@ module keywrap_core (
ready_we = 1'h1;
valid_new = 1'h0;
valid_we = 1'h1;
- keywrap_core_ctrl_new = CTRL_NEXT_START;
+ init_a = 1'h1;
+ block_ctr_rst = 1'h1;
+ iteration_ctr_rst = 1'h1;
+ keywrap_core_ctrl_new = CTRL_NEXT_LOOP;
keywrap_core_ctrl_we = 1'h1;
end
end
@@ -376,16 +380,6 @@ module keywrap_core (
end
- CTRL_NEXT_START:
- begin
- init_a = 1'h1;
- block_ctr_rst = 1'h1;
- iteration_ctr_rst = 1'h1;
- keywrap_core_ctrl_new = CTRL_NEXT_LOOP;
- keywrap_core_ctrl_we = 1'h1;
- end
-
-
CTRL_NEXT_LOOP:
begin
aes_next = 1'h1;
diff --git a/src/rtl/keywrap_mem.v b/src/rtl/keywrap_mem.v
index d31c76c..dc08bab 100644
--- a/src/rtl/keywrap_mem.v
+++ b/src/rtl/keywrap_mem.v
@@ -81,7 +81,7 @@ module keywrap_mem (
// Assignments for ports.
//----------------------------------------------------------------
assign api_rd_data = muxed_api_rd_data;
- assign core_rd_data = {core_rd_data1, core_rd_data0};
+ assign core_rd_data = {core_rd_data0, core_rd_data1};
//----------------------------------------------------------------