aboutsummaryrefslogblamecommitdiff
path: root/rtl/modexpng_mmm_dual_fsm.vh
blob: c58424354562fd3d407ce1e404bf25c3d9c5cfa6 (plain) (tree)































                                                                           
                             
 


                                                                                                    
    


                                                                                                    
 


                                                                                                    
 


                                                                                                    
 


                                                                                                    
    
                                                                                                    
 


                                                                                                    
 


                                                                                                    
    




                                                                                                    
 


                                                                                                    
 
                                                                                                    
 
                                                                                                    
 
                                                                                                    
//======================================================================
//
// Copyright (c) 2019, NORDUnet A/S All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// - Redistributions of source code must retain the above copyright
//   notice, this list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright
//   notice, this list of conditions and the following disclaimer in the
//   documentation and/or other materials provided with the distribution.
//
// - Neither the name of the NORDUnet nor the names of its contributors may
//   be used to endorse or promote products derived from this software
//   without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//======================================================================

`define MMM_FSM_STATE_W_DEF 6

localparam MMM_FSM_STATE_W = `MMM_FSM_STATE_W_DEF;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_IDLE                      = `MMM_FSM_STATE_W_DEF'd00;
    
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_LOAD_T1T2_1               = `MMM_FSM_STATE_W_DEF'd01;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_LOAD_T1T2_2               = `MMM_FSM_STATE_W_DEF'd02;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_LOAD_T1T2_3               = `MMM_FSM_STATE_W_DEF'd03;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_LOAD_NN_COEFF_1           = `MMM_FSM_STATE_W_DEF'd04;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_LOAD_NN_COEFF_2           = `MMM_FSM_STATE_W_DEF'd05;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_LOAD_NN_COEFF_3           = `MMM_FSM_STATE_W_DEF'd06;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_SQUARE_COL_0_INIT    = `MMM_FSM_STATE_W_DEF'd11;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_SQUARE_COL_0_TRIG    = `MMM_FSM_STATE_W_DEF'd12;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_SQUARE_COL_0_BUSY    = `MMM_FSM_STATE_W_DEF'd13;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_SQUARE_COL_N_INIT    = `MMM_FSM_STATE_W_DEF'd14;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_SQUARE_COL_N_TRIG    = `MMM_FSM_STATE_W_DEF'd15;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_SQUARE_COL_N_BUSY    = `MMM_FSM_STATE_W_DEF'd16;
    
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_SQUARE_HOLDOFF       = `MMM_FSM_STATE_W_DEF'd17;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_TRIANGLE_COL_0_INIT  = `MMM_FSM_STATE_W_DEF'd21;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_TRIANGLE_COL_0_TRIG  = `MMM_FSM_STATE_W_DEF'd22;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_TRIANGLE_COL_0_BUSY  = `MMM_FSM_STATE_W_DEF'd23;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_TRIANGLE_COL_N_INIT  = `MMM_FSM_STATE_W_DEF'd24;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_TRIANGLE_COL_N_TRIG  = `MMM_FSM_STATE_W_DEF'd25;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_TRIANGLE_COL_N_BUSY  = `MMM_FSM_STATE_W_DEF'd26;
    
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_TRIANGLE_HOLDOFF     = `MMM_FSM_STATE_W_DEF'd27;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_RECTANGLE_COL_0_INIT = `MMM_FSM_STATE_W_DEF'd31;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_RECTANGLE_COL_0_TRIG = `MMM_FSM_STATE_W_DEF'd32;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_RECTANGLE_COL_0_BUSY = `MMM_FSM_STATE_W_DEF'd33;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_RECTANGLE_COL_N_INIT = `MMM_FSM_STATE_W_DEF'd34;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_RECTANGLE_COL_N_TRIG = `MMM_FSM_STATE_W_DEF'd35;
localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_RECTANGLE_COL_N_BUSY = `MMM_FSM_STATE_W_DEF'd36;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_MULT_RECTANGLE_HOLDOFF    = `MMM_FSM_STATE_W_DEF'd37;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_WAIT_REDUCTOR             = `MMM_FSM_STATE_W_DEF'd41;

localparam [MMM_FSM_STATE_W-1:0] MMM_FSM_STATE_STOP                      = `MMM_FSM_STATE_W_DEF'd51;