data/full_repos/permissive/418752214/C910_RTL_FACTORY/gen_rtl/idu/rtl/ct_idu_dep_vreg_srcv2_entry.v
1: b"%Error: data/full_repos/permissive/418752214/C910_RTL_FACTORY/gen_rtl/idu/rtl/ct_idu_dep_vreg_srcv2_entry.v:224: Cannot find file containing module: 'gated_clk_cell'\ngated_clk_cell  x_dep_gated_clk (\n^~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/418752214/C910_RTL_FACTORY/gen_rtl/idu/rtl,data/full_repos/permissive/418752214/gated_clk_cell\n             data/full_repos/permissive/418752214/C910_RTL_FACTORY/gen_rtl/idu/rtl,data/full_repos/permissive/418752214/gated_clk_cell.v\n             data/full_repos/permissive/418752214/C910_RTL_FACTORY/gen_rtl/idu/rtl,data/full_repos/permissive/418752214/gated_clk_cell.sv\n             gated_clk_cell\n             gated_clk_cell.v\n             gated_clk_cell.sv\n             obj_dir/gated_clk_cell\n             obj_dir/gated_clk_cell.v\n             obj_dir/gated_clk_cell.sv\n%Error: data/full_repos/permissive/418752214/C910_RTL_FACTORY/gen_rtl/idu/rtl/ct_idu_dep_vreg_srcv2_entry.v:243: Cannot find file containing module: 'gated_clk_cell'\ngated_clk_cell  x_write_gated_clk (\n^~~~~~~~~~~~~~\n%Error: Exiting due to 2 error(s)\n"
module ct_idu_dep_vreg_srcv2_entry(
  cp0_idu_icg_en,
  cp0_yy_clk_en,
  cpurst_b,
  ctrl_xx_rf_pipe6_vmla_lch_vld_dupx,
  ctrl_xx_rf_pipe7_vmla_lch_vld_dupx,
  dp_xx_rf_pipe6_dst_vreg_dupx,
  dp_xx_rf_pipe7_dst_vreg_dupx,
  forever_cpuclk,
  gateclk_entry_vld,
  lsu_idu_ag_pipe3_vload_inst_vld,
  lsu_idu_ag_pipe3_vreg_dupx,
  lsu_idu_dc_pipe3_vload_fwd_inst_vld,
  lsu_idu_dc_pipe3_vload_inst_vld_dupx,
  lsu_idu_dc_pipe3_vreg_dupx,
  lsu_idu_wb_pipe3_wb_vreg_dupx,
  lsu_idu_wb_pipe3_wb_vreg_vld_dupx,
  pad_yy_icg_scan_en,
  rtu_idu_flush_fe,
  rtu_idu_flush_is,
  vfpu0_vreg_fwd_vld,
  vfpu1_vreg_fwd_vld,
  vfpu_idu_ex1_pipe6_data_vld_dupx,
  vfpu_idu_ex1_pipe6_fmla_data_vld_dupx,
  vfpu_idu_ex1_pipe6_vreg_dupx,
  vfpu_idu_ex1_pipe7_data_vld_dupx,
  vfpu_idu_ex1_pipe7_fmla_data_vld_dupx,
  vfpu_idu_ex1_pipe7_vreg_dupx,
  vfpu_idu_ex2_pipe6_data_vld_dupx,
  vfpu_idu_ex2_pipe6_fmla_data_vld_dupx,
  vfpu_idu_ex2_pipe6_vreg_dupx,
  vfpu_idu_ex2_pipe7_data_vld_dupx,
  vfpu_idu_ex2_pipe7_fmla_data_vld_dupx,
  vfpu_idu_ex2_pipe7_vreg_dupx,
  vfpu_idu_ex3_pipe6_data_vld_dupx,
  vfpu_idu_ex3_pipe6_vreg_dupx,
  vfpu_idu_ex3_pipe7_data_vld_dupx,
  vfpu_idu_ex3_pipe7_vreg_dupx,
  vfpu_idu_ex5_pipe6_wb_vreg_dupx,
  vfpu_idu_ex5_pipe6_wb_vreg_vld_dupx,
  vfpu_idu_ex5_pipe7_wb_vreg_dupx,
  vfpu_idu_ex5_pipe7_wb_vreg_vld_dupx,
  x_create_data,
  x_entry_vmla,
  x_gateclk_idx_write_en,
  x_gateclk_write_en,
  x_rdy_clr,
  x_read_data,
  x_write_en
);


