aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2015-11-13 16:48:39 -0500
committerPaul Selkirk <paul@psgd.org>2015-11-14 19:33:46 -0500
commit23ffa6a5939d49cee92ca9657e1ef7781e5a55b9 (patch)
treeca8b83b81dfdbc7f26fd85caac1f0f74a16aaf79
parentc67a63762f6afd7bdc424559d557035ff2b4397c (diff)
parenta1c1b2afb0b437dc195b5103e3ae46395b0cd2f7 (diff)
Merge branch 'config_core_selector'
-rw-r--r--src/rtl/trng.v8
-rw-r--r--src/rtl/trng_mixer.v17
2 files changed, 21 insertions, 4 deletions
diff --git a/src/rtl/trng.v b/src/rtl/trng.v
index c74f8b1..7a15e7e 100644
--- a/src/rtl/trng.v
+++ b/src/rtl/trng.v
@@ -61,10 +61,10 @@ module trng(
// Internal constant and parameter definitions.
//----------------------------------------------------------------
localparam TRNG_PREFIX = 4'h0;
- localparam ENTROPY1_PREFIX = 4'h5;
- localparam ENTROPY2_PREFIX = 4'h6;
- localparam MIXER_PREFIX = 4'ha;
- localparam CSPRNG_PREFIX = 4'hb;
+ localparam ENTROPY1_PREFIX = 4'h1;
+ localparam ENTROPY2_PREFIX = 4'h2;
+ localparam MIXER_PREFIX = 4'h3;
+ localparam CSPRNG_PREFIX = 4'h4;
localparam DEBUG_ENTROPY0 = 3'h0;
localparam DEBUG_ENTROPY1 = 3'h1;
diff --git a/src/rtl/trng_mixer.v b/src/rtl/trng_mixer.v
index 0d565c7..d192090 100644
--- a/src/rtl/trng_mixer.v
+++ b/src/rtl/trng_mixer.v
@@ -99,6 +99,10 @@ module trng_mixer(
localparam CTRL_ACK = 4'h4;
localparam CTRL_NEXT = 4'h5;
+ localparam ADDR_NAME0 = 8'h00;
+ localparam ADDR_NAME1 = 8'h01;
+ localparam ADDR_VERSION = 8'h02;
+
localparam ADDR_MIXER_CTRL = 8'h10;
localparam MIXER_CTRL_ENABLE_BIT = 0;
localparam MIXER_CTRL_RESTART_BIT = 1;
@@ -107,6 +111,10 @@ module trng_mixer(
localparam DEFAULT_ENTROPY_TIMEOUT = 24'h100000;
+ parameter CORE_NAME0 = 32'h726e676d; // "rngm"
+ parameter CORE_NAME1 = 32'h69786572; // "ixer"
+ parameter CORE_VERSION = 32'h302e3530; // "0.50"
+
//----------------------------------------------------------------
// Registers including update variables and write enable.
@@ -525,6 +533,15 @@ module trng_mixer(
// Read operations.
case (address)
// Read operations.
+ ADDR_NAME0:
+ tmp_read_data = CORE_NAME0;
+
+ ADDR_NAME1:
+ tmp_read_data = CORE_NAME1;
+
+ ADDR_VERSION:
+ tmp_read_data = CORE_VERSION;
+
ADDR_MIXER_CTRL:
begin
tmp_read_data = {30'h00000000, restart_reg, enable_reg};