aboutsummaryrefslogtreecommitdiff
path: root/src/rtl/sha256_w_mem.v
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtl/sha256_w_mem.v')
-rw-r--r--src/rtl/sha256_w_mem.v9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rtl/sha256_w_mem.v b/src/rtl/sha256_w_mem.v
index fef1205..40e1374 100644
--- a/src/rtl/sha256_w_mem.v
+++ b/src/rtl/sha256_w_mem.v
@@ -76,12 +76,14 @@ module sha256_w_mem(
reg [5 : 0] w_ctr_new;
reg w_ctr_we;
+ reg [31 : 0] w_reg;
+ reg [31 : 0] w_new;
+
//----------------------------------------------------------------
// Wires.
//----------------------------------------------------------------
reg [31 : 0] w_tmp;
- reg [31 : 0] w_new;
//----------------------------------------------------------------
@@ -105,6 +107,7 @@ module sha256_w_mem(
for (i = 0 ; i < 16 ; i = i + 1)
w_mem[i] <= 32'h0;
+ w_reg <= 32'h0;
w_ctr_reg <= 6'h0;
end
else
@@ -129,6 +132,8 @@ module sha256_w_mem(
w_mem[15] <= w_mem15_new;
end
+ w_reg <= w_new;
+
if (w_ctr_we)
w_ctr_reg <= w_ctr_new;
end
@@ -146,7 +151,7 @@ module sha256_w_mem(
if (w_ctr_reg < 16)
w_tmp = w_mem[w_ctr_reg[3 : 0]];
else
- w_tmp = w_new;
+ w_tmp = w_reg;
end // select_w