input           cp0_idu_icg_en;                       
input           cp0_yy_clk_en;                        
input           cpurst_b;                             
input           ctrl_xx_rf_pipe6_vmla_lch_vld_dupx;   
input           ctrl_xx_rf_pipe7_vmla_lch_vld_dupx;   
input   [6 :0]  dp_xx_rf_pipe6_dst_vreg_dupx;         
input   [6 :0]  dp_xx_rf_pipe7_dst_vreg_dupx;         
input           forever_cpuclk;                       
input           gateclk_entry_vld;                    
input           lsu_idu_ag_pipe3_vload_inst_vld;      
input   [6 :0]  lsu_idu_ag_pipe3_vreg_dupx;           
input           lsu_idu_dc_pipe3_vload_fwd_inst_vld;  
input           lsu_idu_dc_pipe3_vload_inst_vld_dupx; 
input   [6 :0]  lsu_idu_dc_pipe3_vreg_dupx;           
input   [6 :0]  lsu_idu_wb_pipe3_wb_vreg_dupx;        
input           lsu_idu_wb_pipe3_wb_vreg_vld_dupx;    
input           pad_yy_icg_scan_en;                   
input           rtu_idu_flush_fe;                     
input           rtu_idu_flush_is;                     
input           vfpu0_vreg_fwd_vld;                   
input           vfpu1_vreg_fwd_vld;                   
input           vfpu_idu_ex1_pipe6_data_vld_dupx;     
input           vfpu_idu_ex1_pipe6_fmla_data_vld_dupx; 
input   [6 :0]  vfpu_idu_ex1_pipe6_vreg_dupx;         
input           vfpu_idu_ex1_pipe7_data_vld_dupx;     
input           vfpu_idu_ex1_pipe7_fmla_data_vld_dupx; 
input   [6 :0]  vfpu_idu_ex1_pipe7_vreg_dupx;         
input           vfpu_idu_ex2_pipe6_data_vld_dupx;     
input           vfpu_idu_ex2_pipe6_fmla_data_vld_dupx; 
input   [6 :0]  vfpu_idu_ex2_pipe6_vreg_dupx;         
input           vfpu_idu_ex2_pipe7_data_vld_dupx;     
input           vfpu_idu_ex2_pipe7_fmla_data_vld_dupx; 
input   [6 :0]  vfpu_idu_ex2_pipe7_vreg_dupx;         
input           vfpu_idu_ex3_pipe6_data_vld_dupx;     
input   [6 :0]  vfpu_idu_ex3_pipe6_vreg_dupx;         
input           vfpu_idu_ex3_pipe7_data_vld_dupx;     
input   [6 :0]  vfpu_idu_ex3_pipe7_vreg_dupx;         
input   [6 :0]  vfpu_idu_ex5_pipe6_wb_vreg_dupx;      
input           vfpu_idu_ex5_pipe6_wb_vreg_vld_dupx;  
input   [6 :0]  vfpu_idu_ex5_pipe7_wb_vreg_dupx;      
input           vfpu_idu_ex5_pipe7_wb_vreg_vld_dupx;  
input   [10:0]  x_create_data;                        
input           x_entry_vmla;                         
input           x_gateclk_idx_write_en;               
input           x_gateclk_write_en;                   
input           x_rdy_clr;                            
input           x_write_en;                           
output  [12:0]  x_read_data;                          


reg             lsu_match;                            
reg             mla_rdy;                              
reg             rdy;                                  
reg     [6 :0]  vreg;                                 
reg             wb;                                   


