// ==============================================================
// RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2014.1
// Copyright (C) 2014 Xilinx Inc. All rights reserved.
// 
// ===========================================================

`timescale 1 ns / 1 ps 

(* CORE_GENERATION_INFO="nfa_accept_samples_generic_hw,hls_ip_2014_1,{HLS_INPUT_TYPE=c,HLS_INPUT_FLOAT=0,HLS_INPUT_FIXED=0,HLS_INPUT_PART=xc5vlx50tff1136-3,HLS_INPUT_CLOCK=10.000000,HLS_INPUT_ARCH=others,HLS_SYN_CLOCK=7.000000,HLS_SYN_LAT=-1,HLS_SYN_TPT=none,HLS_SYN_MEM=0,HLS_SYN_DSP=0,HLS_SYN_FF=0,HLS_SYN_LUT=0}" *)

module nfa_accept_samples_generic_hw (
        ap_clk,
        ap_rst,
        ap_start,
        ap_done,
        ap_idle,
        ap_ready,
        nfa_initials_buckets_req_din,
        nfa_initials_buckets_req_full_n,
        nfa_initials_buckets_req_write,
        nfa_initials_buckets_rsp_empty_n,
        nfa_initials_buckets_rsp_read,
        nfa_initials_buckets_address,
        nfa_initials_buckets_datain,
        nfa_initials_buckets_dataout,
        nfa_initials_buckets_size,
        nfa_finals_buckets_req_din,
        nfa_finals_buckets_req_full_n,
        nfa_finals_buckets_req_write,
        nfa_finals_buckets_rsp_empty_n,
        nfa_finals_buckets_rsp_read,
        nfa_finals_buckets_address,
        nfa_finals_buckets_datain,
        nfa_finals_buckets_dataout,
        nfa_finals_buckets_size,
        nfa_forward_buckets_req_din,
        nfa_forward_buckets_req_full_n,
        nfa_forward_buckets_req_write,
        nfa_forward_buckets_rsp_empty_n,
        nfa_forward_buckets_rsp_read,
        nfa_forward_buckets_address,
        nfa_forward_buckets_datain,
        nfa_forward_buckets_dataout,
        nfa_forward_buckets_size,
        nfa_symbols,
        sample_buffer_req_din,
        sample_buffer_req_full_n,
        sample_buffer_req_write,
        sample_buffer_rsp_empty_n,
        sample_buffer_rsp_read,
        sample_buffer_address,
        sample_buffer_datain,
        sample_buffer_dataout,
        sample_buffer_size,
        sample_buffer_length,
        sample_length,
        indices_req_din,
        indices_req_full_n,
        indices_req_write,
        indices_rsp_empty_n,
        indices_rsp_read,
        indices_address,
        indices_datain,
        indices_dataout,
        indices_size,
        i_size,
        begin_index,
        begin_sample,
        end_index,
        end_sample,
        stop_on_first,
        accept,
        ap_return
);

parameter    ap_const_logic_1 = 1'b1;
parameter    ap_const_logic_0 = 1'b0;
parameter    ap_ST_st1_fsm_0 = 4'b0000;
parameter    ap_ST_st2_fsm_1 = 4'b1;
parameter    ap_ST_st3_fsm_2 = 4'b10;
parameter    ap_ST_st4_fsm_3 = 4'b11;
parameter    ap_ST_st5_fsm_4 = 4'b100;
parameter    ap_ST_st6_fsm_5 = 4'b101;
parameter    ap_ST_st7_fsm_6 = 4'b110;
parameter    ap_ST_st8_fsm_7 = 4'b111;
parameter    ap_ST_st9_fsm_8 = 4'b1000;
parameter    ap_ST_st10_fsm_9 = 4'b1001;
parameter    ap_const_lv1_0 = 1'b0;
parameter    ap_const_lv5_0 = 5'b00000;
parameter    ap_const_lv16_1 = 16'b1;
parameter    ap_const_lv16_0 = 16'b0000000000000000;
parameter    ap_const_lv32_4 = 32'b100;
parameter    ap_const_lv5_1 = 5'b1;
parameter    ap_true = 1'b1;

input   ap_clk;
input   ap_rst;
input   ap_start;
output   ap_done;
output   ap_idle;
output   ap_ready;
output   nfa_initials_buckets_req_din;
input   nfa_initials_buckets_req_full_n;
output   nfa_initials_buckets_req_write;
input   nfa_initials_buckets_rsp_empty_n;
output   nfa_initials_buckets_rsp_read;
output  [31:0] nfa_initials_buckets_address;
input  [63:0] nfa_initials_buckets_datain;
output  [63:0] nfa_initials_buckets_dataout;
output  [31:0] nfa_initials_buckets_size;
output   nfa_finals_buckets_req_din;
input   nfa_finals_buckets_req_full_n;
output   nfa_finals_buckets_req_write;
input   nfa_finals_buckets_rsp_empty_n;
output   nfa_finals_buckets_rsp_read;
output  [31:0] nfa_finals_buckets_address;
input  [63:0] nfa_finals_buckets_datain;
output  [63:0] nfa_finals_buckets_dataout;
output  [31:0] nfa_finals_buckets_size;
output   nfa_forward_buckets_req_din;
input   nfa_forward_buckets_req_full_n;
output   nfa_forward_buckets_req_write;
input   nfa_forward_buckets_rsp_empty_n;
output   nfa_forward_buckets_rsp_read;
output  [31:0] nfa_forward_buckets_address;
input  [31:0] nfa_forward_buckets_datain;
output  [31:0] nfa_forward_buckets_dataout;
output  [31:0] nfa_forward_buckets_size;
input  [7:0] nfa_symbols;
output   sample_buffer_req_din;
input   sample_buffer_req_full_n;
output   sample_buffer_req_write;
input   sample_buffer_rsp_empty_n;
output   sample_buffer_rsp_read;
output  [31:0] sample_buffer_address;
input  [7:0] sample_buffer_datain;
output  [7:0] sample_buffer_dataout;
output  [31:0] sample_buffer_size;
input  [31:0] sample_buffer_length;
input  [15:0] sample_length;
output   indices_req_din;
input   indices_req_full_n;
output   indices_req_write;
input   indices_rsp_empty_n;
output   indices_rsp_read;
output  [31:0] indices_address;
input  [55:0] indices_datain;
output  [55:0] indices_dataout;
output  [31:0] indices_size;
input  [15:0] i_size;
input  [15:0] begin_index;
input  [15:0] begin_sample;
input  [15:0] end_index;
input  [15:0] end_sample;
input  [0:0] stop_on_first;
input  [0:0] accept;
output  [31:0] ap_return;

reg ap_done;
reg ap_idle;
reg ap_ready;
reg indices_req_din;
reg indices_req_write;
reg indices_rsp_read;
reg[31:0] indices_address;
reg[55:0] indices_dataout;
reg[31:0] indices_size;
reg   [3:0] ap_CS_fsm = 4'b0000;
wire   [4:0] units_fu_334_p2;
reg   [4:0] units_reg_499;
reg   [15:0] i_index_load_reg_504;
wire   [0:0] tmp_3_fu_326_p3;
reg   [15:0] i_sample_load_reg_510;
wire   [0:0] finished_3_fu_358_p2;
wire   [0:0] grp_nfa_accept_sample_multi_fu_268_ap_return;
reg   [0:0] stop_on_first_meet_reg_521;
wire    grp_nfa_accept_sample_multi_fu_268_ap_done;
wire   [4:0] k_2_fu_398_p2;
reg   [4:0] k_2_reg_532;
wire   [0:0] exitcond_fu_392_p2;
wire   [15:0] tmp_5_fu_412_p3;
reg   [0:0] finished_2_reg_233;
reg   [3:0] result_address0;
reg    result_ce0;
reg    result_we0;
wire   [0:0] result_d0;
wire   [0:0] result_q0;
reg   [3:0] start_indices_address0;
reg    start_indices_ce0;
reg    start_indices_we0;
wire   [31:0] start_indices_d0;
wire   [31:0] start_indices_q0;
wire    grp_nfa_accept_sample_multi_fu_268_ap_start;
wire    grp_nfa_accept_sample_multi_fu_268_ap_idle;
wire    grp_nfa_accept_sample_multi_fu_268_ap_ready;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_req_din;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_req_full_n;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_req_write;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_rsp_empty_n;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_rsp_read;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_address;
wire   [63:0] grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_datain;
wire   [63:0] grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_dataout;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_size;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_req_din;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_req_full_n;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_req_write;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_rsp_empty_n;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_rsp_read;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_address;
wire   [63:0] grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_datain;
wire   [63:0] grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_dataout;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_size;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_req_din;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_req_full_n;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_req_write;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_rsp_empty_n;
wire    grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_rsp_read;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_address;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_datain;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_dataout;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_size;
wire   [7:0] grp_nfa_accept_sample_multi_fu_268_nfa_symbols;
wire    grp_nfa_accept_sample_multi_fu_268_sample_req_din;
wire    grp_nfa_accept_sample_multi_fu_268_sample_req_full_n;
wire    grp_nfa_accept_sample_multi_fu_268_sample_req_write;
wire    grp_nfa_accept_sample_multi_fu_268_sample_rsp_empty_n;
wire    grp_nfa_accept_sample_multi_fu_268_sample_rsp_read;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_sample_address;
wire   [7:0] grp_nfa_accept_sample_multi_fu_268_sample_datain;
wire   [7:0] grp_nfa_accept_sample_multi_fu_268_sample_dataout;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_sample_size;
wire   [15:0] grp_nfa_accept_sample_multi_fu_268_length_r;
wire   [3:0] grp_nfa_accept_sample_multi_fu_268_start_indices_address0;
wire    grp_nfa_accept_sample_multi_fu_268_start_indices_ce0;
wire   [31:0] grp_nfa_accept_sample_multi_fu_268_start_indices_q0;
wire   [0:0] grp_nfa_accept_sample_multi_fu_268_stop_on_first;
wire   [0:0] grp_nfa_accept_sample_multi_fu_268_accept;
wire   [4:0] grp_nfa_accept_sample_multi_fu_268_units;
wire   [3:0] grp_nfa_accept_sample_multi_fu_268_result_address0;
wire    grp_nfa_accept_sample_multi_fu_268_result_ce0;
wire    grp_nfa_accept_sample_multi_fu_268_result_we0;
wire   [0:0] grp_nfa_accept_sample_multi_fu_268_result_d0;
wire   [0:0] grp_nfa_accept_sample_multi_fu_268_result_q0;
wire    grp_sample_iterator_next_fu_289_ap_start;
wire    grp_sample_iterator_next_fu_289_ap_done;
wire    grp_sample_iterator_next_fu_289_ap_idle;
wire    grp_sample_iterator_next_fu_289_ap_ready;
wire    grp_sample_iterator_next_fu_289_indices_req_din;
wire    grp_sample_iterator_next_fu_289_indices_req_full_n;
wire    grp_sample_iterator_next_fu_289_indices_req_write;
wire    grp_sample_iterator_next_fu_289_indices_rsp_empty_n;
wire    grp_sample_iterator_next_fu_289_indices_rsp_read;
wire   [31:0] grp_sample_iterator_next_fu_289_indices_address;
wire   [55:0] grp_sample_iterator_next_fu_289_indices_datain;
wire   [55:0] grp_sample_iterator_next_fu_289_indices_dataout;
wire   [31:0] grp_sample_iterator_next_fu_289_indices_size;
wire   [15:0] grp_sample_iterator_next_fu_289_i_index;
wire   [15:0] grp_sample_iterator_next_fu_289_i_sample;
wire   [15:0] grp_sample_iterator_next_fu_289_ap_return_0;
wire   [15:0] grp_sample_iterator_next_fu_289_ap_return_1;
wire    grp_sample_iterator_get_offset_fu_297_ap_start;
wire    grp_sample_iterator_get_offset_fu_297_ap_done;
wire    grp_sample_iterator_get_offset_fu_297_ap_idle;
wire    grp_sample_iterator_get_offset_fu_297_ap_ready;
wire   [15:0] grp_sample_iterator_get_offset_fu_297_i_index;
wire   [15:0] grp_sample_iterator_get_offset_fu_297_i_sample;
wire    grp_sample_iterator_get_offset_fu_297_indices_req_din;
wire    grp_sample_iterator_get_offset_fu_297_indices_req_full_n;
wire    grp_sample_iterator_get_offset_fu_297_indices_req_write;
wire    grp_sample_iterator_get_offset_fu_297_indices_rsp_empty_n;
wire    grp_sample_iterator_get_offset_fu_297_indices_rsp_read;
wire   [31:0] grp_sample_iterator_get_offset_fu_297_indices_address;
wire   [55:0] grp_sample_iterator_get_offset_fu_297_indices_datain;
wire   [55:0] grp_sample_iterator_get_offset_fu_297_indices_dataout;
wire   [31:0] grp_sample_iterator_get_offset_fu_297_indices_size;
wire   [31:0] grp_sample_iterator_get_offset_fu_297_sample_buffer_size;
wire   [15:0] grp_sample_iterator_get_offset_fu_297_sample_length;
wire   [31:0] grp_sample_iterator_get_offset_fu_297_ap_return;
reg   [0:0] finished_reg_196;
reg   [4:0] indvars_iv_reg_208;
reg   [0:0] finished_1_reg_220;
reg   [4:0] k_1_reg_245;
wire   [0:0] brmerge_demorgan_fu_387_p2;
reg   [15:0] p_0_reg_256;
reg    grp_nfa_accept_sample_multi_fu_268_ap_start_ap_start_reg = 1'b0;
reg    grp_sample_iterator_next_fu_289_ap_start_ap_start_reg = 1'b0;
reg    grp_sample_iterator_get_offset_fu_297_ap_start_ap_start_reg = 1'b0;
wire   [63:0] tmp_1_fu_364_p1;
wire   [63:0] tmp_2_fu_404_p1;
reg   [15:0] c_fu_106;
wire   [15:0] p_c_1_fu_425_p3;
reg   [15:0] i_index_fu_110;
reg   [15:0] i_sample_fu_114;
wire   [0:0] tmp_i_fu_348_p2;
wire   [0:0] tmp_i_16_fu_353_p2;
wire   [15:0] tmp_3_cast_fu_409_p1;
wire   [15:0] c_1_fu_419_p2;
reg   [3:0] ap_NS_fsm;
reg    ap_sig_bdd_287;


nfa_accept_samples_generic_hw_result #(
    .DataWidth( 1 ),
    .AddressRange( 16 ),
    .AddressWidth( 4 ))
result_U(
    .clk( ap_clk ),
    .reset( ap_rst ),
    .address0( result_address0 ),
    .ce0( result_ce0 ),
    .we0( result_we0 ),
    .d0( result_d0 ),
    .q0( result_q0 )
);

nfa_accept_samples_generic_hw_start_indices #(
    .DataWidth( 32 ),
    .AddressRange( 16 ),
    .AddressWidth( 4 ))
start_indices_U(
    .clk( ap_clk ),
    .reset( ap_rst ),
    .address0( start_indices_address0 ),
    .ce0( start_indices_ce0 ),
    .we0( start_indices_we0 ),
    .d0( start_indices_d0 ),
    .q0( start_indices_q0 )
);

nfa_accept_sample_multi grp_nfa_accept_sample_multi_fu_268(
    .ap_clk( ap_clk ),
    .ap_rst( ap_rst ),
    .ap_start( grp_nfa_accept_sample_multi_fu_268_ap_start ),
    .ap_done( grp_nfa_accept_sample_multi_fu_268_ap_done ),
    .ap_idle( grp_nfa_accept_sample_multi_fu_268_ap_idle ),
    .ap_ready( grp_nfa_accept_sample_multi_fu_268_ap_ready ),
    .nfa_initials_buckets_req_din( grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_req_din ),
    .nfa_initials_buckets_req_full_n( grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_req_full_n ),
    .nfa_initials_buckets_req_write( grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_req_write ),
    .nfa_initials_buckets_rsp_empty_n( grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_rsp_empty_n ),
    .nfa_initials_buckets_rsp_read( grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_rsp_read ),
    .nfa_initials_buckets_address( grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_address ),
    .nfa_initials_buckets_datain( grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_datain ),
    .nfa_initials_buckets_dataout( grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_dataout ),
    .nfa_initials_buckets_size( grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_size ),
    .nfa_finals_buckets_req_din( grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_req_din ),
    .nfa_finals_buckets_req_full_n( grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_req_full_n ),
    .nfa_finals_buckets_req_write( grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_req_write ),
    .nfa_finals_buckets_rsp_empty_n( grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_rsp_empty_n ),
    .nfa_finals_buckets_rsp_read( grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_rsp_read ),
    .nfa_finals_buckets_address( grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_address ),
    .nfa_finals_buckets_datain( grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_datain ),
    .nfa_finals_buckets_dataout( grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_dataout ),
    .nfa_finals_buckets_size( grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_size ),
    .nfa_forward_buckets_req_din( grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_req_din ),
    .nfa_forward_buckets_req_full_n( grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_req_full_n ),
    .nfa_forward_buckets_req_write( grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_req_write ),
    .nfa_forward_buckets_rsp_empty_n( grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_rsp_empty_n ),
    .nfa_forward_buckets_rsp_read( grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_rsp_read ),
    .nfa_forward_buckets_address( grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_address ),
    .nfa_forward_buckets_datain( grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_datain ),
    .nfa_forward_buckets_dataout( grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_dataout ),
    .nfa_forward_buckets_size( grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_size ),
    .nfa_symbols( grp_nfa_accept_sample_multi_fu_268_nfa_symbols ),
    .sample_req_din( grp_nfa_accept_sample_multi_fu_268_sample_req_din ),
    .sample_req_full_n( grp_nfa_accept_sample_multi_fu_268_sample_req_full_n ),
    .sample_req_write( grp_nfa_accept_sample_multi_fu_268_sample_req_write ),
    .sample_rsp_empty_n( grp_nfa_accept_sample_multi_fu_268_sample_rsp_empty_n ),
    .sample_rsp_read( grp_nfa_accept_sample_multi_fu_268_sample_rsp_read ),
    .sample_address( grp_nfa_accept_sample_multi_fu_268_sample_address ),
    .sample_datain( grp_nfa_accept_sample_multi_fu_268_sample_datain ),
    .sample_dataout( grp_nfa_accept_sample_multi_fu_268_sample_dataout ),
    .sample_size( grp_nfa_accept_sample_multi_fu_268_sample_size ),
    .length_r( grp_nfa_accept_sample_multi_fu_268_length_r ),
    .start_indices_address0( grp_nfa_accept_sample_multi_fu_268_start_indices_address0 ),
    .start_indices_ce0( grp_nfa_accept_sample_multi_fu_268_start_indices_ce0 ),
    .start_indices_q0( grp_nfa_accept_sample_multi_fu_268_start_indices_q0 ),
    .stop_on_first( grp_nfa_accept_sample_multi_fu_268_stop_on_first ),
    .accept( grp_nfa_accept_sample_multi_fu_268_accept ),
    .units( grp_nfa_accept_sample_multi_fu_268_units ),
    .result_address0( grp_nfa_accept_sample_multi_fu_268_result_address0 ),
    .result_ce0( grp_nfa_accept_sample_multi_fu_268_result_ce0 ),
    .result_we0( grp_nfa_accept_sample_multi_fu_268_result_we0 ),
    .result_d0( grp_nfa_accept_sample_multi_fu_268_result_d0 ),
    .result_q0( grp_nfa_accept_sample_multi_fu_268_result_q0 ),
    .ap_return( grp_nfa_accept_sample_multi_fu_268_ap_return )
);

sample_iterator_next grp_sample_iterator_next_fu_289(
    .ap_clk( ap_clk ),
    .ap_rst( ap_rst ),
    .ap_start( grp_sample_iterator_next_fu_289_ap_start ),
    .ap_done( grp_sample_iterator_next_fu_289_ap_done ),
    .ap_idle( grp_sample_iterator_next_fu_289_ap_idle ),
    .ap_ready( grp_sample_iterator_next_fu_289_ap_ready ),
    .indices_req_din( grp_sample_iterator_next_fu_289_indices_req_din ),
    .indices_req_full_n( grp_sample_iterator_next_fu_289_indices_req_full_n ),
    .indices_req_write( grp_sample_iterator_next_fu_289_indices_req_write ),
    .indices_rsp_empty_n( grp_sample_iterator_next_fu_289_indices_rsp_empty_n ),
    .indices_rsp_read( grp_sample_iterator_next_fu_289_indices_rsp_read ),
    .indices_address( grp_sample_iterator_next_fu_289_indices_address ),
    .indices_datain( grp_sample_iterator_next_fu_289_indices_datain ),
    .indices_dataout( grp_sample_iterator_next_fu_289_indices_dataout ),
    .indices_size( grp_sample_iterator_next_fu_289_indices_size ),
    .i_index( grp_sample_iterator_next_fu_289_i_index ),
    .i_sample( grp_sample_iterator_next_fu_289_i_sample ),
    .ap_return_0( grp_sample_iterator_next_fu_289_ap_return_0 ),
    .ap_return_1( grp_sample_iterator_next_fu_289_ap_return_1 )
);

sample_iterator_get_offset grp_sample_iterator_get_offset_fu_297(
    .ap_clk( ap_clk ),
    .ap_rst( ap_rst ),
    .ap_start( grp_sample_iterator_get_offset_fu_297_ap_start ),
    .ap_done( grp_sample_iterator_get_offset_fu_297_ap_done ),
    .ap_idle( grp_sample_iterator_get_offset_fu_297_ap_idle ),
    .ap_ready( grp_sample_iterator_get_offset_fu_297_ap_ready ),
    .i_index( grp_sample_iterator_get_offset_fu_297_i_index ),
    .i_sample( grp_sample_iterator_get_offset_fu_297_i_sample ),
    .indices_req_din( grp_sample_iterator_get_offset_fu_297_indices_req_din ),
    .indices_req_full_n( grp_sample_iterator_get_offset_fu_297_indices_req_full_n ),
    .indices_req_write( grp_sample_iterator_get_offset_fu_297_indices_req_write ),
    .indices_rsp_empty_n( grp_sample_iterator_get_offset_fu_297_indices_rsp_empty_n ),
    .indices_rsp_read( grp_sample_iterator_get_offset_fu_297_indices_rsp_read ),
    .indices_address( grp_sample_iterator_get_offset_fu_297_indices_address ),
    .indices_datain( grp_sample_iterator_get_offset_fu_297_indices_datain ),
    .indices_dataout( grp_sample_iterator_get_offset_fu_297_indices_dataout ),
    .indices_size( grp_sample_iterator_get_offset_fu_297_indices_size ),
    .sample_buffer_size( grp_sample_iterator_get_offset_fu_297_sample_buffer_size ),
    .sample_length( grp_sample_iterator_get_offset_fu_297_sample_length ),
    .ap_return( grp_sample_iterator_get_offset_fu_297_ap_return )
);



/// the current state (ap_CS_fsm) of the state machine. ///
always @ (posedge ap_clk)
begin : ap_ret_ap_CS_fsm
    if (ap_rst == 1'b1) begin
        ap_CS_fsm <= ap_ST_st1_fsm_0;
    end else begin
        ap_CS_fsm <= ap_NS_fsm;
    end
end

/// grp_nfa_accept_sample_multi_fu_268_ap_start_ap_start_reg assign process. ///
always @ (posedge ap_clk)
begin : ap_ret_grp_nfa_accept_sample_multi_fu_268_ap_start_ap_start_reg
    if (ap_rst == 1'b1) begin
        grp_nfa_accept_sample_multi_fu_268_ap_start_ap_start_reg <= ap_const_logic_0;
    end else begin
        if (((ap_ST_st3_fsm_2 == ap_CS_fsm) & (~(tmp_3_fu_326_p3 == ap_const_lv1_0) | ~(ap_const_lv1_0 == finished_3_fu_358_p2)))) begin
            grp_nfa_accept_sample_multi_fu_268_ap_start_ap_start_reg <= ap_const_logic_1;
        end else if ((ap_const_logic_1 == grp_nfa_accept_sample_multi_fu_268_ap_ready)) begin
            grp_nfa_accept_sample_multi_fu_268_ap_start_ap_start_reg <= ap_const_logic_0;
        end
    end
end

/// grp_sample_iterator_get_offset_fu_297_ap_start_ap_start_reg assign process. ///
always @ (posedge ap_clk)
begin : ap_ret_grp_sample_iterator_get_offset_fu_297_ap_start_ap_start_reg
    if (ap_rst == 1'b1) begin
        grp_sample_iterator_get_offset_fu_297_ap_start_ap_start_reg <= ap_const_logic_0;
    end else begin
        if (((ap_ST_st3_fsm_2 == ap_CS_fsm) & (tmp_3_fu_326_p3 == ap_const_lv1_0) & (ap_const_lv1_0 == finished_3_fu_358_p2))) begin
            grp_sample_iterator_get_offset_fu_297_ap_start_ap_start_reg <= ap_const_logic_1;
        end else if ((ap_const_logic_1 == grp_sample_iterator_get_offset_fu_297_ap_ready)) begin
            grp_sample_iterator_get_offset_fu_297_ap_start_ap_start_reg <= ap_const_logic_0;
        end
    end
end

/// grp_sample_iterator_next_fu_289_ap_start_ap_start_reg assign process. ///
always @ (posedge ap_clk)
begin : ap_ret_grp_sample_iterator_next_fu_289_ap_start_ap_start_reg
    if (ap_rst == 1'b1) begin
        grp_sample_iterator_next_fu_289_ap_start_ap_start_reg <= ap_const_logic_0;
    end else begin
        if ((ap_ST_st5_fsm_4 == ap_CS_fsm)) begin
            grp_sample_iterator_next_fu_289_ap_start_ap_start_reg <= ap_const_logic_1;
        end else if ((ap_const_logic_1 == grp_sample_iterator_next_fu_289_ap_ready)) begin
            grp_sample_iterator_next_fu_289_ap_start_ap_start_reg <= ap_const_logic_0;
        end
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if ((ap_ST_st9_fsm_8 == ap_CS_fsm)) begin
        c_fu_106 <= p_c_1_fu_425_p3;
    end else if (((ap_ST_st1_fsm_0 == ap_CS_fsm) & ~(ap_start == ap_const_logic_0))) begin
        c_fu_106 <= ap_const_lv16_0;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if (((ap_ST_st6_fsm_5 == ap_CS_fsm) & ~(ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_done))) begin
        finished_1_reg_220 <= ap_const_lv1_0;
    end else if ((ap_ST_st2_fsm_1 == ap_CS_fsm)) begin
        finished_1_reg_220 <= finished_reg_196;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if ((ap_ST_st3_fsm_2 == ap_CS_fsm)) begin
        if (ap_sig_bdd_287) begin
            finished_2_reg_233 <= finished_3_fu_358_p2;
        end else if (~(tmp_3_fu_326_p3 == ap_const_lv1_0)) begin
            finished_2_reg_233 <= finished_1_reg_220;
        end
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if (((ap_ST_st8_fsm_7 == ap_CS_fsm) & ~(ap_const_lv1_0 == exitcond_fu_392_p2) & (ap_const_lv1_0 == finished_2_reg_233))) begin
        finished_reg_196 <= finished_2_reg_233;
    end else if (((ap_ST_st1_fsm_0 == ap_CS_fsm) & ~(ap_start == ap_const_logic_0))) begin
        finished_reg_196 <= ap_const_lv1_0;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if (((ap_ST_st6_fsm_5 == ap_CS_fsm) & ~(ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_done))) begin
        i_index_fu_110 <= grp_sample_iterator_next_fu_289_ap_return_0;
    end else if (((ap_ST_st1_fsm_0 == ap_CS_fsm) & ~(ap_start == ap_const_logic_0))) begin
        i_index_fu_110 <= begin_index;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if (((ap_ST_st6_fsm_5 == ap_CS_fsm) & ~(ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_done))) begin
        i_sample_fu_114 <= grp_sample_iterator_next_fu_289_ap_return_1;
    end else if (((ap_ST_st1_fsm_0 == ap_CS_fsm) & ~(ap_start == ap_const_logic_0))) begin
        i_sample_fu_114 <= begin_sample;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if (((ap_ST_st6_fsm_5 == ap_CS_fsm) & ~(ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_done))) begin
        indvars_iv_reg_208 <= units_reg_499;
    end else if ((ap_ST_st2_fsm_1 == ap_CS_fsm)) begin
        indvars_iv_reg_208 <= ap_const_lv5_0;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if (((ap_ST_st7_fsm_6 == ap_CS_fsm) & ~(ap_const_logic_0 == grp_nfa_accept_sample_multi_fu_268_ap_done) & (ap_const_lv1_0 == brmerge_demorgan_fu_387_p2))) begin
        k_1_reg_245 <= ap_const_lv5_0;
    end else if ((ap_ST_st9_fsm_8 == ap_CS_fsm)) begin
        k_1_reg_245 <= k_2_reg_532;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if (((ap_ST_st7_fsm_6 == ap_CS_fsm) & ~(ap_const_logic_0 == grp_nfa_accept_sample_multi_fu_268_ap_done) & ~(ap_const_lv1_0 == brmerge_demorgan_fu_387_p2))) begin
        p_0_reg_256 <= ap_const_lv16_1;
    end else if (((ap_ST_st8_fsm_7 == ap_CS_fsm) & ~(ap_const_lv1_0 == exitcond_fu_392_p2) & ~(ap_const_lv1_0 == finished_2_reg_233))) begin
        p_0_reg_256 <= tmp_5_fu_412_p3;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if (((ap_ST_st3_fsm_2 == ap_CS_fsm) & (tmp_3_fu_326_p3 == ap_const_lv1_0))) begin
        i_index_load_reg_504 <= i_index_fu_110;
        i_sample_load_reg_510 <= i_sample_fu_114;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if ((ap_ST_st8_fsm_7 == ap_CS_fsm)) begin
        k_2_reg_532 <= k_2_fu_398_p2;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if (((ap_ST_st7_fsm_6 == ap_CS_fsm) & ~(ap_const_logic_0 == grp_nfa_accept_sample_multi_fu_268_ap_done))) begin
        stop_on_first_meet_reg_521 <= grp_nfa_accept_sample_multi_fu_268_ap_return;
    end
end

/// assign process. ///
always @(posedge ap_clk)
begin
    if ((ap_ST_st3_fsm_2 == ap_CS_fsm)) begin
        units_reg_499 <= units_fu_334_p2;
    end
end

/// ap_done assign process. ///
always @ (ap_CS_fsm)
begin
    if ((ap_ST_st10_fsm_9 == ap_CS_fsm)) begin
        ap_done = ap_const_logic_1;
    end else begin
        ap_done = ap_const_logic_0;
    end
end

/// ap_idle assign process. ///
always @ (ap_start or ap_CS_fsm)
begin
    if ((~(ap_const_logic_1 == ap_start) & (ap_ST_st1_fsm_0 == ap_CS_fsm))) begin
        ap_idle = ap_const_logic_1;
    end else begin
        ap_idle = ap_const_logic_0;
    end
end

/// ap_ready assign process. ///
always @ (ap_CS_fsm)
begin
    if ((ap_ST_st10_fsm_9 == ap_CS_fsm)) begin
        ap_ready = ap_const_logic_1;
    end else begin
        ap_ready = ap_const_logic_0;
    end
end

/// indices_address assign process. ///
always @ (ap_CS_fsm or tmp_3_fu_326_p3 or finished_3_fu_358_p2 or grp_sample_iterator_next_fu_289_ap_idle or grp_sample_iterator_next_fu_289_indices_address or grp_sample_iterator_get_offset_fu_297_ap_idle or grp_sample_iterator_get_offset_fu_297_indices_address)
begin
    if ((((ap_ST_st3_fsm_2 == ap_CS_fsm) & (tmp_3_fu_326_p3 == ap_const_lv1_0) & (ap_const_lv1_0 == finished_3_fu_358_p2)) | ((ap_ST_st4_fsm_3 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_get_offset_fu_297_ap_idle)))) begin
        indices_address = grp_sample_iterator_get_offset_fu_297_indices_address;
    end else if (((ap_ST_st5_fsm_4 == ap_CS_fsm) | ((ap_ST_st6_fsm_5 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_idle)))) begin
        indices_address = grp_sample_iterator_next_fu_289_indices_address;
    end else begin
        indices_address = 'bx;
    end
end

/// indices_dataout assign process. ///
always @ (ap_CS_fsm or tmp_3_fu_326_p3 or finished_3_fu_358_p2 or grp_sample_iterator_next_fu_289_ap_idle or grp_sample_iterator_next_fu_289_indices_dataout or grp_sample_iterator_get_offset_fu_297_ap_idle or grp_sample_iterator_get_offset_fu_297_indices_dataout)
begin
    if ((((ap_ST_st3_fsm_2 == ap_CS_fsm) & (tmp_3_fu_326_p3 == ap_const_lv1_0) & (ap_const_lv1_0 == finished_3_fu_358_p2)) | ((ap_ST_st4_fsm_3 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_get_offset_fu_297_ap_idle)))) begin
        indices_dataout = grp_sample_iterator_get_offset_fu_297_indices_dataout;
    end else if (((ap_ST_st5_fsm_4 == ap_CS_fsm) | ((ap_ST_st6_fsm_5 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_idle)))) begin
        indices_dataout = grp_sample_iterator_next_fu_289_indices_dataout;
    end else begin
        indices_dataout = 'bx;
    end
end

/// indices_req_din assign process. ///
always @ (ap_CS_fsm or tmp_3_fu_326_p3 or finished_3_fu_358_p2 or grp_sample_iterator_next_fu_289_ap_idle or grp_sample_iterator_next_fu_289_indices_req_din or grp_sample_iterator_get_offset_fu_297_ap_idle or grp_sample_iterator_get_offset_fu_297_indices_req_din)
begin
    if ((((ap_ST_st3_fsm_2 == ap_CS_fsm) & (tmp_3_fu_326_p3 == ap_const_lv1_0) & (ap_const_lv1_0 == finished_3_fu_358_p2)) | ((ap_ST_st4_fsm_3 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_get_offset_fu_297_ap_idle)))) begin
        indices_req_din = grp_sample_iterator_get_offset_fu_297_indices_req_din;
    end else if (((ap_ST_st5_fsm_4 == ap_CS_fsm) | ((ap_ST_st6_fsm_5 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_idle)))) begin
        indices_req_din = grp_sample_iterator_next_fu_289_indices_req_din;
    end else begin
        indices_req_din = 'bx;
    end
end

/// indices_req_write assign process. ///
always @ (ap_CS_fsm or tmp_3_fu_326_p3 or finished_3_fu_358_p2 or grp_sample_iterator_next_fu_289_ap_idle or grp_sample_iterator_next_fu_289_indices_req_write or grp_sample_iterator_get_offset_fu_297_ap_idle or grp_sample_iterator_get_offset_fu_297_indices_req_write)
begin
    if ((((ap_ST_st3_fsm_2 == ap_CS_fsm) & (tmp_3_fu_326_p3 == ap_const_lv1_0) & (ap_const_lv1_0 == finished_3_fu_358_p2)) | ((ap_ST_st4_fsm_3 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_get_offset_fu_297_ap_idle)))) begin
        indices_req_write = grp_sample_iterator_get_offset_fu_297_indices_req_write;
    end else if (((ap_ST_st5_fsm_4 == ap_CS_fsm) | ((ap_ST_st6_fsm_5 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_idle)))) begin
        indices_req_write = grp_sample_iterator_next_fu_289_indices_req_write;
    end else begin
        indices_req_write = 'bx;
    end
end

/// indices_rsp_read assign process. ///
always @ (ap_CS_fsm or tmp_3_fu_326_p3 or finished_3_fu_358_p2 or grp_sample_iterator_next_fu_289_ap_idle or grp_sample_iterator_next_fu_289_indices_rsp_read or grp_sample_iterator_get_offset_fu_297_ap_idle or grp_sample_iterator_get_offset_fu_297_indices_rsp_read)
begin
    if ((((ap_ST_st3_fsm_2 == ap_CS_fsm) & (tmp_3_fu_326_p3 == ap_const_lv1_0) & (ap_const_lv1_0 == finished_3_fu_358_p2)) | ((ap_ST_st4_fsm_3 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_get_offset_fu_297_ap_idle)))) begin
        indices_rsp_read = grp_sample_iterator_get_offset_fu_297_indices_rsp_read;
    end else if (((ap_ST_st5_fsm_4 == ap_CS_fsm) | ((ap_ST_st6_fsm_5 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_idle)))) begin
        indices_rsp_read = grp_sample_iterator_next_fu_289_indices_rsp_read;
    end else begin
        indices_rsp_read = 'bx;
    end
end

/// indices_size assign process. ///
always @ (ap_CS_fsm or tmp_3_fu_326_p3 or finished_3_fu_358_p2 or grp_sample_iterator_next_fu_289_ap_idle or grp_sample_iterator_next_fu_289_indices_size or grp_sample_iterator_get_offset_fu_297_ap_idle or grp_sample_iterator_get_offset_fu_297_indices_size)
begin
    if ((((ap_ST_st3_fsm_2 == ap_CS_fsm) & (tmp_3_fu_326_p3 == ap_const_lv1_0) & (ap_const_lv1_0 == finished_3_fu_358_p2)) | ((ap_ST_st4_fsm_3 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_get_offset_fu_297_ap_idle)))) begin
        indices_size = grp_sample_iterator_get_offset_fu_297_indices_size;
    end else if (((ap_ST_st5_fsm_4 == ap_CS_fsm) | ((ap_ST_st6_fsm_5 == ap_CS_fsm) & (ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_idle)))) begin
        indices_size = grp_sample_iterator_next_fu_289_indices_size;
    end else begin
        indices_size = 'bx;
    end
end

/// result_address0 assign process. ///
always @ (ap_CS_fsm or grp_nfa_accept_sample_multi_fu_268_result_address0 or tmp_2_fu_404_p1)
begin
    if ((ap_ST_st8_fsm_7 == ap_CS_fsm)) begin
        result_address0 = tmp_2_fu_404_p1;
    end else if ((ap_ST_st7_fsm_6 == ap_CS_fsm)) begin
        result_address0 = grp_nfa_accept_sample_multi_fu_268_result_address0;
    end else begin
        result_address0 = 'bx;
    end
end

/// result_ce0 assign process. ///
always @ (ap_CS_fsm or grp_nfa_accept_sample_multi_fu_268_result_ce0)
begin
    if ((ap_ST_st8_fsm_7 == ap_CS_fsm)) begin
        result_ce0 = ap_const_logic_1;
    end else if ((ap_ST_st7_fsm_6 == ap_CS_fsm)) begin
        result_ce0 = grp_nfa_accept_sample_multi_fu_268_result_ce0;
    end else begin
        result_ce0 = ap_const_logic_0;
    end
end

/// result_we0 assign process. ///
always @ (ap_CS_fsm or grp_nfa_accept_sample_multi_fu_268_result_we0)
begin
    if ((ap_ST_st7_fsm_6 == ap_CS_fsm)) begin
        result_we0 = grp_nfa_accept_sample_multi_fu_268_result_we0;
    end else begin
        result_we0 = ap_const_logic_0;
    end
end

/// start_indices_address0 assign process. ///
always @ (ap_CS_fsm or grp_nfa_accept_sample_multi_fu_268_start_indices_address0 or tmp_1_fu_364_p1)
begin
    if ((ap_ST_st4_fsm_3 == ap_CS_fsm)) begin
        start_indices_address0 = tmp_1_fu_364_p1;
    end else if ((ap_ST_st7_fsm_6 == ap_CS_fsm)) begin
        start_indices_address0 = grp_nfa_accept_sample_multi_fu_268_start_indices_address0;
    end else begin
        start_indices_address0 = 'bx;
    end
end

/// start_indices_ce0 assign process. ///
always @ (ap_CS_fsm or grp_nfa_accept_sample_multi_fu_268_start_indices_ce0 or grp_sample_iterator_get_offset_fu_297_ap_done)
begin
    if (((ap_ST_st4_fsm_3 == ap_CS_fsm) & ~(ap_const_logic_0 == grp_sample_iterator_get_offset_fu_297_ap_done))) begin
        start_indices_ce0 = ap_const_logic_1;
    end else if ((ap_ST_st7_fsm_6 == ap_CS_fsm)) begin
        start_indices_ce0 = grp_nfa_accept_sample_multi_fu_268_start_indices_ce0;
    end else begin
        start_indices_ce0 = ap_const_logic_0;
    end
end

/// start_indices_we0 assign process. ///
always @ (ap_CS_fsm or grp_sample_iterator_get_offset_fu_297_ap_done)
begin
    if (((ap_ST_st4_fsm_3 == ap_CS_fsm) & ~(ap_const_logic_0 == grp_sample_iterator_get_offset_fu_297_ap_done))) begin
        start_indices_we0 = ap_const_logic_1;
    end else begin
        start_indices_we0 = ap_const_logic_0;
    end
end
always @ (ap_start or ap_CS_fsm or tmp_3_fu_326_p3 or finished_3_fu_358_p2 or grp_nfa_accept_sample_multi_fu_268_ap_done or exitcond_fu_392_p2 or finished_2_reg_233 or grp_sample_iterator_next_fu_289_ap_done or grp_sample_iterator_get_offset_fu_297_ap_done or brmerge_demorgan_fu_387_p2)
begin
    case (ap_CS_fsm)
        ap_ST_st1_fsm_0 : 
            if (~(ap_start == ap_const_logic_0)) begin
                ap_NS_fsm = ap_ST_st2_fsm_1;
            end else begin
                ap_NS_fsm = ap_ST_st1_fsm_0;
            end
        ap_ST_st2_fsm_1 : 
            ap_NS_fsm = ap_ST_st3_fsm_2;
        ap_ST_st3_fsm_2 : 
            if (((tmp_3_fu_326_p3 == ap_const_lv1_0) & (ap_const_lv1_0 == finished_3_fu_358_p2))) begin
                ap_NS_fsm = ap_ST_st4_fsm_3;
            end else begin
                ap_NS_fsm = ap_ST_st7_fsm_6;
            end
        ap_ST_st4_fsm_3 : 
            if (~(ap_const_logic_0 == grp_sample_iterator_get_offset_fu_297_ap_done)) begin
                ap_NS_fsm = ap_ST_st5_fsm_4;
            end else begin
                ap_NS_fsm = ap_ST_st4_fsm_3;
            end
        ap_ST_st5_fsm_4 : 
            ap_NS_fsm = ap_ST_st6_fsm_5;
        ap_ST_st6_fsm_5 : 
            if (~(ap_const_logic_0 == grp_sample_iterator_next_fu_289_ap_done)) begin
                ap_NS_fsm = ap_ST_st3_fsm_2;
            end else begin
                ap_NS_fsm = ap_ST_st6_fsm_5;
            end
        ap_ST_st7_fsm_6 : 
            if ((~(ap_const_logic_0 == grp_nfa_accept_sample_multi_fu_268_ap_done) & ~(ap_const_lv1_0 == brmerge_demorgan_fu_387_p2))) begin
                ap_NS_fsm = ap_ST_st10_fsm_9;
            end else if ((~(ap_const_logic_0 == grp_nfa_accept_sample_multi_fu_268_ap_done) & (ap_const_lv1_0 == brmerge_demorgan_fu_387_p2))) begin
                ap_NS_fsm = ap_ST_st8_fsm_7;
            end else begin
                ap_NS_fsm = ap_ST_st7_fsm_6;
            end
        ap_ST_st8_fsm_7 : 
            if ((~(ap_const_lv1_0 == exitcond_fu_392_p2) & ~(ap_const_lv1_0 == finished_2_reg_233))) begin
                ap_NS_fsm = ap_ST_st10_fsm_9;
            end else if ((~(ap_const_lv1_0 == exitcond_fu_392_p2) & (ap_const_lv1_0 == finished_2_reg_233))) begin
                ap_NS_fsm = ap_ST_st2_fsm_1;
            end else begin
                ap_NS_fsm = ap_ST_st9_fsm_8;
            end
        ap_ST_st9_fsm_8 : 
            ap_NS_fsm = ap_ST_st8_fsm_7;
        ap_ST_st10_fsm_9 : 
            ap_NS_fsm = ap_ST_st1_fsm_0;
        default : 
            ap_NS_fsm = 'bx;
    endcase
end
assign ap_return = $unsigned(p_0_reg_256);

/// ap_sig_bdd_287 assign process. ///
always @ (tmp_3_fu_326_p3 or finished_3_fu_358_p2)
begin
    ap_sig_bdd_287 = ((tmp_3_fu_326_p3 == ap_const_lv1_0) & ~(ap_const_lv1_0 == finished_3_fu_358_p2));
end
assign brmerge_demorgan_fu_387_p2 = (grp_nfa_accept_sample_multi_fu_268_ap_return & stop_on_first);
assign c_1_fu_419_p2 = (c_fu_106 + ap_const_lv16_1);
assign exitcond_fu_392_p2 = (k_1_reg_245 == indvars_iv_reg_208? 1'b1: 1'b0);
assign finished_3_fu_358_p2 = (tmp_i_fu_348_p2 & tmp_i_16_fu_353_p2);
assign grp_nfa_accept_sample_multi_fu_268_accept = accept;
assign grp_nfa_accept_sample_multi_fu_268_ap_start = grp_nfa_accept_sample_multi_fu_268_ap_start_ap_start_reg;
assign grp_nfa_accept_sample_multi_fu_268_length_r = sample_length;
assign grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_datain = nfa_finals_buckets_datain;
assign grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_req_full_n = nfa_finals_buckets_req_full_n;
assign grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_rsp_empty_n = nfa_finals_buckets_rsp_empty_n;
assign grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_datain = nfa_forward_buckets_datain;
assign grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_req_full_n = nfa_forward_buckets_req_full_n;
assign grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_rsp_empty_n = nfa_forward_buckets_rsp_empty_n;
assign grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_datain = nfa_initials_buckets_datain;
assign grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_req_full_n = nfa_initials_buckets_req_full_n;
assign grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_rsp_empty_n = nfa_initials_buckets_rsp_empty_n;
assign grp_nfa_accept_sample_multi_fu_268_nfa_symbols = nfa_symbols;
assign grp_nfa_accept_sample_multi_fu_268_result_q0 = result_q0;
assign grp_nfa_accept_sample_multi_fu_268_sample_datain = sample_buffer_datain;
assign grp_nfa_accept_sample_multi_fu_268_sample_req_full_n = sample_buffer_req_full_n;
assign grp_nfa_accept_sample_multi_fu_268_sample_rsp_empty_n = sample_buffer_rsp_empty_n;
assign grp_nfa_accept_sample_multi_fu_268_start_indices_q0 = start_indices_q0;
assign grp_nfa_accept_sample_multi_fu_268_stop_on_first = stop_on_first;
assign grp_nfa_accept_sample_multi_fu_268_units = indvars_iv_reg_208;
assign grp_sample_iterator_get_offset_fu_297_ap_start = grp_sample_iterator_get_offset_fu_297_ap_start_ap_start_reg;
assign grp_sample_iterator_get_offset_fu_297_i_index = i_index_load_reg_504;
assign grp_sample_iterator_get_offset_fu_297_i_sample = i_sample_load_reg_510;
assign grp_sample_iterator_get_offset_fu_297_indices_datain = indices_datain;
assign grp_sample_iterator_get_offset_fu_297_indices_req_full_n = indices_req_full_n;
assign grp_sample_iterator_get_offset_fu_297_indices_rsp_empty_n = indices_rsp_empty_n;
assign grp_sample_iterator_get_offset_fu_297_sample_buffer_size = sample_buffer_length;
assign grp_sample_iterator_get_offset_fu_297_sample_length = sample_length;
assign grp_sample_iterator_next_fu_289_ap_start = grp_sample_iterator_next_fu_289_ap_start_ap_start_reg;
assign grp_sample_iterator_next_fu_289_i_index = i_index_load_reg_504;
assign grp_sample_iterator_next_fu_289_i_sample = i_sample_load_reg_510;
assign grp_sample_iterator_next_fu_289_indices_datain = indices_datain;
assign grp_sample_iterator_next_fu_289_indices_req_full_n = indices_req_full_n;
assign grp_sample_iterator_next_fu_289_indices_rsp_empty_n = indices_rsp_empty_n;
assign k_2_fu_398_p2 = (k_1_reg_245 + ap_const_lv5_1);
assign nfa_finals_buckets_address = grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_address;
assign nfa_finals_buckets_dataout = grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_dataout;
assign nfa_finals_buckets_req_din = grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_req_din;
assign nfa_finals_buckets_req_write = grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_req_write;
assign nfa_finals_buckets_rsp_read = grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_rsp_read;
assign nfa_finals_buckets_size = grp_nfa_accept_sample_multi_fu_268_nfa_finals_buckets_size;
assign nfa_forward_buckets_address = grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_address;
assign nfa_forward_buckets_dataout = grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_dataout;
assign nfa_forward_buckets_req_din = grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_req_din;
assign nfa_forward_buckets_req_write = grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_req_write;
assign nfa_forward_buckets_rsp_read = grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_rsp_read;
assign nfa_forward_buckets_size = grp_nfa_accept_sample_multi_fu_268_nfa_forward_buckets_size;
assign nfa_initials_buckets_address = grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_address;
assign nfa_initials_buckets_dataout = grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_dataout;
assign nfa_initials_buckets_req_din = grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_req_din;
assign nfa_initials_buckets_req_write = grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_req_write;
assign nfa_initials_buckets_rsp_read = grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_rsp_read;
assign nfa_initials_buckets_size = grp_nfa_accept_sample_multi_fu_268_nfa_initials_buckets_size;
assign p_c_1_fu_425_p3 = ((result_q0)? c_1_fu_419_p2: c_fu_106);
assign result_d0 = grp_nfa_accept_sample_multi_fu_268_result_d0;
assign sample_buffer_address = grp_nfa_accept_sample_multi_fu_268_sample_address;
assign sample_buffer_dataout = grp_nfa_accept_sample_multi_fu_268_sample_dataout;
assign sample_buffer_req_din = grp_nfa_accept_sample_multi_fu_268_sample_req_din;
assign sample_buffer_req_write = grp_nfa_accept_sample_multi_fu_268_sample_req_write;
assign sample_buffer_rsp_read = grp_nfa_accept_sample_multi_fu_268_sample_rsp_read;
assign sample_buffer_size = grp_nfa_accept_sample_multi_fu_268_sample_size;
assign start_indices_d0 = grp_sample_iterator_get_offset_fu_297_ap_return;
assign tmp_1_fu_364_p1 = $unsigned(indvars_iv_reg_208);
assign tmp_2_fu_404_p1 = $unsigned(k_1_reg_245);
assign tmp_3_cast_fu_409_p1 = $unsigned(stop_on_first_meet_reg_521);
assign tmp_3_fu_326_p3 = indvars_iv_reg_208[ap_const_lv32_4];
assign tmp_5_fu_412_p3 = ((stop_on_first)? tmp_3_cast_fu_409_p1: c_fu_106);
assign tmp_i_16_fu_353_p2 = (i_index_fu_110 == end_index? 1'b1: 1'b0);
assign tmp_i_fu_348_p2 = (i_sample_fu_114 == end_sample? 1'b1: 1'b0);
assign units_fu_334_p2 = (indvars_iv_reg_208 + ap_const_lv5_1);


endmodule //nfa_accept_samples_generic_hw

