From 485b5c0316062d5ce7334ed224cc9df242123a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Tue, 26 Mar 2019 16:54:03 +0100 Subject: (1) Changing key memory to be based on bytes. (2) Adding API commands ands status values for operating the memory. --- src/rtl/fpga_mkm.v | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rtl/fpga_mkm.v b/src/rtl/fpga_mkm.v index e0dc14a..89825ed 100644 --- a/src/rtl/fpga_mkm.v +++ b/src/rtl/fpga_mkm.v @@ -68,13 +68,21 @@ module fpga_mkm( localparam CTRL_DONE = 3; - localparam MEM_WORDS = 16; + localparam MEM_BYTES = 32; + + localparam CMD_WRITE_BYTES = 8'h37; + localparam CMD_READ_BYTES = 8'h93; + localparam CMD_GET_STATUS = 8'hca; + + localparam STAT_KEY_NOT_LOADED = 8'hdb; + localparam STAT_KEY_LOADED = 8'hbd; + localparam STAT_TAMPER_DETECTED = 8'ha5; //---------------------------------------------------------------- // Registers including update variables and write enable. //---------------------------------------------------------------- - reg [31 : 0] key_mem [0 : (MEM_WORDS - 1)]; + reg [7 : 0] key_mem [0 : (MEM_BYTES - 1)]; reg [21 : 0] alarm_counter_reg = 22'h0; -- cgit v1.2.3