Skip to content

Commit

Permalink
Enable checker and cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
calonso88 committed Apr 13, 2024
1 parent 3246849 commit 22d4697
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/rsa_control.sv
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ module rsa_control #(parameter int WIDTH = 8) (rstb, clk, ena, clear, E, clear_m
logic load_exp;
logic shift_exp;

logic [($clog2(WIDTH-1))-1:0] counter_steps; // [3:0]
logic [($clog2(WIDTH-1))-1:0] counter_rounds; // [3:0]
logic [($clog2(WIDTH-1))-1:0] counter_steps;
logic [($clog2(WIDTH-1))-1:0] counter_rounds;
logic clear_counter_steps;
logic clear_counter_rounds;
logic increment_steps;
logic increment_rounds;
logic [($clog2(WIDTH-1))-1:0] const_counter_compare; // [3:0]
logic [($clog2(WIDTH-1))-1:0] const_counter_compare;

// FSM states type
typedef enum logic [3:0] {
Expand Down Expand Up @@ -186,7 +186,7 @@ module rsa_control #(parameter int WIDTH = 8) (rstb, clk, ena, clear, E, clear_m
clear_counter_rounds = 1'b0;
increment_steps = 1'b1;
increment_rounds = 1'b0;
if ( counter_steps == const_counter_compare ) begin // 4'd10
if ( counter_steps == const_counter_compare ) begin
next_state = STATE_POST_MAP;
end else begin
next_state = STATE_MAP;
Expand Down Expand Up @@ -247,7 +247,7 @@ module rsa_control #(parameter int WIDTH = 8) (rstb, clk, ena, clear, E, clear_m
clear_counter_rounds = 1'b0;
increment_steps = 1'b1;
increment_rounds = 1'b0;
if ( counter_steps == const_counter_compare ) begin // 4'd10
if ( counter_steps == const_counter_compare ) begin
next_state = STATE_POST_MMM;
end else begin
next_state = STATE_MMM;
Expand All @@ -270,7 +270,7 @@ module rsa_control #(parameter int WIDTH = 8) (rstb, clk, ena, clear, E, clear_m
clear_counter_rounds = 1'b0;
increment_steps = 1'b0;
increment_rounds = 1'b1;
if ( counter_rounds == const_counter_compare ) begin // 4'd10
if ( counter_rounds == const_counter_compare ) begin
next_state = STATE_PRE_REMAP;
end else begin
next_state = STATE_PRE_MMM;
Expand Down Expand Up @@ -312,7 +312,7 @@ module rsa_control #(parameter int WIDTH = 8) (rstb, clk, ena, clear, E, clear_m
clear_counter_rounds = 1'b0;
increment_steps = 1'b1;
increment_rounds = 1'b0;
if ( counter_steps == const_counter_compare ) begin // 4'd10
if ( counter_steps == const_counter_compare ) begin
next_state = POST_REMAP;
end else begin
next_state = STATE_REMAP;
Expand Down
6 changes: 3 additions & 3 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ async def test_spi(dut):
d = pow(e, -1, phi_m)

# Number of bits for RSA implementation
hwbits = bits + 2
# DEBUG
hwbits = 8 + 2
####################hwbits = bits + 2
#hwbits = 8 + 2
# DEBUG

# Montgomery constant
Expand Down Expand Up @@ -341,7 +341,7 @@ async def test_spi(dut):

assert plain_text == decrypted_text
# DEBUG
#assert encrypted_text_design == encrypted_text
assert encrypted_text_design == encrypted_text
# DEBUG

# Write reg[0] = 0xF0
Expand Down

0 comments on commit 22d4697

Please sign in to comment.