Line 15... |
Line 15... |
---- - Krzysztof Gajewski, gajos@opencores.org ----
|
---- - Krzysztof Gajewski, gajos@opencores.org ----
|
---- k.gajewski@gmail.com ----
|
---- k.gajewski@gmail.com ----
|
---- ----
|
---- ----
|
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
---- ----
|
---- ----
|
---- Copyright (C) 2014 Authors and OPENCORES.ORG ----
|
---- Copyright (C) 2019 Authors and OPENCORES.ORG ----
|
---- ----
|
---- ----
|
---- This source file may be used and distributed without ----
|
---- This source file may be used and distributed without ----
|
---- restriction provided that this copyright statement is not ----
|
---- restriction provided that this copyright statement is not ----
|
---- removed from the file and that any derivative work contains ----
|
---- removed from the file and that any derivative work contains ----
|
---- the original copyright notice and the associated disclaimer. ----
|
---- the original copyright notice and the associated disclaimer. ----
|
Line 64... |
Line 64... |
type exponentiator_states is (FIRST_RUN, NOP,
|
type exponentiator_states is (FIRST_RUN, NOP,
|
READ_DATA_BASE, READ_DATA_MODULUS, READ_DATA_EXPONENT, READ_DATA_RESIDUUM,
|
READ_DATA_BASE, READ_DATA_MODULUS, READ_DATA_EXPONENT, READ_DATA_RESIDUUM,
|
COUNT_POWER, EXP_Z, SAVE_EXP_Z, EXP_P, SAVE_EXP_P, EXP_CONTROL, EXP_END, SAVE_EXP_MULT,
|
COUNT_POWER, EXP_Z, SAVE_EXP_Z, EXP_P, SAVE_EXP_P, EXP_CONTROL, EXP_END, SAVE_EXP_MULT,
|
INFO_RESULT, SHOW_RESULT);
|
INFO_RESULT, SHOW_RESULT);
|
|
|
type fin_data_ctrl_states is (NOP, PAD_FAIL, PAD_FAIL_NOP, PAD_FAIL_DECODE,
|
type comm_ctrl_states is (NOP, DECODE_IN, READ_DATA, DECODE_READ, DECODE_READ_PROP, MAKE_MOD_EXP,
|
DECODE_IN, READ_DATA, DECODE_READ, DECODE_READ_PROP, MAKE_FINALIZE, OUTPUT_DATA, INFO_STATE,
|
OUTPUT_DATA, INFO_STATE, TEMPORARY_STATE, DATA_TO_OUT_PROPAGATE, DATA_TO_OUT_PROPAGATE2,
|
TEMPORARY_STATE, DATA_TO_OUT_PROPAGATE, DATA_TO_OUT_PROPAGATE2, MOVE_DATA, MOVE_OUTPUT_DATA);
|
MOVE_DATA, MOVE_OUTPUT_DATA);
|
|
|
---- mnemonics for exponentiator
|
---- mnemonics for exponentiator
|
constant mn_read_base : STD_LOGIC_VECTOR(2 downto 0) := "000";
|
constant mn_read_base : STD_LOGIC_VECTOR(2 downto 0) := "000";
|
constant mn_read_modulus : STD_LOGIC_VECTOR(2 downto 0) := "001";
|
constant mn_read_modulus : STD_LOGIC_VECTOR(2 downto 0) := "001";
|
constant mn_read_exponent : STD_LOGIC_VECTOR(2 downto 0) := "010";
|
constant mn_read_exponent : STD_LOGIC_VECTOR(2 downto 0) := "010";
|
constant mn_read_residuum : STD_LOGIC_VECTOR(2 downto 0) := "011";
|
constant mn_read_residuum : STD_LOGIC_VECTOR(2 downto 0) := "011";
|
constant mn_count_power : STD_LOGIC_VECTOR(2 downto 0) := "100";
|
constant mn_count_power : STD_LOGIC_VECTOR(2 downto 0) := "100";
|
constant mn_show_result : STD_LOGIC_VECTOR(2 downto 0) := "101";
|
constant mn_show_result : STD_LOGIC_VECTOR(2 downto 0) := "101";
|
constant mn_show_status : STD_LOGIC_VECTOR(2 downto 0) := "110";
|
|
constant mn_prepare_for_data : STD_LOGIC_VECTOR(2 downto 0) := "111";
|
constant mn_prepare_for_data : STD_LOGIC_VECTOR(2 downto 0) := "111";
|
|
|
---- addresses for memory data
|
---- addresses for memory data
|
constant addr_base : STD_LOGIC_VECTOR(3 downto 0) := "0000";
|
constant addr_base : STD_LOGIC_VECTOR(3 downto 0) := "0000";
|
constant addr_modulus : STD_LOGIC_VECTOR(3 downto 0) := "0010";
|
constant addr_modulus : STD_LOGIC_VECTOR(3 downto 0) := "0010";
|