diff options
author | Joachim StroĢmbergson <joachim@assured.se> | 2019-03-26 16:54:03 +0100 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@assured.se> | 2019-03-26 16:54:03 +0100 |
commit | 485b5c0316062d5ce7334ed224cc9df242123a32 (patch) | |
tree | 2d71ebf45f1275f53b35a0ff98d17296b5c19d7f /src | |
parent | 6f167e358cd681722eea2b482e2e8d429ea673ad (diff) |
(1) Changing key memory to be based on bytes. (2) Adding API commands ands status values for operating the memory.
Diffstat (limited to 'src')
-rw-r--r-- | src/rtl/fpga_mkm.v | 12 |
1 files changed, 10 insertions, 2 deletions
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; |