Update to timeout value

This commit is contained in:
bsdevlin 2019-04-11 17:06:57 -04:00
parent 4f6ce27d32
commit ca899c7d17
1 changed files with 11 additions and 10 deletions

View File

@ -34,16 +34,16 @@ logic pt_mult1_in_val, pt_mult1_in_rdy, pt_mult1_out_rdy, pt_mult1_out_val, pt_m
// Global timeout in case we get stuck somewhere, we send a failed message back to host // Global timeout in case we get stuck somewhere, we send a failed message back to host
logic [(USE_ENDOMORPH == "YES" ? 14 : 15):0] timeout; logic [(USE_ENDOMORPH == "YES" ? 14 : 15):0] timeout;
// Controlling state machine // Controlling state machine
typedef enum {IDLE, typedef enum {IDLE = 0,
GET_INDEX, GET_INDEX = 1,
VERIFY_SECP256K1_SIG_PARSE, VERIFY_SECP256K1_SIG_PARSE = 2,
CALC_S_INV, CALC_S_INV = 3,
CALC_U1_U2, CALC_U1_U2 = 4,
CALC_X, CALC_X = 5,
CALC_X_AFFINE, CALC_X_AFFINE = 6,
CHECK_IN_JB, CHECK_IN_JB = 7,
IGNORE, IGNORE = 8,
FINISHED} secp256k1_state_t; FINISHED = 9} secp256k1_state_t;
(* mark_debug = "true" *) secp256k1_state_t secp256k1_state; (* mark_debug = "true" *) secp256k1_state_t secp256k1_state;
header_t header, header_l; header_t header, header_l;
@ -389,6 +389,7 @@ always_ff @ (posedge i_clk) begin
// Something went wrong - send a message back to host // Something went wrong - send a message back to host
if (&timeout) begin if (&timeout) begin
secp256k1_ver.TIMEOUT_FAIL <= 1; secp256k1_ver.TIMEOUT_FAIL <= 1;
timeout <= timeout;
end end
if (secp256k1_ver.TIMEOUT_FAIL) begin if (secp256k1_ver.TIMEOUT_FAIL) begin
secp256k1_ver.TIMEOUT_FAIL <= 0; secp256k1_ver.TIMEOUT_FAIL <= 0;