wire            cp0_idu_icg_en;                       
wire            cp0_yy_clk_en;                        
wire            cpurst_b;                             
wire            ctrl_xx_rf_pipe6_vmla_lch_vld_dupx;   
wire            ctrl_xx_rf_pipe7_vmla_lch_vld_dupx;   
wire            data_ready;                           
wire            dep_clk;                              
wire            dep_clk_en;                           
wire    [6 :0]  dp_xx_rf_pipe6_dst_vreg_dupx;         
wire    [6 :0]  dp_xx_rf_pipe7_dst_vreg_dupx;         
wire            forever_cpuclk;                       
wire            gateclk_entry_vld;                    
wire            load_data_ready;                      
wire            load_issue_data_ready;                
wire            lsu_idu_ag_pipe3_vload_inst_vld;      
wire    [6 :0]  lsu_idu_ag_pipe3_vreg_dupx;           
wire            lsu_idu_dc_pipe3_vload_fwd_inst_vld;  
wire            lsu_idu_dc_pipe3_vload_inst_vld_dupx; 
wire    [6 :0]  lsu_idu_dc_pipe3_vreg_dupx;           
wire    [6 :0]  lsu_idu_wb_pipe3_wb_vreg_dupx;        
wire            lsu_idu_wb_pipe3_wb_vreg_vld_dupx;    
wire            lsu_match_update;                     
wire            mla_data_ready;                       
wire            mla_rdy_update;                       
wire            pad_yy_icg_scan_en;                   
wire            pipe3_wb;                             
wire            pipe6_wb;                             
wire            pipe7_wb;                             
wire            rdy_clear;                            
wire            rdy_update;                           
wire            rtu_idu_flush_fe;                     
wire            rtu_idu_flush_is;                     
wire            vfpu0_ex3_data_ready;                 
wire            vfpu0_ex4_data_ready;                 
wire            vfpu0_ex5_data_ready;                 
wire            vfpu0_fmla_data_ready;                
wire            vfpu0_vdsp_fwd_data_ready;            
wire            vfpu0_vmla_data_ready;                
wire            vfpu0_vreg_fwd_vld;                   
wire            vfpu1_ex3_data_ready;                 
wire            vfpu1_ex4_data_ready;                 
wire            vfpu1_ex5_data_ready;                 
wire            vfpu1_fmla_data_ready;                
wire            vfpu1_vdsp_fwd_data_ready;            
wire            vfpu1_vmla_data_ready;                
wire            vfpu1_vreg_fwd_vld;                   
wire            vfpu_idu_ex1_pipe6_data_vld_dupx;     
wire            vfpu_idu_ex1_pipe6_fmla_data_vld_dupx; 
wire    [6 :0]  vfpu_idu_ex1_pipe6_vreg_dupx;         
wire            vfpu_idu_ex1_pipe7_data_vld_dupx;     
wire            vfpu_idu_ex1_pipe7_fmla_data_vld_dupx; 
wire    [6 :0]  vfpu_idu_ex1_pipe7_vreg_dupx;         
wire            vfpu_idu_ex2_pipe6_data_vld_dupx;     
wire            vfpu_idu_ex2_pipe6_fmla_data_vld_dupx; 
wire    [6 :0]  vfpu_idu_ex2_pipe6_vreg_dupx;         
wire            vfpu_idu_ex2_pipe7_data_vld_dupx;     
wire            vfpu_idu_ex2_pipe7_fmla_data_vld_dupx; 
wire    [6 :0]  vfpu_idu_ex2_pipe7_vreg_dupx;         
wire            vfpu_idu_ex3_pipe6_data_vld_dupx;     
wire    [6 :0]  vfpu_idu_ex3_pipe6_vreg_dupx;         
wire            vfpu_idu_ex3_pipe7_data_vld_dupx;     
wire    [6 :0]  vfpu_idu_ex3_pipe7_vreg_dupx;         
wire    [6 :0]  vfpu_idu_ex5_pipe6_wb_vreg_dupx;      
wire            vfpu_idu_ex5_pipe6_wb_vreg_vld_dupx;  
wire    [6 :0]  vfpu_idu_ex5_pipe7_wb_vreg_dupx;      
wire            vfpu_idu_ex5_pipe7_wb_vreg_vld_dupx;  
wire            wake_up;                              
wire            wb_update;                            
wire            write_back;                           
wire            write_clk;                            
wire            write_clk_en;                         
wire    [10:0]  x_create_data;                        
wire            x_create_lsu_match;                   
wire            x_create_mla_rdy;                     
wire            x_create_rdy;                         
wire    [6 :0]  x_create_vreg;                        
wire            x_create_wb;                          
wire            x_entry_vmla;                         
wire            x_gateclk_idx_write_en;               
wire            x_gateclk_write_en;                   
wire            x_rdy_clr;                            
wire    [12:0]  x_read_data;                          
wire            x_read_lsu_match;                     
wire            x_read_mla_rdy;                       
wire            x_read_rdy;                           
wire            x_read_rdy_for_bypass;                
wire            x_read_rdy_for_issue;                 
wire    [6 :0]  x_read_vreg;                          
wire            x_read_wb;                            
wire            x_write_en;                           






assign dep_clk_en = x_gateclk_write_en || gateclk_entry_vld && (!rdy || !wb);

