aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2015-04-01 13:24:51 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2015-04-01 13:24:51 +0200
commitd9758bce9e4a4078db00b34780ac0d23c8c8ae92 (patch)
treed5002042e776bd9ab43bf5d6c6b0393157286b1c /src
parent36fe252deac8c3d1c009b4edb07b2ef568ed33d7 (diff)
Cleanup and fixes of calculations.
Diffstat (limited to 'src')
-rw-r--r--src/rtl/trng_csprng.v22
-rw-r--r--src/rtl/trng_csprng_fifo.v2
2 files changed, 12 insertions, 12 deletions
diff --git a/src/rtl/trng_csprng.v b/src/rtl/trng_csprng.v
index 79f7afa..e8cdc44 100644
--- a/src/rtl/trng_csprng.v
+++ b/src/rtl/trng_csprng.v
@@ -81,16 +81,16 @@ module trng_csprng(
localparam CIPHER_KEYLEN256 = 1'b1; // 256 bit key.
localparam CIPHER_MAX_BLOCKS = 64'h1000000000000000;
- localparam CTRL_IDLE = 4'h0;
- localparam CTRL_SEED0 = 4'h1;
- localparam CTRL_NSYN = 4'h2;
- localparam CTRL_SEED1 = 4'h3;
- localparam CTRL_INIT0 = 4'h4;
- localparam CTRL_INIT1 = 4'h5;
- localparam CTRL_NEXT0 = 4'h6;
- localparam CTRL_NEXT1 = 4'h7;
- localparam CTRL_MORE = 4'h8;
- localparam CTRL_CANCE = 4'hf;
+ localparam CTRL_IDLE = 4'h0;
+ localparam CTRL_SEED0 = 4'h1;
+ localparam CTRL_NSYN = 4'h2;
+ localparam CTRL_SEED1 = 4'h3;
+ localparam CTRL_INIT0 = 4'h4;
+ localparam CTRL_INIT1 = 4'h5;
+ localparam CTRL_NEXT0 = 4'h6;
+ localparam CTRL_NEXT1 = 4'h7;
+ localparam CTRL_MORE = 4'h8;
+ localparam CTRL_CANCEL = 4'hf;
localparam DEFAULT_NUM_ROUNDS = 5'h18;
localparam DEFAULT_NUM_BLOCKS = 64'h1000000000000000;
@@ -260,7 +260,7 @@ module trng_csprng(
num_rounds_reg <= DEFAULT_NUM_ROUNDS;
num_blocks_low_reg <= DEFAULT_NUM_BLOCKS[31 : 0];
num_blocks_high_reg <= DEFAULT_NUM_BLOCKS[63 : 32];
- tmp_read_data_reg <= 32'h00000000;
+ read_data_reg <= 32'h00000000;
csprng_ctrl_reg <= CTRL_IDLE;
end
else
diff --git a/src/rtl/trng_csprng_fifo.v b/src/rtl/trng_csprng_fifo.v
index 70c0e1f..e4abc26 100644
--- a/src/rtl/trng_csprng_fifo.v
+++ b/src/rtl/trng_csprng_fifo.v
@@ -57,7 +57,7 @@ module trng_csprng_fifo(
//----------------------------------------------------------------
localparam FIFO_ADDR_BITS = 2;
localparam FIFO_ADDR_MAX = FIFO_ADDR_BITS - 1;
- localparam FIFO_MAX = (2 >> FIFO_ADDR_BITS) - 1;
+ localparam FIFO_MAX = (2 ** FIFO_ADDR_BITS) - 1;
localparam WR_IDLE = 0;
localparam WR_WAIT = 1;