text: // ==============================================================
  // RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and OpenCL
  // Version: 2019.2
  // Copyright (C) 1986-2019 Xilinx, Inc. All Rights Reserved.
  // 
  // ===========================================================
  
  #include "write_row_ifm.h"
  #include "AESL_pkg.h"
  
  using namespace std;
  
  namespace ap_rtl {
  
  const sc_logic write_row_ifm::ap_const_logic_1 = sc_dt::Log_1;
  const sc_logic write_row_ifm::ap_const_logic_0 = sc_dt::Log_0;
  const sc_lv<3> write_row_ifm::ap_ST_fsm_state1 = "1";
  const sc_lv<3> write_row_ifm::ap_ST_fsm_state2 = "10";
  const sc_lv<3> write_row_ifm::ap_ST_fsm_state3 = "100";
  const sc_lv<32> write_row_ifm::ap_const_lv32_0 = "00000000000000000000000000000000";
  const sc_lv<32> write_row_ifm::ap_const_lv32_1 = "1";
  const sc_lv<1> write_row_ifm::ap_const_lv1_0 = "0";
  const sc_lv<1> write_row_ifm::ap_const_lv1_1 = "1";
  const sc_lv<6> write_row_ifm::ap_const_lv6_0 = "000000";
  const sc_lv<32> write_row_ifm::ap_const_lv32_2 = "10";
  const sc_lv<32> write_row_ifm::ap_const_lv32_22 = "100010";
  const sc_lv<6> write_row_ifm::ap_const_lv6_22 = "100010";
  const sc_lv<6> write_row_ifm::ap_const_lv6_1 = "1";
  const sc_lv<32> write_row_ifm::ap_const_lv32_20 = "100000";
  const sc_lv<32> write_row_ifm::ap_const_lv32_3F = "111111";
  const sc_lv<32> write_row_ifm::ap_const_lv32_40 = "1000000";
  const sc_lv<32> write_row_ifm::ap_const_lv32_5F = "1011111";
  const bool write_row_ifm::ap_const_boolean_1 = true;
  
  write_row_ifm::write_row_ifm(sc_module_name name) : sc_module(name), mVcdFile(0) {
  
      SC_METHOD(thread_ap_clk_no_reset_);
      dont_initialize();
      sensitive << ( ap_clk.pos() );
  
      SC_METHOD(thread_add_ln82_fu_141_p2);
      sensitive << ( cifm_counter_read );
  
      SC_METHOD(thread_ap_CS_fsm_state1);
      sensitive << ( ap_CS_fsm );
  
      SC_METHOD(thread_ap_CS_fsm_state2);
      sensitive << ( ap_CS_fsm );
  
      SC_METHOD(thread_ap_CS_fsm_state3);
      sensitive << ( ap_CS_fsm );
  
      SC_METHOD(thread_ap_block_state2);
      sensitive << ( cifm_TVALID );
      sensitive << ( icmp_ln82_fu_147_p2 );
  
      SC_METHOD(thread_ap_done);
      sensitive << ( ap_start );
      sensitive << ( ap_CS_fsm_state1 );
      sensitive << ( ap_CS_fsm_state3 );
  
      SC_METHOD(thread_ap_idle);
      sensitive << ( ap_start );
      sensitive << ( ap_CS_fsm_state1 );
  
      SC_METHOD(thread_ap_phi_mux_cifm_counter_1_phi_fu_135_p4);
      sensitive << ( enable_read_read_fu_64_p2 );
      sensitive << ( add_ln82_reg_214 );
      sensitive << ( cifm_counter_1_reg_132 );
      sensitive << ( ap_CS_fsm_state3 );
  
      SC_METHOD(thread_ap_ready);
      sensitive << ( ap_CS_fsm_state3 );
  
      SC_METHOD(thread_ap_return);
      sensitive << ( ap_phi_mux_cifm_counter_1_phi_fu_135_p4 );
      sensitive << ( ap_CS_fsm_state3 );
      sensitive << ( ap_return_preg );
  
      SC_METHOD(thread_cifm_TDATA_blk_n);
      sensitive << ( cifm_TVALID );
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( icmp_ln82_fu_147_p2 );
  
      SC_METHOD(thread_cifm_TREADY);
      sensitive << ( cifm_TVALID );
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( icmp_ln82_fu_147_p2 );
  
      SC_METHOD(thread_cifm_a1_load_new6_fu_175_p4);
      sensitive << ( cifm_TDATA );
  
      SC_METHOD(thread_cifm_a2_load_new_fu_190_p4);
      sensitive << ( cifm_TDATA );
  
      SC_METHOD(thread_enable_read_read_fu_64_p2);
      sensitive << ( ap_start );
      sensitive << ( ap_CS_fsm_state1 );
      sensitive << ( enable );
  
      SC_METHOD(thread_icmp_ln82_fu_147_p2);
      sensitive << ( cifm_TVALID );
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( icmp_ln82_fu_147_p2 );
      sensitive << ( j_0_reg_121 );
  
      SC_METHOD(thread_ifm_buff0_0_address0);
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( zext_ln85_fu_168_p1 );
  
      SC_METHOD(thread_ifm_buff0_0_ce0);
      sensitive << ( cifm_TVALID );
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( icmp_ln82_fu_147_p2 );
  
      SC_METHOD(thread_ifm_buff0_0_d0);
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( trunc_ln85_fu_159_p1 );
  
      SC_METHOD(thread_ifm_buff0_0_we0);
      sensitive << ( cifm_TVALID );
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( icmp_ln82_fu_147_p2 );
  
      SC_METHOD(thread_ifm_buff0_1_address0);
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( zext_ln85_fu_168_p1 );
  
      SC_METHOD(thread_ifm_buff0_1_ce0);
      sensitive << ( cifm_TVALID );
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( icmp_ln82_fu_147_p2 );
  
      SC_METHOD(thread_ifm_buff0_1_d0);
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( cifm_a1_load_new6_fu_175_p4 );
  
      SC_METHOD(thread_ifm_buff0_1_we0);
      sensitive << ( cifm_TVALID );
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( icmp_ln82_fu_147_p2 );
  
      SC_METHOD(thread_ifm_buff0_2_address0);
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( zext_ln85_fu_168_p1 );
  
      SC_METHOD(thread_ifm_buff0_2_ce0);
      sensitive << ( cifm_TVALID );
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( icmp_ln82_fu_147_p2 );
  
      SC_METHOD(thread_ifm_buff0_2_d0);
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( cifm_a2_load_new_fu_190_p4 );
  
      SC_METHOD(thread_ifm_buff0_2_we0);
      sensitive << ( cifm_TVALID );
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( icmp_ln82_fu_147_p2 );
  
      SC_METHOD(thread_j_fu_153_p2);
      sensitive << ( j_0_reg_121 );
  
      SC_METHOD(thread_trunc_ln85_fu_159_p1);
      sensitive << ( cifm_TDATA );
  
      SC_METHOD(thread_zext_ln85_fu_168_p1);
      sensitive << ( j_0_reg_121 );
  
      SC_METHOD(thread_ap_NS_fsm);
      sensitive << ( ap_start );
      sensitive << ( ap_CS_fsm );
      sensitive << ( ap_CS_fsm_state1 );
      sensitive << ( cifm_TVALID );
      sensitive << ( ap_CS_fsm_state2 );
      sensitive << ( icmp_ln82_fu_147_p2 );
      sensitive << ( enable_read_read_fu_64_p2 );
  
      ap_CS_fsm = "001";
      ap_return_preg = "00000000000000000000000000000000";
      static int apTFileNum = 0;
      stringstream apTFilenSS;
      apTFilenSS << "write_row_ifm_sc_trace_" << apTFileNum ++;
      string apTFn = apTFilenSS.str();
      mVcdFile = sc_create_vcd_trace_file(apTFn.c_str());
      mVcdFile->set_time_unit(1, SC_PS);
      if (1) {
  #ifdef __HLS_TRACE_LEVEL_PORT_HIER__
      sc_trace(mVcdFile, ap_clk, "(port)ap_clk");
      sc_trace(mVcdFile, ap_rst, "(port)ap_rst");
      sc_trace(mVcdFile, ap_start, "(port)ap_start");
      sc_trace(mVcdFile, ap_done, "(port)ap_done");
      sc_trace(mVcdFile, ap_idle, "(port)ap_idle");
      sc_trace(mVcdFile, ap_ready, "(port)ap_ready");
      sc_trace(mVcdFile, cifm_TDATA, "(port)cifm_TDATA");
      sc_trace(mVcdFile, cifm_TVALID, "(port)cifm_TVALID");
      sc_trace(mVcdFile, cifm_TREADY, "(port)cifm_TREADY");
      sc_trace(mVcdFile, ifm_buff0_0_address0, "(port)ifm_buff0_0_address0");
      sc_trace(mVcdFile, ifm_buff0_0_ce0, "(port)ifm_buff0_0_ce0");
      sc_trace(mVcdFile, ifm_buff0_0_we0, "(port)ifm_buff0_0_we0");
      sc_trace(mVcdFile, ifm_buff0_0_d0, "(port)ifm_buff0_0_d0");
      sc_trace(mVcdFile, ifm_buff0_1_address0, "(port)ifm_buff0_1_address0");
      sc_trace(mVcdFile, ifm_buff0_1_ce0, "(port)ifm_buff0_1_ce0");
      sc_trace(mVcdFile, ifm_buff0_1_we0, "(port)ifm_buff0_1_we0");
      sc_trace(mVcdFile, ifm_buff0_1_d0, "(port)ifm_buff0_1_d0");
      sc_trace(mVcdFile, ifm_buff0_2_address0, "(port)ifm_buff0_2_address0");
      sc_trace(mVcdFile, ifm_buff0_2_ce0, "(port)ifm_buff0_2_ce0");
      sc_trace(mVcdFile, ifm_buff0_2_we0, "(port)ifm_buff0_2_we0");
      sc_trace(mVcdFile, ifm_buff0_2_d0, "(port)ifm_buff0_2_d0");
      sc_trace(mVcdFile, cifm_counter_read, "(port)cifm_counter_read");
      sc_trace(mVcdFile, enable, "(port)enable");
      sc_trace(mVcdFile, ap_return, "(port)ap_return");
  #endif
  #ifdef __HLS_TRACE_LEVEL_INT__
      sc_trace(mVcdFile, ap_CS_fsm, "ap_CS_fsm");
      sc_trace(mVcdFile, ap_CS_fsm_state1, "ap_CS_fsm_state1");
      sc_trace(mVcdFile, cifm_TDATA_blk_n, "cifm_TDATA_blk_n");
      sc_trace(mVcdFile, ap_CS_fsm_state2, "ap_CS_fsm_state2");
      sc_trace(mVcdFile, icmp_ln82_fu_147_p2, "icmp_ln82_fu_147_p2");
      sc_trace(mVcdFile, enable_read_read_fu_64_p2, "enable_read_read_fu_64_p2");
      sc_trace(mVcdFile, add_ln82_fu_141_p2, "add_ln82_fu_141_p2");
      sc_trace(mVcdFile, add_ln82_reg_214, "add_ln82_reg_214");
      sc_trace(mVcdFile, j_fu_153_p2, "j_fu_153_p2");
      sc_trace(mVcdFile, ap_block_state2, "ap_block_state2");
      sc_trace(mVcdFile, j_0_reg_121, "j_0_reg_121");
      sc_trace(mVcdFile, ap_phi_mux_cifm_counter_1_phi_fu_135_p4, "ap_phi_mux_cifm_counter_1_phi_fu_135_p4");
      sc_trace(mVcdFile, cifm_counter_1_reg_132, "cifm_counter_1_reg_132");
      sc_trace(mVcdFile, ap_CS_fsm_state3, "ap_CS_fsm_state3");
      sc_trace(mVcdFile, zext_ln85_fu_168_p1, "zext_ln85_fu_168_p1");
      sc_trace(mVcdFile, trunc_ln85_fu_159_p1, "trunc_ln85_fu_159_p1");
      sc_trace(mVcdFile, cifm_a1_load_new6_fu_175_p4, "cifm_a1_load_new6_fu_175_p4");
      sc_trace(mVcdFile, cifm_a2_load_new_fu_190_p4, "cifm_a2_load_new_fu_190_p4");
      sc_trace(mVcdFile, ap_return_preg, "ap_return_preg");
      sc_trace(mVcdFile, ap_NS_fsm, "ap_NS_fsm");
  #endif
  
      }
  }
  
  write_row_ifm::~write_row_ifm() {
      if (mVcdFile) 
          sc_close_vcd_trace_file(mVcdFile);
  
  }
  
  void write_row_ifm::thread_ap_clk_no_reset_() {
      if ( ap_rst.read() == ap_const_logic_1) {
          ap_CS_fsm = ap_ST_fsm_state1;
      } else {
          ap_CS_fsm = ap_NS_fsm.read();
      }
      if ( ap_rst.read() == ap_const_logic_1) {
          ap_return_preg = ap_const_lv32_0;
      } else {
          if (esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state3.read())) {
              ap_return_preg = ap_phi_mux_cifm_counter_1_phi_fu_135_p4.read();
          }
      }
      if ((esl_seteq<1,1,1>(enable_read_read_fu_64_p2.read(), ap_const_lv1_1) && 
           esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state3.read()))) {
          cifm_counter_1_reg_132 = add_ln82_reg_214.read();
      } else if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read()) && 
                  esl_seteq<1,1,1>(ap_start.read(), ap_const_logic_1) && 
                  esl_seteq<1,1,1>(ap_const_lv1_0, enable_read_read_fu_64_p2.read()))) {
          cifm_counter_1_reg_132 = cifm_counter_read.read();
      }
      if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read()) && 
           esl_seteq<1,1,1>(ap_start.read(), ap_const_logic_1) && 
           esl_seteq<1,1,1>(enable_read_read_fu_64_p2.read(), ap_const_lv1_1))) {
          j_0_reg_121 = ap_const_lv6_0;
      } else if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && 
                  esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && 
                  !(esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) {
          j_0_reg_121 = j_fu_153_p2.read();
      }
      if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read()) && esl_seteq<1,1,1>(ap_start.read(), ap_const_logic_1) && esl_seteq<1,1,1>(enable_read_read_fu_64_p2.read(), ap_const_lv1_1))) {
          add_ln82_reg_214 = add_ln82_fu_141_p2.read();
      }
  }
  
  void write_row_ifm::thread_add_ln82_fu_141_p2() {
      add_ln82_fu_141_p2 = (!cifm_counter_read.read().is_01() || !ap_const_lv32_22.is_01())? sc_lv<32>(): (sc_biguint<32>(cifm_counter_read.read()) + sc_biguint<32>(ap_const_lv32_22));
  }
  
  void write_row_ifm::thread_ap_CS_fsm_state1() {
      ap_CS_fsm_state1 = ap_CS_fsm.read()[0];
  }
  
  void write_row_ifm::thread_ap_CS_fsm_state2() {
      ap_CS_fsm_state2 = ap_CS_fsm.read()[1];
  }
  
  void write_row_ifm::thread_ap_CS_fsm_state3() {
      ap_CS_fsm_state3 = ap_CS_fsm.read()[2];
  }
  
  void write_row_ifm::thread_ap_block_state2() {
      ap_block_state2 = (esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read()));
  }
  
  void write_row_ifm::thread_ap_done() {
      if (((esl_seteq<1,1,1>(ap_const_logic_0, ap_start.read()) && 
            esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read())) || 
           esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state3.read()))) {
          ap_done = ap_const_logic_1;
      } else {
          ap_done = ap_const_logic_0;
      }
  }
  
  void write_row_ifm::thread_ap_idle() {
      if ((esl_seteq<1,1,1>(ap_const_logic_0, ap_start.read()) && 
           esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read()))) {
          ap_idle = ap_const_logic_1;
      } else {
          ap_idle = ap_const_logic_0;
      }
  }
  
  void write_row_ifm::thread_ap_phi_mux_cifm_counter_1_phi_fu_135_p4() {
      if ((esl_seteq<1,1,1>(enable_read_read_fu_64_p2.read(), ap_const_lv1_1) && 
           esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state3.read()))) {
          ap_phi_mux_cifm_counter_1_phi_fu_135_p4 = add_ln82_reg_214.read();
      } else {
          ap_phi_mux_cifm_counter_1_phi_fu_135_p4 = cifm_counter_1_reg_132.read();
      }
  }
  
  void write_row_ifm::thread_ap_ready() {
      if (esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state3.read())) {
          ap_ready = ap_const_logic_1;
      } else {
          ap_ready = ap_const_logic_0;
      }
  }
  
  void write_row_ifm::thread_ap_return() {
      if (esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state3.read())) {
          ap_return = ap_phi_mux_cifm_counter_1_phi_fu_135_p4.read();
      } else {
          ap_return = ap_return_preg.read();
      }
  }
  
  void write_row_ifm::thread_cifm_TDATA_blk_n() {
      if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && 
           esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0))) {
          cifm_TDATA_blk_n = cifm_TVALID.read();
      } else {
          cifm_TDATA_blk_n = ap_const_logic_1;
      }
  }
  
  void write_row_ifm::thread_cifm_TREADY() {
      if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && 
           esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && 
           !(esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) {
          cifm_TREADY = ap_const_logic_1;
      } else {
          cifm_TREADY = ap_const_logic_0;
      }
  }
  
  void write_row_ifm::thread_cifm_a1_load_new6_fu_175_p4() {
      cifm_a1_load_new6_fu_175_p4 = cifm_TDATA.read().range(63, 32);
  }
  
  void write_row_ifm::thread_cifm_a2_load_new_fu_190_p4() {
      cifm_a2_load_new_fu_190_p4 = cifm_TDATA.read().range(95, 64);
  }
  
  void write_row_ifm::thread_enable_read_read_fu_64_p2() {
      enable_read_read_fu_64_p2 =  (sc_lv<1>) (enable.read());
  }
  
  void write_row_ifm::thread_icmp_ln82_fu_147_p2() {
      icmp_ln82_fu_147_p2 = (!j_0_reg_121.read().is_01() || !ap_const_lv6_22.is_01())? sc_lv<1>(): sc_lv<1>(j_0_reg_121.read() == ap_const_lv6_22);
  }
  
  void write_row_ifm::thread_ifm_buff0_0_address0() {
      ifm_buff0_0_address0 =  (sc_lv<6>) (zext_ln85_fu_168_p1.read());
  }
  
  void write_row_ifm::thread_ifm_buff0_0_ce0() {
      if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && 
           !(esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) {
          ifm_buff0_0_ce0 = ap_const_logic_1;
      } else {
          ifm_buff0_0_ce0 = ap_const_logic_0;
      }
  }
  
  void write_row_ifm::thread_ifm_buff0_0_d0() {
      ifm_buff0_0_d0 = trunc_ln85_fu_159_p1.read();
  }
  
  void write_row_ifm::thread_ifm_buff0_0_we0() {
      if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && 
           esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && 
           !(esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) {
          ifm_buff0_0_we0 = ap_const_logic_1;
      } else {
          ifm_buff0_0_we0 = ap_const_logic_0;
      }
  }
  
  void write_row_ifm::thread_ifm_buff0_1_address0() {
      ifm_buff0_1_address0 =  (sc_lv<6>) (zext_ln85_fu_168_p1.read());
  }
  
  void write_row_ifm::thread_ifm_buff0_1_ce0() {
      if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && 
           !(esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) {
          ifm_buff0_1_ce0 = ap_const_logic_1;
      } else {
          ifm_buff0_1_ce0 = ap_const_logic_0;
      }
  }
  
  void write_row_ifm::thread_ifm_buff0_1_d0() {
      ifm_buff0_1_d0 = cifm_a1_load_new6_fu_175_p4.read();
  }
  
  void write_row_ifm::thread_ifm_buff0_1_we0() {
      if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && 
           esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && 
           !(esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) {
          ifm_buff0_1_we0 = ap_const_logic_1;
      } else {
          ifm_buff0_1_we0 = ap_const_logic_0;
      }
  }
  
  void write_row_ifm::thread_ifm_buff0_2_address0() {
      ifm_buff0_2_address0 =  (sc_lv<6>) (zext_ln85_fu_168_p1.read());
  }
  
  void write_row_ifm::thread_ifm_buff0_2_ce0() {
      if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && 
           !(esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) {
          ifm_buff0_2_ce0 = ap_const_logic_1;
      } else {
          ifm_buff0_2_ce0 = ap_const_logic_0;
      }
  }
  
  void write_row_ifm::thread_ifm_buff0_2_d0() {
      ifm_buff0_2_d0 = cifm_a2_load_new_fu_190_p4.read();
  }
  
  void write_row_ifm::thread_ifm_buff0_2_we0() {
      if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && 
           esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && 
           !(esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) {
          ifm_buff0_2_we0 = ap_const_logic_1;
      } else {
          ifm_buff0_2_we0 = ap_const_logic_0;
      }
  }
  
  void write_row_ifm::thread_j_fu_153_p2() {
      j_fu_153_p2 = (!j_0_reg_121.read().is_01() || !ap_const_lv6_1.is_01())? sc_lv<6>(): (sc_biguint<6>(j_0_reg_121.read()) + sc_biguint<6>(ap_const_lv6_1));
  }
  
  void write_row_ifm::thread_trunc_ln85_fu_159_p1() {
      trunc_ln85_fu_159_p1 = cifm_TDATA.read().range(32-1, 0);
  }
  
  void write_row_ifm::thread_zext_ln85_fu_168_p1() {
      zext_ln85_fu_168_p1 = esl_zext<64,6>(j_0_reg_121.read());
  }
  
  void write_row_ifm::thread_ap_NS_fsm() {
      switch (ap_CS_fsm.read().to_uint64()) {
          case 1 : 
              if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read()) && esl_seteq<1,1,1>(ap_start.read(), ap_const_logic_1) && esl_seteq<1,1,1>(enable_read_read_fu_64_p2.read(), ap_const_lv1_1))) {
                  ap_NS_fsm = ap_ST_fsm_state2;
              } else if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state1.read()) && esl_seteq<1,1,1>(ap_start.read(), ap_const_logic_1) && esl_seteq<1,1,1>(ap_const_lv1_0, enable_read_read_fu_64_p2.read()))) {
                  ap_NS_fsm = ap_ST_fsm_state3;
              } else {
                  ap_NS_fsm = ap_ST_fsm_state1;
              }
              break;
          case 2 : 
              if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && !(esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())))) {
                  ap_NS_fsm = ap_ST_fsm_state2;
              } else if ((esl_seteq<1,1,1>(ap_const_logic_1, ap_CS_fsm_state2.read()) && !(esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_logic_0, cifm_TVALID.read())) && esl_seteq<1,1,1>(icmp_ln82_fu_147_p2.read(), ap_const_lv1_1))) {
                  ap_NS_fsm = ap_ST_fsm_state3;
              } else {
                  ap_NS_fsm = ap_ST_fsm_state2;
              }
              break;
          case 4 : 
              ap_NS_fsm = ap_ST_fsm_state1;
              break;
          default : 
              ap_NS_fsm = "XXX";
              break;
      }
  }
  
  }
  
  