gated_clk_cell  x_dep_gated_clk (
  .clk_in             (forever_cpuclk    ),
  .clk_out            (dep_clk           ),
  .external_en        (1'b0              ),
  .global_en          (cp0_yy_clk_en     ),
  .local_en           (dep_clk_en        ),
  .module_en          (cp0_idu_icg_en    ),
  .pad_yy_icg_scan_en (pad_yy_icg_scan_en)
);








assign write_clk_en = x_gateclk_idx_write_en;

gated_clk_cell  x_write_gated_clk (
  .clk_in             (forever_cpuclk    ),
  .clk_out            (write_clk         ),
  .external_en        (1'b0              ),
  .global_en          (cp0_yy_clk_en     ),
  .local_en           (write_clk_en      ),
  .module_en          (cp0_idu_icg_en    ),
  .pad_yy_icg_scan_en (pad_yy_icg_scan_en)
);











assign x_create_lsu_match           = x_create_data[10];
assign x_create_mla_rdy             = x_create_data[9];
assign x_create_vreg[6:0]           = x_create_data[8:2];
assign x_create_wb                  = x_create_data[1];
assign x_create_rdy                 = x_create_data[0];

assign x_read_data[12]              = x_read_lsu_match;
assign x_read_data[11]              = x_read_rdy_for_bypass;
assign x_read_data[10]              = x_read_rdy_for_issue;
assign x_read_data[9]               = x_read_mla_rdy;
assign x_read_data[8:2]             = x_read_vreg[6:0];
assign x_read_data[1]               = x_read_wb;
assign x_read_data[0]               = x_read_rdy;









assign vfpu0_ex3_data_ready  = vfpu_idu_ex1_pipe6_data_vld_dupx
                               && (vfpu_idu_ex1_pipe6_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu0_ex4_data_ready  = vfpu_idu_ex2_pipe6_data_vld_dupx
                               && (vfpu_idu_ex2_pipe6_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu0_ex5_data_ready  = vfpu_idu_ex3_pipe6_data_vld_dupx
                               && (vfpu_idu_ex3_pipe6_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu1_ex3_data_ready  = vfpu_idu_ex1_pipe7_data_vld_dupx
                               && (vfpu_idu_ex1_pipe7_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu1_ex4_data_ready  = vfpu_idu_ex2_pipe7_data_vld_dupx
                               && (vfpu_idu_ex2_pipe7_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu1_ex5_data_ready  = vfpu_idu_ex3_pipe7_data_vld_dupx
                               && (vfpu_idu_ex3_pipe7_vreg_dupx[6:0] == vreg[6:0]);
assign load_data_ready       = lsu_idu_dc_pipe3_vload_inst_vld_dupx
                               && (lsu_idu_dc_pipe3_vreg_dupx[6:0] == vreg[6:0]);

assign load_issue_data_ready = lsu_idu_dc_pipe3_vload_fwd_inst_vld && lsu_match;

assign data_ready            = vfpu0_ex3_data_ready
                               || vfpu0_ex4_data_ready
                               || vfpu0_ex5_data_ready
                               || vfpu1_ex3_data_ready
                               || vfpu1_ex4_data_ready
                               || vfpu1_ex5_data_ready
                               || load_data_ready;

assign wake_up               = wb;

assign rdy_clear             = x_rdy_clr;






assign rdy_update = (rdy || data_ready || wake_up) && !rdy_clear;

assign x_read_rdy = rdy_update;

assign x_read_rdy_for_issue  = rdy || mla_rdy || load_issue_data_ready
                                              || vfpu0_vdsp_fwd_data_ready
                                              || vfpu1_vdsp_fwd_data_ready;
assign x_read_rdy_for_bypass = rdy;

always @(posedge dep_clk or negedge cpurst_b)
begin
  if(!cpurst_b)
    rdy <= 1'b1;
  else if(rtu_idu_flush_fe || rtu_idu_flush_is)
    rdy <= 1'b1;
  else if(x_write_en)
    rdy <= x_create_rdy;
  else
    rdy <= rdy_update;
end




assign lsu_match_update = lsu_idu_ag_pipe3_vload_inst_vld
                          && (lsu_idu_ag_pipe3_vreg_dupx[6:0] == vreg[6:0]);

assign x_read_lsu_match  = lsu_match_update;

always @(posedge dep_clk or negedge cpurst_b)
begin
  if(!cpurst_b)
    lsu_match <= 1'b0;
  else if(rtu_idu_flush_fe || rtu_idu_flush_is)
    lsu_match <= 1'b0;
  else if(x_write_en)
    lsu_match <= x_create_lsu_match;
  else
    lsu_match <= lsu_match_update;
end








assign vfpu0_fmla_data_ready     = x_entry_vmla
                                   && vfpu_idu_ex2_pipe6_fmla_data_vld_dupx
                                   && (vfpu_idu_ex2_pipe6_vreg_dupx[6:0] == vreg[6:0])
                                || x_entry_vmla
                                   && vfpu_idu_ex1_pipe6_fmla_data_vld_dupx
                                   && (vfpu_idu_ex1_pipe6_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu1_fmla_data_ready     = x_entry_vmla 
                                   && vfpu_idu_ex2_pipe7_fmla_data_vld_dupx
                                   && (vfpu_idu_ex2_pipe7_vreg_dupx[6:0] == vreg[6:0])
                                || x_entry_vmla 
                                   && vfpu_idu_ex1_pipe7_fmla_data_vld_dupx
                                   && (vfpu_idu_ex1_pipe7_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu0_vmla_data_ready     = x_entry_vmla
                                   && ctrl_xx_rf_pipe6_vmla_lch_vld_dupx
                                   && (dp_xx_rf_pipe6_dst_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu1_vmla_data_ready     = x_entry_vmla 
                                   && ctrl_xx_rf_pipe7_vmla_lch_vld_dupx
                                   && (dp_xx_rf_pipe7_dst_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu0_vdsp_fwd_data_ready = x_entry_vmla 
                                   && vfpu0_vreg_fwd_vld;
assign vfpu1_vdsp_fwd_data_ready = x_entry_vmla 
                                   && vfpu1_vreg_fwd_vld;
assign mla_data_ready            = vfpu0_fmla_data_ready
                                   || vfpu1_fmla_data_ready
                                   || vfpu0_vmla_data_ready
                                   || vfpu1_vmla_data_ready
                                   || vfpu0_vdsp_fwd_data_ready
                                   || vfpu1_vdsp_fwd_data_ready;






assign mla_rdy_update = (mla_rdy || mla_data_ready || wake_up) && !rdy_clear;

assign x_read_mla_rdy = mla_rdy_update;

always @(posedge dep_clk or negedge cpurst_b)
begin
  if(!cpurst_b)
    mla_rdy <= 1'b1;
  else if(rtu_idu_flush_fe || rtu_idu_flush_is)
    mla_rdy <= 1'b1;
  else if(x_write_en)
    mla_rdy <= x_create_mla_rdy;
  else
    mla_rdy <= mla_rdy_update;
end









assign pipe3_wb = lsu_idu_wb_pipe3_wb_vreg_vld_dupx
                  && (lsu_idu_wb_pipe3_wb_vreg_dupx[6:0] == vreg[6:0]);
assign pipe6_wb = vfpu_idu_ex5_pipe6_wb_vreg_vld_dupx
                  && (vfpu_idu_ex5_pipe6_wb_vreg_dupx[6:0] == vreg[6:0]);
assign pipe7_wb = vfpu_idu_ex5_pipe7_wb_vreg_vld_dupx
                  && (vfpu_idu_ex5_pipe7_wb_vreg_dupx[6:0] == vreg[6:0]);
assign write_back = wb
                    || pipe3_wb
                    || pipe6_wb
                    || pipe7_wb;


assign x_read_wb = wb_update;
assign wb_update = wb || write_back;

always @(posedge dep_clk or negedge cpurst_b)
begin
  if(!cpurst_b)
    wb <= 1'b1;
  else if(rtu_idu_flush_fe || rtu_idu_flush_is)
    wb <= 1'b1;
  else if(x_write_en)
    wb <= x_create_wb;
  else
    wb <= wb_update;
end




assign x_read_vreg[6:0] = vreg[6:0];
always @(posedge write_clk or negedge cpurst_b)
begin
  if(!cpurst_b)
    vreg[6:0] <= 7'b0;
  else if(x_write_en)
    vreg[6:0] <= x_create_vreg[6:0];
  else
    vreg[6:0] <= vreg[6:0];
end


endmodule
module ct_idu_dep_vreg_srcv2_entry(
  cp0_idu_icg_en,
  cp0_yy_clk_en,
  cpurst_b,
  ctrl_xx_rf_pipe6_vmla_lch_vld_dupx,
  ctrl_xx_rf_pipe7_vmla_lch_vld_dupx,
  dp_xx_rf_pipe6_dst_vreg_dupx,
  dp_xx_rf_pipe7_dst_vreg_dupx,
  forever_cpuclk,
  gateclk_entry_vld,
  lsu_idu_ag_pipe3_vload_inst_vld,
  lsu_idu_ag_pipe3_vreg_dupx,
  lsu_idu_dc_pipe3_vload_fwd_inst_vld,
  lsu_idu_dc_pipe3_vload_inst_vld_dupx,
  lsu_idu_dc_pipe3_vreg_dupx,
  lsu_idu_wb_pipe3_wb_vreg_dupx,
  lsu_idu_wb_pipe3_wb_vreg_vld_dupx,
  pad_yy_icg_scan_en,
  rtu_idu_flush_fe,
  rtu_idu_flush_is,
  vfpu0_vreg_fwd_vld,
  vfpu1_vreg_fwd_vld,
  vfpu_idu_ex1_pipe6_data_vld_dupx,
  vfpu_idu_ex1_pipe6_fmla_data_vld_dupx,
  vfpu_idu_ex1_pipe6_vreg_dupx,
  vfpu_idu_ex1_pipe7_data_vld_dupx,
  vfpu_idu_ex1_pipe7_fmla_data_vld_dupx,
  vfpu_idu_ex1_pipe7_vreg_dupx,
  vfpu_idu_ex2_pipe6_data_vld_dupx,
  vfpu_idu_ex2_pipe6_fmla_data_vld_dupx,
  vfpu_idu_ex2_pipe6_vreg_dupx,
  vfpu_idu_ex2_pipe7_data_vld_dupx,
  vfpu_idu_ex2_pipe7_fmla_data_vld_dupx,
  vfpu_idu_ex2_pipe7_vreg_dupx,
  vfpu_idu_ex3_pipe6_data_vld_dupx,
  vfpu_idu_ex3_pipe6_vreg_dupx,
  vfpu_idu_ex3_pipe7_data_vld_dupx,
  vfpu_idu_ex3_pipe7_vreg_dupx,
  vfpu_idu_ex5_pipe6_wb_vreg_dupx,
  vfpu_idu_ex5_pipe6_wb_vreg_vld_dupx,
  vfpu_idu_ex5_pipe7_wb_vreg_dupx,
  vfpu_idu_ex5_pipe7_wb_vreg_vld_dupx,
  x_create_data,
  x_entry_vmla,
  x_gateclk_idx_write_en,
  x_gateclk_write_en,
  x_rdy_clr,
  x_read_data,
  x_write_en
);



input           cp0_idu_icg_en;                       
input           cp0_yy_clk_en;                        
input           cpurst_b;                             
input           ctrl_xx_rf_pipe6_vmla_lch_vld_dupx;   
input           ctrl_xx_rf_pipe7_vmla_lch_vld_dupx;   
input   [6 :0]  dp_xx_rf_pipe6_dst_vreg_dupx;         
input   [6 :0]  dp_xx_rf_pipe7_dst_vreg_dupx;         
input           forever_cpuclk;                       
input           gateclk_entry_vld;                    
input           lsu_idu_ag_pipe3_vload_inst_vld;      
input   [6 :0]  lsu_idu_ag_pipe3_vreg_dupx;           
input           lsu_idu_dc_pipe3_vload_fwd_inst_vld;  
input           lsu_idu_dc_pipe3_vload_inst_vld_dupx; 
input   [6 :0]  lsu_idu_dc_pipe3_vreg_dupx;           
input   [6 :0]  lsu_idu_wb_pipe3_wb_vreg_dupx;        
input           lsu_idu_wb_pipe3_wb_vreg_vld_dupx;    
input           pad_yy_icg_scan_en;                   
input           rtu_idu_flush_fe;                     
input           rtu_idu_flush_is;                     
input           vfpu0_vreg_fwd_vld;                   
input           vfpu1_vreg_fwd_vld;                   
input           vfpu_idu_ex1_pipe6_data_vld_dupx;     
input           vfpu_idu_ex1_pipe6_fmla_data_vld_dupx; 
input   [6 :0]  vfpu_idu_ex1_pipe6_vreg_dupx;         
input           vfpu_idu_ex1_pipe7_data_vld_dupx;     
input           vfpu_idu_ex1_pipe7_fmla_data_vld_dupx; 
input   [6 :0]  vfpu_idu_ex1_pipe7_vreg_dupx;         
input           vfpu_idu_ex2_pipe6_data_vld_dupx;     
input           vfpu_idu_ex2_pipe6_fmla_data_vld_dupx; 
input   [6 :0]  vfpu_idu_ex2_pipe6_vreg_dupx;         
input           vfpu_idu_ex2_pipe7_data_vld_dupx;     
input           vfpu_idu_ex2_pipe7_fmla_data_vld_dupx; 
input   [6 :0]  vfpu_idu_ex2_pipe7_vreg_dupx;         
input           vfpu_idu_ex3_pipe6_data_vld_dupx;     
input   [6 :0]  vfpu_idu_ex3_pipe6_vreg_dupx;         
input           vfpu_idu_ex3_pipe7_data_vld_dupx;     
input   [6 :0]  vfpu_idu_ex3_pipe7_vreg_dupx;         
input   [6 :0]  vfpu_idu_ex5_pipe6_wb_vreg_dupx;      
input           vfpu_idu_ex5_pipe6_wb_vreg_vld_dupx;  
input   [6 :0]  vfpu_idu_ex5_pipe7_wb_vreg_dupx;      
input           vfpu_idu_ex5_pipe7_wb_vreg_vld_dupx;  
input   [10:0]  x_create_data;                        
input           x_entry_vmla;                         
input           x_gateclk_idx_write_en;               
input           x_gateclk_write_en;                   
input           x_rdy_clr;                            
input           x_write_en;                           
output  [12:0]  x_read_data;                          


reg             lsu_match;                            
reg             mla_rdy;                              
reg             rdy;                                  
reg     [6 :0]  vreg;                                 
reg             wb;                                   


wire            cp0_idu_icg_en;                       
wire            cp0_yy_clk_en;                        
wire            cpurst_b;                             
wire            ctrl_xx_rf_pipe6_vmla_lch_vld_dupx;   
wire            ctrl_xx_rf_pipe7_vmla_lch_vld_dupx;   
wire            data_ready;                           
wire            dep_clk;                              
wire            dep_clk_en;                           
wire    [6 :0]  dp_xx_rf_pipe6_dst_vreg_dupx;         
wire    [6 :0]  dp_xx_rf_pipe7_dst_vreg_dupx;         
wire            forever_cpuclk;                       
wire            gateclk_entry_vld;                    
wire            load_data_ready;                      
wire            load_issue_data_ready;                
wire            lsu_idu_ag_pipe3_vload_inst_vld;      
wire    [6 :0]  lsu_idu_ag_pipe3_vreg_dupx;           
wire            lsu_idu_dc_pipe3_vload_fwd_inst_vld;  
wire            lsu_idu_dc_pipe3_vload_inst_vld_dupx; 
wire    [6 :0]  lsu_idu_dc_pipe3_vreg_dupx;           
wire    [6 :0]  lsu_idu_wb_pipe3_wb_vreg_dupx;        
wire            lsu_idu_wb_pipe3_wb_vreg_vld_dupx;    
wire            lsu_match_update;                     
wire            mla_data_ready;                       
wire            mla_rdy_update;                       
wire            pad_yy_icg_scan_en;                   
wire            pipe3_wb;                             
wire            pipe6_wb;                             
wire            pipe7_wb;                             
wire            rdy_clear;                            
wire            rdy_update;                           
wire            rtu_idu_flush_fe;                     
wire            rtu_idu_flush_is;                     
wire            vfpu0_ex3_data_ready;                 
wire            vfpu0_ex4_data_ready;                 
wire            vfpu0_ex5_data_ready;                 
wire            vfpu0_fmla_data_ready;                
wire            vfpu0_vdsp_fwd_data_ready;            
wire            vfpu0_vmla_data_ready;                
wire            vfpu0_vreg_fwd_vld;                   
wire            vfpu1_ex3_data_ready;                 
wire            vfpu1_ex4_data_ready;                 
wire            vfpu1_ex5_data_ready;                 
wire            vfpu1_fmla_data_ready;                
wire            vfpu1_vdsp_fwd_data_ready;            
wire            vfpu1_vmla_data_ready;                
wire            vfpu1_vreg_fwd_vld;                   
wire            vfpu_idu_ex1_pipe6_data_vld_dupx;     
wire            vfpu_idu_ex1_pipe6_fmla_data_vld_dupx; 
wire    [6 :0]  vfpu_idu_ex1_pipe6_vreg_dupx;         
wire            vfpu_idu_ex1_pipe7_data_vld_dupx;     
wire            vfpu_idu_ex1_pipe7_fmla_data_vld_dupx; 
wire    [6 :0]  vfpu_idu_ex1_pipe7_vreg_dupx;         
wire            vfpu_idu_ex2_pipe6_data_vld_dupx;     
wire            vfpu_idu_ex2_pipe6_fmla_data_vld_dupx; 
wire    [6 :0]  vfpu_idu_ex2_pipe6_vreg_dupx;         
wire            vfpu_idu_ex2_pipe7_data_vld_dupx;     
wire            vfpu_idu_ex2_pipe7_fmla_data_vld_dupx; 
wire    [6 :0]  vfpu_idu_ex2_pipe7_vreg_dupx;         
wire            vfpu_idu_ex3_pipe6_data_vld_dupx;     
wire    [6 :0]  vfpu_idu_ex3_pipe6_vreg_dupx;         
wire            vfpu_idu_ex3_pipe7_data_vld_dupx;     
wire    [6 :0]  vfpu_idu_ex3_pipe7_vreg_dupx;         
wire    [6 :0]  vfpu_idu_ex5_pipe6_wb_vreg_dupx;      
wire            vfpu_idu_ex5_pipe6_wb_vreg_vld_dupx;  
wire    [6 :0]  vfpu_idu_ex5_pipe7_wb_vreg_dupx;      
wire            vfpu_idu_ex5_pipe7_wb_vreg_vld_dupx;  
wire            wake_up;                              
wire            wb_update;                            
wire            write_back;                           
wire            write_clk;                            
wire            write_clk_en;                         
wire    [10:0]  x_create_data;                        
wire            x_create_lsu_match;                   
wire            x_create_mla_rdy;                     
wire            x_create_rdy;                         
wire    [6 :0]  x_create_vreg;                        
wire            x_create_wb;                          
wire            x_entry_vmla;                         
wire            x_gateclk_idx_write_en;               
wire            x_gateclk_write_en;                   
wire            x_rdy_clr;                            
wire    [12:0]  x_read_data;                          
wire            x_read_lsu_match;                     
wire            x_read_mla_rdy;                       
wire            x_read_rdy;                           
wire            x_read_rdy_for_bypass;                
wire            x_read_rdy_for_issue;                 
wire    [6 :0]  x_read_vreg;                          
wire            x_read_wb;                            
wire            x_write_en;                           






assign dep_clk_en = x_gateclk_write_en || gateclk_entry_vld && (!rdy || !wb);

gated_clk_cell  x_dep_gated_clk (
  .clk_in             (forever_cpuclk    ),
  .clk_out            (dep_clk           ),
  .external_en        (1'b0              ),
  .global_en          (cp0_yy_clk_en     ),
  .local_en           (dep_clk_en        ),
  .module_en          (cp0_idu_icg_en    ),
  .pad_yy_icg_scan_en (pad_yy_icg_scan_en)
);








assign write_clk_en = x_gateclk_idx_write_en;

gated_clk_cell  x_write_gated_clk (
  .clk_in             (forever_cpuclk    ),
  .clk_out            (write_clk         ),
  .external_en        (1'b0              ),
  .global_en          (cp0_yy_clk_en     ),
  .local_en           (write_clk_en      ),
  .module_en          (cp0_idu_icg_en    ),
  .pad_yy_icg_scan_en (pad_yy_icg_scan_en)
);











assign x_create_lsu_match           = x_create_data[10];
assign x_create_mla_rdy             = x_create_data[9];
assign x_create_vreg[6:0]           = x_create_data[8:2];
assign x_create_wb                  = x_create_data[1];
assign x_create_rdy                 = x_create_data[0];

assign x_read_data[12]              = x_read_lsu_match;
assign x_read_data[11]              = x_read_rdy_for_bypass;
assign x_read_data[10]              = x_read_rdy_for_issue;
assign x_read_data[9]               = x_read_mla_rdy;
assign x_read_data[8:2]             = x_read_vreg[6:0];
assign x_read_data[1]               = x_read_wb;
assign x_read_data[0]               = x_read_rdy;









assign vfpu0_ex3_data_ready  = vfpu_idu_ex1_pipe6_data_vld_dupx
                               && (vfpu_idu_ex1_pipe6_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu0_ex4_data_ready  = vfpu_idu_ex2_pipe6_data_vld_dupx
                               && (vfpu_idu_ex2_pipe6_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu0_ex5_data_ready  = vfpu_idu_ex3_pipe6_data_vld_dupx
                               && (vfpu_idu_ex3_pipe6_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu1_ex3_data_ready  = vfpu_idu_ex1_pipe7_data_vld_dupx
                               && (vfpu_idu_ex1_pipe7_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu1_ex4_data_ready  = vfpu_idu_ex2_pipe7_data_vld_dupx
                               && (vfpu_idu_ex2_pipe7_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu1_ex5_data_ready  = vfpu_idu_ex3_pipe7_data_vld_dupx
                               && (vfpu_idu_ex3_pipe7_vreg_dupx[6:0] == vreg[6:0]);
assign load_data_ready       = lsu_idu_dc_pipe3_vload_inst_vld_dupx
                               && (lsu_idu_dc_pipe3_vreg_dupx[6:0] == vreg[6:0]);

assign load_issue_data_ready = lsu_idu_dc_pipe3_vload_fwd_inst_vld && lsu_match;

assign data_ready            = vfpu0_ex3_data_ready
                               || vfpu0_ex4_data_ready
                               || vfpu0_ex5_data_ready
                               || vfpu1_ex3_data_ready
                               || vfpu1_ex4_data_ready
                               || vfpu1_ex5_data_ready
                               || load_data_ready;

assign wake_up               = wb;

assign rdy_clear             = x_rdy_clr;






assign rdy_update = (rdy || data_ready || wake_up) && !rdy_clear;

assign x_read_rdy = rdy_update;

assign x_read_rdy_for_issue  = rdy || mla_rdy || load_issue_data_ready
                                              || vfpu0_vdsp_fwd_data_ready
                                              || vfpu1_vdsp_fwd_data_ready;
assign x_read_rdy_for_bypass = rdy;

always @(posedge dep_clk or negedge cpurst_b)
begin
  if(!cpurst_b)
    rdy <= 1'b1;
  else if(rtu_idu_flush_fe || rtu_idu_flush_is)
    rdy <= 1'b1;
  else if(x_write_en)
    rdy <= x_create_rdy;
  else
    rdy <= rdy_update;
end




assign lsu_match_update = lsu_idu_ag_pipe3_vload_inst_vld
                          && (lsu_idu_ag_pipe3_vreg_dupx[6:0] == vreg[6:0]);

assign x_read_lsu_match  = lsu_match_update;

always @(posedge dep_clk or negedge cpurst_b)
begin
  if(!cpurst_b)
    lsu_match <= 1'b0;
  else if(rtu_idu_flush_fe || rtu_idu_flush_is)
    lsu_match <= 1'b0;
  else if(x_write_en)
    lsu_match <= x_create_lsu_match;
  else
    lsu_match <= lsu_match_update;
end








assign vfpu0_fmla_data_ready     = x_entry_vmla
                                   && vfpu_idu_ex2_pipe6_fmla_data_vld_dupx
                                   && (vfpu_idu_ex2_pipe6_vreg_dupx[6:0] == vreg[6:0])
                                || x_entry_vmla
                                   && vfpu_idu_ex1_pipe6_fmla_data_vld_dupx
                                   && (vfpu_idu_ex1_pipe6_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu1_fmla_data_ready     = x_entry_vmla 
                                   && vfpu_idu_ex2_pipe7_fmla_data_vld_dupx
                                   && (vfpu_idu_ex2_pipe7_vreg_dupx[6:0] == vreg[6:0])
                                || x_entry_vmla 
                                   && vfpu_idu_ex1_pipe7_fmla_data_vld_dupx
                                   && (vfpu_idu_ex1_pipe7_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu0_vmla_data_ready     = x_entry_vmla
                                   && ctrl_xx_rf_pipe6_vmla_lch_vld_dupx
                                   && (dp_xx_rf_pipe6_dst_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu1_vmla_data_ready     = x_entry_vmla 
                                   && ctrl_xx_rf_pipe7_vmla_lch_vld_dupx
                                   && (dp_xx_rf_pipe7_dst_vreg_dupx[6:0] == vreg[6:0]);
assign vfpu0_vdsp_fwd_data_ready = x_entry_vmla 
                                   && vfpu0_vreg_fwd_vld;
assign vfpu1_vdsp_fwd_data_ready = x_entry_vmla 
                                   && vfpu1_vreg_fwd_vld;
assign mla_data_ready            = vfpu0_fmla_data_ready
                                   || vfpu1_fmla_data_ready
                                   || vfpu0_vmla_data_ready
                                   || vfpu1_vmla_data_ready
                                   || vfpu0_vdsp_fwd_data_ready
                                   || vfpu1_vdsp_fwd_data_ready;






assign mla_rdy_update = (mla_rdy || mla_data_ready || wake_up) && !rdy_clear;

assign x_read_mla_rdy = mla_rdy_update;

always @(posedge dep_clk or negedge cpurst_b)
begin
  if(!cpurst_b)
    mla_rdy <= 1'b1;
  else if(rtu_idu_flush_fe || rtu_idu_flush_is)
    mla_rdy <= 1'b1;
  else if(x_write_en)
    mla_rdy <= x_create_mla_rdy;
  else
    mla_rdy <= mla_rdy_update;
end









assign pipe3_wb = lsu_idu_wb_pipe3_wb_vreg_vld_dupx
                  && (lsu_idu_wb_pipe3_wb_vreg_dupx[6:0] == vreg[6:0]);
assign pipe6_wb = vfpu_idu_ex5_pipe6_wb_vreg_vld_dupx
                  && (vfpu_idu_ex5_pipe6_wb_vreg_dupx[6:0] == vreg[6:0]);
assign pipe7_wb = vfpu_idu_ex5_pipe7_wb_vreg_vld_dupx
                  && (vfpu_idu_ex5_pipe7_wb_vreg_dupx[6:0] == vreg[6:0]);
assign write_back = wb
                    || pipe3_wb
                    || pipe6_wb
                    || pipe7_wb;


assign x_read_wb = wb_update;
assign wb_update = wb || write_back;

always @(posedge dep_clk or negedge cpurst_b)
begin
  if(!cpurst_b)
    wb <= 1'b1;
  else if(rtu_idu_flush_fe || rtu_idu_flush_is)
    wb <= 1'b1;
  else if(x_write_en)
    wb <= x_create_wb;
  else
    wb <= wb_update;
end




assign x_read_vreg[6:0] = vreg[6:0];
always @(posedge write_clk or negedge cpurst_b)
begin
  if(!cpurst_b)
    vreg[6:0] <= 7'b0;
  else if(x_write_en)
    vreg[6:0] <= x_create_vreg[6:0];
  else
    vreg[6:0] <= vreg[6:0];
end


endmodule