From 3f44b999acd9875b9f89571391d3bd6d58b10ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Str=C3=B6mbergson?= Date: Tue, 11 Oct 2022 09:50:45 +0200 Subject: [PATCH 1/3] Remove name, version from several cores timer touch_sense figaro uart uds --- hw/application_fpga/core/timer/rtl/timer.v | 20 ------------- .../core/touch_sense/rtl/touch_sense.v | 20 ------------- hw/application_fpga/core/trng/rtl/figaro.v | 20 ------------- hw/application_fpga/core/uart/rtl/uart.v | 22 --------------- hw/application_fpga/core/uds/rtl/uds.v | 20 ------------- hw/application_fpga/core/uds/tb/tb_uds.v | 28 +++++++++---------- 6 files changed, 13 insertions(+), 117 deletions(-) diff --git a/hw/application_fpga/core/timer/rtl/timer.v b/hw/application_fpga/core/timer/rtl/timer.v index 9a44e77..bc1f47c 100644 --- a/hw/application_fpga/core/timer/rtl/timer.v +++ b/hw/application_fpga/core/timer/rtl/timer.v @@ -30,10 +30,6 @@ module timer( //---------------------------------------------------------------- // Internal constant and parameter definitions. //---------------------------------------------------------------- - localparam ADDR_NAME0 = 8'h00; - localparam ADDR_NAME1 = 8'h01; - localparam ADDR_VERSION = 8'h02; - localparam ADDR_CTRL = 8'h08; localparam CTRL_START_BIT = 0; localparam CTRL_STOP_BIT = 1; @@ -44,10 +40,6 @@ module timer( localparam ADDR_PRESCALER = 8'h0a; localparam ADDR_TIMER = 8'h0b; - localparam CORE_NAME0 = 32'h74696d65; // "time" - localparam CORE_NAME1 = 32'h72202020; // "r " - localparam CORE_VERSION = 32'h00000003; - //---------------------------------------------------------------- // Registers including update variables and write enable. @@ -159,18 +151,6 @@ module timer( end else begin - if (address == ADDR_NAME0) begin - tmp_read_data = CORE_NAME0; - end - - if (address == ADDR_NAME1) begin - tmp_read_data = CORE_NAME1; - end - - if (address == ADDR_VERSION) begin - tmp_read_data = CORE_VERSION; - end - if (address == ADDR_STATUS) begin tmp_read_data = {31'h0, core_ready}; end diff --git a/hw/application_fpga/core/touch_sense/rtl/touch_sense.v b/hw/application_fpga/core/touch_sense/rtl/touch_sense.v index 754c857..6233619 100644 --- a/hw/application_fpga/core/touch_sense/rtl/touch_sense.v +++ b/hw/application_fpga/core/touch_sense/rtl/touch_sense.v @@ -31,17 +31,9 @@ module touch_sense( //---------------------------------------------------------------- // Internal constant and parameter definitions. //---------------------------------------------------------------- - localparam ADDR_NAME0 = 8'h00; - localparam ADDR_NAME1 = 8'h01; - localparam ADDR_VERSION = 8'h02; - localparam ADDR_STATUS = 8'h09; localparam STATUS_EVENT_BIT = 0; - localparam CORE_NAME0 = 32'h745f7365; // "t_se" - localparam CORE_NAME1 = 32'h6e736520; // "nse " - localparam CORE_VERSION = 32'h00000001; - localparam CTRL_IDLE = 2'h0; localparam CTRL_EVENT = 2'h1; localparam CTRL_WAIT = 2'h2; @@ -125,18 +117,6 @@ module touch_sense( end else begin - if (address == ADDR_NAME0) begin - tmp_read_data = CORE_NAME0; - end - - if (address == ADDR_NAME1) begin - tmp_read_data = CORE_NAME1; - end - - if (address == ADDR_VERSION) begin - tmp_read_data = CORE_VERSION; - end - if (address == ADDR_STATUS) begin tmp_read_data[STATUS_EVENT_BIT] = touch_event_reg; end diff --git a/hw/application_fpga/core/trng/rtl/figaro.v b/hw/application_fpga/core/trng/rtl/figaro.v index 9e28707..70ba469 100644 --- a/hw/application_fpga/core/trng/rtl/figaro.v +++ b/hw/application_fpga/core/trng/rtl/figaro.v @@ -31,10 +31,6 @@ module figaro( //---------------------------------------------------------------- // Internal constant and parameter definitions. //---------------------------------------------------------------- - localparam ADDR_NAME0 = 8'h00; - localparam ADDR_NAME1 = 8'h01; - localparam ADDR_VERSION = 8'h02; - localparam ADDR_STATUS = 8'h09; localparam STATUS_READY_BIT = 0; @@ -42,10 +38,6 @@ module figaro( localparam ADDR_ENTROPY = 8'h20; - localparam CORE_NAME0 = 32'h66696761; // "figa" - localparam CORE_NAME1 = 32'h726f2020; // "ro " - localparam CORE_VERSION = 32'h00000001; - //---------------------------------------------------------------- // Wires. @@ -101,18 +93,6 @@ module figaro( end else begin - if (address == ADDR_NAME0) begin - tmp_read_data = CORE_NAME0; - end - - if (address == ADDR_NAME1) begin - tmp_read_data = CORE_NAME1; - end - - if (address == ADDR_VERSION) begin - tmp_read_data = CORE_VERSION; - end - if (address == ADDR_STATUS) begin tmp_read_data = {31'h0, core_ready}; end diff --git a/hw/application_fpga/core/uart/rtl/uart.v b/hw/application_fpga/core/uart/rtl/uart.v index b31ecd8..d84d8ec 100644 --- a/hw/application_fpga/core/uart/rtl/uart.v +++ b/hw/application_fpga/core/uart/rtl/uart.v @@ -69,10 +69,6 @@ module uart( //---------------------------------------------------------------- // Internal constant and parameter definitions. //---------------------------------------------------------------- - localparam ADDR_CORE_NAME0 = 8'h00; - localparam ADDR_CORE_NAME1 = 8'h01; - localparam ADDR_CORE_VERSION = 8'h02; - localparam ADDR_BIT_RATE = 8'h10; localparam ADDR_DATA_BITS = 8'h11; localparam ADDR_STOP_BITS = 8'h12; @@ -83,12 +79,6 @@ module uart( localparam ADDR_TX_STATUS = 8'h40; localparam ADDR_TX_DATA = 8'h41; - - localparam CORE_NAME0 = 32'h75617274; // "uart" - localparam CORE_NAME1 = 32'h20202020; // " " - localparam CORE_VERSION = 32'h00000004; - - // The default bit rate is based on target clock frequency // divided by the bit rate times in order to hit the // center of the bits. I.e. @@ -257,18 +247,6 @@ module uart( else begin case (address) - ADDR_CORE_NAME0: begin - tmp_read_data = CORE_NAME0; - end - - ADDR_CORE_NAME1: begin - tmp_read_data = CORE_NAME1; - end - - ADDR_CORE_VERSION: begin - tmp_read_data = CORE_VERSION; - end - ADDR_BIT_RATE: begin tmp_read_data = {16'h0, bit_rate_reg}; end diff --git a/hw/application_fpga/core/uds/rtl/uds.v b/hw/application_fpga/core/uds/rtl/uds.v index 8cff428..efda3d6 100644 --- a/hw/application_fpga/core/uds/rtl/uds.v +++ b/hw/application_fpga/core/uds/rtl/uds.v @@ -29,17 +29,9 @@ module uds( //---------------------------------------------------------------- // Internal constant and parameter definitions. //---------------------------------------------------------------- - localparam ADDR_NAME0 = 8'h00; - localparam ADDR_NAME1 = 8'h01; - localparam ADDR_VERSION = 8'h02; - localparam ADDR_UDS_FIRST = 8'h10; localparam ADDR_UDS_LAST = 8'h17; - localparam CORE_NAME0 = 32'h7564735f; // "uds_" - localparam CORE_NAME1 = 32'h6d656d20; // "mem " - localparam CORE_VERSION = 32'h00000001; - //---------------------------------------------------------------- // Registers including update variables and write enable. @@ -99,18 +91,6 @@ module uds( if (cs) begin tmp_ready = 1'h1; - if (address == ADDR_NAME0) begin - tmp_read_data = CORE_NAME0; - end - - if (address == ADDR_NAME1) begin - tmp_read_data = CORE_NAME1; - end - - if (address == ADDR_VERSION) begin - tmp_read_data = CORE_VERSION; - end - if ((address >= ADDR_UDS_FIRST) && (address <= ADDR_UDS_LAST)) begin if (!fw_app_mode) begin if (uds_rd_reg[address[2 : 0]] == 1'h0) begin diff --git a/hw/application_fpga/core/uds/tb/tb_uds.v b/hw/application_fpga/core/uds/tb/tb_uds.v index 25799ba..353c221 100644 --- a/hw/application_fpga/core/uds/tb/tb_uds.v +++ b/hw/application_fpga/core/uds/tb/tb_uds.v @@ -42,6 +42,7 @@ module tb_uds(); reg tb_clk; reg tb_reset_n; + reg tb_fw_app_mode; reg tb_cs; reg [7 : 0] tb_address; wire [31 : 0] tb_read_data; @@ -53,14 +54,15 @@ module tb_uds(); // Device Under Test. //---------------------------------------------------------------- uds dut( - .clk(tb_clk), - .reset_n(tb_reset_n), + .clk(tb_clk), + .reset_n(tb_reset_n), - .cs(tb_cs), + .fw_app_mode(tb_fw_app_mode), - .address(tb_address), - .read_data(tb_read_data) - ); + .cs(tb_cs), + .address(tb_address), + .read_data(tb_read_data) + ); //---------------------------------------------------------------- @@ -161,10 +163,11 @@ module tb_uds(); tc_ctr = 0; tb_monitor = 0; - tb_clk = 1'h0; - tb_reset_n = 1'h1; - tb_cs = 1'h0; - tb_address = 8'h0; + tb_clk = 1'h0; + tb_reset_n = 1'h1; + tb_fw_app_mode = 1'h0; + tb_cs = 1'h0; + tb_address = 8'h0; end endtask // init_sim @@ -204,11 +207,6 @@ module tb_uds(); $display(""); $display("--- test1: started."); - $display("--- test1: Reading NAME and version info."); - read_word(ADDR_NAME0); - read_word(ADDR_NAME1); - read_word(ADDR_VERSION); - $display("--- test1: Dumping DUT state to show UDS contents"); dump_dut_state(); From 87dab3fe6d75ad479d973986e754b99be314201a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Str=C3=B6mbergson?= Date: Tue, 11 Oct 2022 09:55:56 +0200 Subject: [PATCH 2/3] Remove name, version addresses for cores --- hw/application_fpga/fw/mta1_mkdf_mem.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/hw/application_fpga/fw/mta1_mkdf_mem.h b/hw/application_fpga/fw/mta1_mkdf_mem.h index 2a8b0c1..47463ef 100644 --- a/hw/application_fpga/fw/mta1_mkdf_mem.h +++ b/hw/application_fpga/fw/mta1_mkdf_mem.h @@ -37,17 +37,11 @@ enum { MTA1_MKDF_NAME1_SUFFIX = 0x04, MTA1_MKDF_VERSION_SUFFIX = 0x08, - MTA1_MKDF_MMIO_TRNG_NAME0 = MTA1_MKDF_MMIO_TRNG_BASE | MTA1_MKDF_NAME0_SUFFIX, - MTA1_MKDF_MMIO_TRNG_NAME1 = MTA1_MKDF_MMIO_TRNG_BASE | MTA1_MKDF_NAME1_SUFFIX, - MTA1_MKDF_MMIO_TRNG_VERSION = MTA1_MKDF_MMIO_TRNG_BASE | MTA1_MKDF_VERSION_SUFFIX, MTA1_MKDF_MMIO_TRNG_STATUS = MTA1_MKDF_MMIO_TRNG_BASE | 0x24, MTA1_MKDF_MMIO_TRNG_STATUS_READY_BIT = 0, MTA1_MKDF_MMIO_TRNG_SAMPLE_RATE = MTA1_MKDF_MMIO_TRNG_BASE | 0x40, MTA1_MKDF_MMIO_TRNG_ENTROPY = MTA1_MKDF_MMIO_TRNG_BASE | 0x80, - MTA1_MKDF_MMIO_TIMER_NAME0 = MTA1_MKDF_MMIO_TIMER_BASE | MTA1_MKDF_NAME0_SUFFIX, - MTA1_MKDF_MMIO_TIMER_NAME1 = MTA1_MKDF_MMIO_TIMER_BASE | MTA1_MKDF_NAME1_SUFFIX, - MTA1_MKDF_MMIO_TIMER_VERSION = MTA1_MKDF_MMIO_TIMER_BASE | MTA1_MKDF_VERSION_SUFFIX, MTA1_MKDF_MMIO_TIMER_CTRL = MTA1_MKDF_MMIO_TIMER_BASE | 0x20, MTA1_MKDF_MMIO_TIMER_CTRL_START_BIT = 0, MTA1_MKDF_MMIO_TIMER_CTRL_STOP_BIT = 1, @@ -56,15 +50,9 @@ enum { MTA1_MKDF_MMIO_TIMER_PRESCALER = MTA1_MKDF_MMIO_TIMER_BASE | 0x28, MTA1_MKDF_MMIO_TIMER_TIMER = MTA1_MKDF_MMIO_TIMER_BASE | 0x2c, - MTA1_MKDF_MMIO_UDS_NAME0 = MTA1_MKDF_MMIO_UDS_BASE | MTA1_MKDF_NAME0_SUFFIX, - MTA1_MKDF_MMIO_UDS_NAME1 = MTA1_MKDF_MMIO_UDS_BASE | MTA1_MKDF_NAME1_SUFFIX, - MTA1_MKDF_MMIO_UDS_VERSION = MTA1_MKDF_MMIO_UDS_BASE | MTA1_MKDF_VERSION_SUFFIX, MTA1_MKDF_MMIO_UDS_FIRST = MTA1_MKDF_MMIO_UDS_BASE | 0x40, MTA1_MKDF_MMIO_UDS_LAST = MTA1_MKDF_MMIO_UDS_BASE | 0x5c, // Address of last 32-bit word of UDS - MTA1_MKDF_MMIO_UART_NAME0 = MTA1_MKDF_MMIO_UART_BASE | MTA1_MKDF_NAME0_SUFFIX, - MTA1_MKDF_MMIO_UART_NAME1 = MTA1_MKDF_MMIO_UART_BASE | MTA1_MKDF_NAME1_SUFFIX, - MTA1_MKDF_MMIO_UART_VERSION = MTA1_MKDF_MMIO_UART_BASE | MTA1_MKDF_VERSION_SUFFIX, MTA1_MKDF_MMIO_UART_BIT_RATE = MTA1_MKDF_MMIO_UART_BASE | 0x40, MTA1_MKDF_MMIO_UART_DATA_BITS = MTA1_MKDF_MMIO_UART_BASE | 0x44, MTA1_MKDF_MMIO_UART_STOP_BITS = MTA1_MKDF_MMIO_UART_BASE | 0x48, @@ -73,9 +61,6 @@ enum { MTA1_MKDF_MMIO_UART_TX_STATUS = MTA1_MKDF_MMIO_UART_BASE | 0x100, MTA1_MKDF_MMIO_UART_TX_DATA = MTA1_MKDF_MMIO_UART_BASE | 0x104, - MTA1_MKDF_MMIO_TOUCH_NAME0 = MTA1_MKDF_MMIO_TOUCH_BASE | MTA1_MKDF_NAME0_SUFFIX, - MTA1_MKDF_MMIO_TOUCH_NAME1 = MTA1_MKDF_MMIO_TOUCH_BASE | MTA1_MKDF_NAME1_SUFFIX, - MTA1_MKDF_MMIO_TOUCH_VERSION = MTA1_MKDF_MMIO_TOUCH_BASE | MTA1_MKDF_VERSION_SUFFIX, MTA1_MKDF_MMIO_TOUCH_STATUS = MTA1_MKDF_MMIO_TOUCH_BASE | 0x24, MTA1_MKDF_MMIO_TOUCH_STATUS_EVENT_BIT = 0, From 1439e4a587701693552be4444858c20f3b894a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Str=C3=B6mbergson?= Date: Tue, 11 Oct 2022 11:28:40 +0200 Subject: [PATCH 3/3] Remove name, version info about cores from SW description --- doc/system_description/software.md | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/doc/system_description/software.md b/doc/system_description/software.md index 2604003..bc6c29b 100644 --- a/doc/system_description/software.md +++ b/doc/system_description/software.md @@ -270,41 +270,20 @@ Assigned core prefixes: | MTA1 | 0xff | | | | -Every core has a NAME1, NAME2, and VERSION to identify it. - -Examples: - -| *address* | *description* | -|------------|-----------------| -| 0xc3000004 | NAME1 in UART | -| 0xff000000 | NAME0 in MTA1 | -| 0xff000008 | VERSION in MTA1 | *Nota bene*: All MMIO accesses should be 32 bit wide, e.g use `lw` and `sw`. | *name* | *fw* | *app | *size* | *type* | *content* | *description* | |--------------------|------|------------|--------|---------|-----------|--------------------------------------------------------| -| `TRNG_NAME0` | r | r | 4B | char[4] | | ID of core | -| `TRNG_NAME1` | r | r | 4B | char[4] | | ID of core | -| `TRNG_VERSION` | r | r | 4B | u32 | | Version of core | | `TRNG_STATUS` | r | r | | | | TBD | | `TRNG_SAMPLE_RATE` | | r | | | | TBD | | `TRNG_ENTROPY` | | | | | | TBD | -| `TIMER_NAME0` | r | r | | | | ID of core | -| `TIMER_NAME1` | r | r | | | | ID of core | -| `TIMER_VERSION` | r | r | | | | Version of core | | `TIMER_CTRL` | | | | | | TBD | | `TIMER_STATUS` | r | | | | | TBD | | `TIMER_PRESCALER` | | r/w | | | | TBD | | `TIMER_TIMER` | | r | | | | TBD | -| `UDS_NAME0` | r | invisible | | | | ID of core | -| `UDS_NAME1` | r | invisible | | | | ID of core | -| `UDS_VERSION` | r | invisible | | | | Version of core | | `UDS_START` | r[^2]| invisible | 4B | u8[32] | | First word of Unique Device Secret key. | | `UDS_LAST` | | invisible | | | | The last word of the UDS | -| `UART_NAME0` | r | r | | | | ID of core | -| `UART_NAME1` | r | r | | | | ID of core | -| `UART_VERSION` | r | r | | | | Version of core | | `UART_BITRATE` | r/w | | | | | TBD | | `UART_DATABITS` | r/w | | | | | TBD | | `UART_STOPBITS` | r/w | | | | | TBD | @@ -312,9 +291,6 @@ Examples: | `UART_RX_DATA` | r | r | 1B | u8 | | Data to read. Only LSB contains data | | `UART_TX_STATUS` | r | r | 1B | u8 | | Non-zero when it's OK to write data | | `UART_TX_DATA` | w | w | 1B | u8 | | Data to send. Only LSB contains data | -| `TOUCH_NAME0` | r | r | | | | ID of core | -| `TOUCH_NAME1` | r | r | | | | ID of core | -| `TOUCH_VERSION` | r | r | | | | Version of core | | `TOUCH_STATUS` | r/w | r/w | | | | STATUS_EVENT_BIT set 1 when touched; write to it after | | `UDA` | r | | 16B | u8[16] | | Unique Device Authentication key. | | `UDI` | r | | 8B | u64 | | Unique Device ID (UDI). |