data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v
1: b"%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:760: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry0_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:760: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry0_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                             ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:769: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry1_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:769: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry1_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                             ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:778: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry2_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:778: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry2_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                             ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:787: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry3_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:787: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry3_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                             ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:796: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry4_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:796: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry4_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                             ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:805: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry5_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:805: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry5_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                             ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:814: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'bx}};\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:814: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop0_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'bx}};\n                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:868: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry0_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:868: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry0_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:877: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry1_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:877: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry1_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:886: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry2_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:886: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry2_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:895: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry3_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:895: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry3_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:904: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry4_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:904: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry4_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:913: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry5_halt_info[`TDT_HINFO_WIDTH-1:0];\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:913: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry5_halt_info[`TDT_HINFO_WIDTH-1:0];\n                                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:922: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'bx}};\n                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:922: Define or directive not defined: '`TDT_HINFO_WIDTH'\n    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'bx}};\n                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1109: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign ibuf_create0_halt_info[`TDT_HINFO_WIDTH-1:0]  = ipack_ibuf_inst_two\n                              ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1111: Define or directive not defined: '`TDT_HINFO_WIDTH'\n                                    ? pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0]\n                                                           ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1112: Define or directive not defined: '`TDT_HINFO_WIDTH'\n                                    : pred_ibuf_halt_info0[`TDT_HINFO_WIDTH-1:0];\n                                                           ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1113: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign ibuf_create1_halt_info[`TDT_HINFO_WIDTH-1:0]  = pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];\n                              ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1113: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign ibuf_create1_halt_info[`TDT_HINFO_WIDTH-1:0]  = pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];\n                                                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1114: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign ibuf_create2_halt_info[`TDT_HINFO_WIDTH-1:0]  = pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];\n                              ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1114: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign ibuf_create2_halt_info[`TDT_HINFO_WIDTH-1:0]  = pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];\n                                                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1295: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign pop_entry0_create_halt_info[`TDT_HINFO_WIDTH-1:0] = pop0_vld ? pop0_halt_info[`TDT_HINFO_WIDTH-1:0]\n                                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1295: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign pop_entry0_create_halt_info[`TDT_HINFO_WIDTH-1:0] = pop0_vld ? pop0_halt_info[`TDT_HINFO_WIDTH-1:0]\n                                                                                     ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1296: Define or directive not defined: '`TDT_HINFO_WIDTH'\n                                    : idu_ifu_id_stall || pop_entry_vld ? pred_ibuf_halt_info0[`TDT_HINFO_WIDTH-1:0]\n                                                                                               ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1297: Define or directive not defined: '`TDT_HINFO_WIDTH'\n                                    : pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];\n                                                           ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1298: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign pop_entry1_create_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'b0}};\n                                   ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1298: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign pop_entry1_create_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'b0}};\n                                                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1327: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign pop_entry_halt_info[`TDT_HINFO_WIDTH-1:0]  = pop_entry0_halt_info[`TDT_HINFO_WIDTH-1:0] | pop_entry1_halt_info[`TDT_HINFO_WIDTH-1:0]; \n                           ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1327: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign pop_entry_halt_info[`TDT_HINFO_WIDTH-1:0]  = pop_entry0_halt_info[`TDT_HINFO_WIDTH-1:0] | pop_entry1_halt_info[`TDT_HINFO_WIDTH-1:0]; \n                                                                         ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1327: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign pop_entry_halt_info[`TDT_HINFO_WIDTH-1:0]  = pop_entry0_halt_info[`TDT_HINFO_WIDTH-1:0] | pop_entry1_halt_info[`TDT_HINFO_WIDTH-1:0]; \n                                                                                                                      ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1359: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign ifu_idu_id_halt_info[`TDT_HINFO_WIDTH-1:0]  = pop_entry_vld ? pop_entry_halt_info[`TDT_HINFO_WIDTH-1:0]\n                            ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1359: Define or directive not defined: '`TDT_HINFO_WIDTH'\nassign ifu_idu_id_halt_info[`TDT_HINFO_WIDTH-1:0]  = pop_entry_vld ? pop_entry_halt_info[`TDT_HINFO_WIDTH-1:0]\n                                                                                         ^~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/418750043/C906_RTL_FACTORY/gen_rtl/ifu/rtl/aq_ifu_ibuf.v:1360: Define or directive not defined: '`TDT_HINFO_WIDTH'\n                                                  : pred_ibuf_halt_info0[`TDT_HINFO_WIDTH-1:0];\n                                                                         ^~~~~~~~~~~~~~~~\n%Error: Exiting due to 47 error(s)\n"
module aq_ifu_ibuf(
  cp0_ifu_icg_en,
  cp0_yy_clk_en,
  cpurst_b,
  ctrl_ibuf_pop_en,
  dtu_ifu_debug_inst,
  dtu_ifu_debug_inst_vld,
  dtu_ifu_halt_info_vld,
  forever_cpuclk,
  ibuf_ctrl_inst_fetch,
  ibuf_ipack_stall,
  ibuf_pred_hungry,
  ibuf_pred_stall,
  ibuf_top_id_stall,
  ibuf_top_pop_entry_vld,
  ibuf_top_vld_num,
  idu_ifu_id_stall,
  ifu_idu_id_bht_pred,
  ifu_idu_id_expt_acc_error,
  ifu_idu_id_expt_high,
  ifu_idu_id_expt_page_fault,
  ifu_idu_id_halt_info,
  ifu_idu_id_inst,
  ifu_idu_id_inst_vld,
  ipack_ibuf_acc_err,
  ipack_ibuf_inst,
  ipack_ibuf_inst_all,
  ipack_ibuf_inst_full,
  ipack_ibuf_inst_one,
  ipack_ibuf_inst_two,
  ipack_ibuf_inst_vld,
  ipack_ibuf_inst_vld_raw,
  ipack_ibuf_pgflt,
  pad_yy_icg_scan_en,
  pcgen_ibuf_chgflw_vld,
  pred_ibuf_br_taken0,
  pred_ibuf_br_taken1,
  pred_ibuf_chgflw_vld0,
  pred_ibuf_halt_info0,
  pred_ibuf_halt_info1,
  rtu_ifu_flush_fe,
  rtu_yy_xx_dbgon,
  vec_ibuf_warm_up
);


input           cp0_ifu_icg_en;              
input           cp0_yy_clk_en;               
input           cpurst_b;                    
input           ctrl_ibuf_pop_en;            
input   [31:0]  dtu_ifu_debug_inst;          
input           dtu_ifu_debug_inst_vld;      
input           dtu_ifu_halt_info_vld;       
input           forever_cpuclk;              
input           idu_ifu_id_stall;            
input   [2 :0]  ipack_ibuf_acc_err;          
input   [47:0]  ipack_ibuf_inst;             
input           ipack_ibuf_inst_all;         
input           ipack_ibuf_inst_full;        
input           ipack_ibuf_inst_one;         
input           ipack_ibuf_inst_two;         
input           ipack_ibuf_inst_vld;         
input           ipack_ibuf_inst_vld_raw;     
input   [2 :0]  ipack_ibuf_pgflt;            
input           pad_yy_icg_scan_en;          
input           pcgen_ibuf_chgflw_vld;       
input   [1 :0]  pred_ibuf_br_taken0;         
input   [1 :0]  pred_ibuf_br_taken1;         
input           pred_ibuf_chgflw_vld0;       
input   [21:0]  pred_ibuf_halt_info0;        
input   [21:0]  pred_ibuf_halt_info1;        
input           rtu_ifu_flush_fe;            
input           rtu_yy_xx_dbgon;             
input           vec_ibuf_warm_up;            
output          ibuf_ctrl_inst_fetch;        
output          ibuf_ipack_stall;            
output          ibuf_pred_hungry;            
output          ibuf_pred_stall;             
output          ibuf_top_id_stall;           
output          ibuf_top_pop_entry_vld;      
output  [2 :0]  ibuf_top_vld_num;            
output  [1 :0]  ifu_idu_id_bht_pred;         
output          ifu_idu_id_expt_acc_error;   
output          ifu_idu_id_expt_high;        
output          ifu_idu_id_expt_page_fault;  
output  [21:0]  ifu_idu_id_halt_info;        
output  [31:0]  ifu_idu_id_inst;             
output          ifu_idu_id_inst_vld;         


reg     [5 :0]  pop0;                        
reg             pop0_acc_err;                
reg     [21:0]  pop0_halt_info;              
reg     [15:0]  pop0_inst;                   
reg             pop0_pgflt;                  
reg     [1 :0]  pop0_pred_taken;             
reg     [5 :0]  pop0_shift;                  
reg             pop0_vld;                    
reg             pop1_acc_err;                
reg     [21:0]  pop1_halt_info;              
reg     [15:0]  pop1_inst;                   
reg             pop1_pgflt;                  
reg     [1 :0]  pop1_pred_taken;             
reg             pop1_vld;                    
reg     [5 :0]  push0;                       
reg     [5 :0]  push0_shift;                 


wire            cp0_ifu_icg_en;              
wire            cp0_yy_clk_en;               
wire            cpurst_b;                    
wire            ctrl_ibuf_pop_en;            
wire            dtu_create0_en;              
wire            dtu_create1_en;              
wire    [31:0]  dtu_ifu_debug_inst;          
wire            dtu_ifu_debug_inst_vld;      
wire            dtu_ifu_halt_info_vld;       
wire            entry0_acc_err;              
wire            entry0_create0_data_en;      
wire            entry0_create0_en;           
wire            entry0_create1_data_en;      
wire            entry0_create1_en;           
wire            entry0_create2_data_en;      
wire            entry0_create2_en;           
wire    [21:0]  entry0_halt_info;            
wire    [15:0]  entry0_inst;                 
wire            entry0_pgflt;                
wire    [1 :0]  entry0_pred_taken;           
wire            entry0_retire0_en;           
wire            entry0_retire1_en;           
wire            entry0_vld;                  
wire            entry1_acc_err;              
wire            entry1_create0_data_en;      
wire            entry1_create0_en;           
wire            entry1_create1_data_en;      
wire            entry1_create1_en;           
wire            entry1_create2_data_en;      
wire            entry1_create2_en;           
wire    [21:0]  entry1_halt_info;            
wire    [15:0]  entry1_inst;                 
wire            entry1_pgflt;                
wire    [1 :0]  entry1_pred_taken;           
wire            entry1_retire0_en;           
wire            entry1_retire1_en;           
wire            entry1_vld;                  
wire            entry2_acc_err;              
wire            entry2_create0_data_en;      
wire            entry2_create0_en;           
wire            entry2_create1_data_en;      
wire            entry2_create1_en;           
wire            entry2_create2_data_en;      
wire            entry2_create2_en;           
wire    [21:0]  entry2_halt_info;            
wire    [15:0]  entry2_inst;                 
wire            entry2_pgflt;                
wire    [1 :0]  entry2_pred_taken;           
wire            entry2_retire0_en;           
wire            entry2_retire1_en;           
wire            entry2_vld;                  
wire            entry3_acc_err;              
wire            entry3_create0_data_en;      
wire            entry3_create0_en;           
wire            entry3_create1_data_en;      
wire            entry3_create1_en;           
wire            entry3_create2_data_en;      
wire            entry3_create2_en;           
wire    [21:0]  entry3_halt_info;            
wire    [15:0]  entry3_inst;                 
wire            entry3_pgflt;                
wire    [1 :0]  entry3_pred_taken;           
wire            entry3_retire0_en;           
wire            entry3_retire1_en;           
wire            entry3_vld;                  
wire            entry4_acc_err;              
wire            entry4_create0_data_en;      
wire            entry4_create0_en;           
wire            entry4_create1_data_en;      
wire            entry4_create1_en;           
wire            entry4_create2_data_en;      
wire            entry4_create2_en;           
wire    [21:0]  entry4_halt_info;            
wire    [15:0]  entry4_inst;                 
wire            entry4_pgflt;                
wire    [1 :0]  entry4_pred_taken;           
wire            entry4_retire0_en;           
wire            entry4_retire1_en;           
wire            entry4_vld;                  
wire            entry5_acc_err;              
wire            entry5_create0_data_en;      
wire            entry5_create0_en;           
wire            entry5_create1_data_en;      
wire            entry5_create1_en;           
wire            entry5_create2_data_en;      
wire            entry5_create2_en;           
wire    [21:0]  entry5_halt_info;            
wire    [15:0]  entry5_inst;                 
wire            entry5_pgflt;                
wire    [1 :0]  entry5_pred_taken;           
wire            entry5_retire0_en;           
wire            entry5_retire1_en;           
wire            entry5_vld;                  
wire            forever_cpuclk;              
wire            ibuf_cpuclk;                 
wire            ibuf_create0_acc_err;        
wire            ibuf_create0_data_en;        
wire            ibuf_create0_en;             
wire    [21:0]  ibuf_create0_halt_info;      
wire    [15:0]  ibuf_create0_inst;           
wire            ibuf_create0_pgflt;          
wire    [1 :0]  ibuf_create0_pred_taken;     
wire            ibuf_create1_acc_err;        
wire            ibuf_create1_data_en;        
wire            ibuf_create1_en;             
wire    [21:0]  ibuf_create1_halt_info;      
wire    [15:0]  ibuf_create1_inst;           
wire            ibuf_create1_pgflt;          
wire    [1 :0]  ibuf_create1_pred_taken;     
wire            ibuf_create2_acc_err;        
wire            ibuf_create2_data_en;        
wire            ibuf_create2_en;             
wire    [21:0]  ibuf_create2_halt_info;      
wire    [15:0]  ibuf_create2_inst;           
wire            ibuf_create2_pgflt;          
wire    [1 :0]  ibuf_create2_pred_taken;     
wire            ibuf_ctrl_inst_fetch;        
wire            ibuf_empty;                  
wire            ibuf_entry_stall;            
wire            ibuf_five_avalbe;            
wire            ibuf_flush_en;               
wire            ibuf_four_avalbe;            
wire            ibuf_full;                   
wire            ibuf_icg_en;                 
wire            ibuf_inst32;                 
wire            ibuf_inst_32_vld;            
wire            ibuf_inst_fetch;             
wire            ibuf_ipack_stall;            
wire            ibuf_one_avalbe;             
wire            ibuf_pred_hungry;            
wire            ibuf_pred_stall;             
wire            ibuf_retire0_en;             
wire            ibuf_retire0_en_vld;         
wire            ibuf_retire1_en;             
wire            ibuf_stall;                  
wire            ibuf_top_id_stall;           
wire            ibuf_top_pop_entry_vld;      
wire    [2 :0]  ibuf_top_vld_num;            
wire            ibuf_two_avalbe;             
wire    [2 :0]  ibuf_vld_num;                
wire            idu_ifu_id_stall;            
wire    [1 :0]  ifu_idu_id_bht_pred;         
wire            ifu_idu_id_expt_acc_error;   
wire            ifu_idu_id_expt_high;        
wire            ifu_idu_id_expt_page_fault;  
wire    [21:0]  ifu_idu_id_halt_info;        
wire    [31:0]  ifu_idu_id_inst;             
wire            ifu_idu_id_inst_vld;         
wire            ipack_bypass_vld;            
wire            ipack_create0_data_en;       
wire            ipack_create0_en;            
wire            ipack_create1_data_en;       
wire            ipack_create1_en;            
wire            ipack_expt_high;             
wire    [2 :0]  ipack_ibuf_acc_err;          
wire    [47:0]  ipack_ibuf_inst;             
wire            ipack_ibuf_inst_all;         
wire            ipack_ibuf_inst_full;        
wire            ipack_ibuf_inst_one;         
wire            ipack_ibuf_inst_two;         
wire            ipack_ibuf_inst_vld;         
wire            ipack_ibuf_inst_vld_raw;     
wire    [2 :0]  ipack_ibuf_pgflt;            
wire            ipack_inst_32;               
wire            pad_yy_icg_scan_en;          
wire            pcgen_ibuf_chgflw_vld;       
wire            pop0_inst_32;                
wire    [5 :0]  pop1;                        
wire            pop_entry0_acc_err;          
wire            pop_entry0_create_acc_err;   
wire            pop_entry0_create_data_en;   
wire            pop_entry0_create_en;        
wire    [21:0]  pop_entry0_create_halt_info; 
wire    [15:0]  pop_entry0_create_inst;      
wire            pop_entry0_create_pgflt;     
wire    [1 :0]  pop_entry0_create_pred_taken; 
wire    [21:0]  pop_entry0_halt_info;        
wire    [15:0]  pop_entry0_inst;             
wire            pop_entry0_pgflt;            
wire    [1 :0]  pop_entry0_pred_taken;       
wire            pop_entry0_retire_en;        
wire            pop_entry0_vld;              
wire            pop_entry1_acc_err;          
wire            pop_entry1_create_acc_err;   
wire            pop_entry1_create_data_en;   
wire            pop_entry1_create_en;        
wire    [21:0]  pop_entry1_create_halt_info; 
wire    [15:0]  pop_entry1_create_inst;      
wire            pop_entry1_create_pgflt;     
wire    [1 :0]  pop_entry1_create_pred_taken; 
wire    [21:0]  pop_entry1_halt_info;        
wire    [15:0]  pop_entry1_inst;             
wire            pop_entry1_pgflt;            
wire    [1 :0]  pop_entry1_pred_taken;       
wire            pop_entry1_retire_en;        
wire            pop_entry1_vld;              
wire            pop_entry_acc_err;           
wire            pop_entry_expt_high;         
wire    [21:0]  pop_entry_halt_info;         
wire    [31:0]  pop_entry_inst;              
wire            pop_entry_pgflt;             
wire    [1 :0]  pop_entry_pred_taken;        
wire            pop_entry_vld;               
wire    [1 :0]  pred_ibuf_br_taken0;         
wire    [1 :0]  pred_ibuf_br_taken1;         
wire            pred_ibuf_chgflw_vld0;       
wire    [21:0]  pred_ibuf_halt_info0;        
wire    [21:0]  pred_ibuf_halt_info1;        
wire    [5 :0]  push0_bypass;                
wire    [5 :0]  push1;                       
wire    [5 :0]  push1_bypass;                
wire    [5 :0]  push2;                       
wire    [5 :0]  push2_bypass;                
wire            rtu_ifu_flush_fe;            
wire            rtu_yy_xx_dbgon;             
wire            vec_ibuf_warm_up;            















assign ibuf_icg_en = !ibuf_empty
                   || pop0_vld
                   || pop_entry_vld
                   || ipack_ibuf_inst_vld
                   || dtu_create0_en;

gated_clk_cell  x_ifu_ibuf_icg_cell (
  .clk_in             (forever_cpuclk    ),
  .clk_out            (ibuf_cpuclk       ),
  .external_en        (1'b0              ),
  .global_en          (cp0_yy_clk_en     ),
  .local_en           (ibuf_icg_en       ),
  .module_en          (cp0_ifu_icg_en    ),
  .pad_yy_icg_scan_en (pad_yy_icg_scan_en)
);












parameter ENTRY_NUM = 6;



aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry0 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry0_acc_err            ),
  .ibuf_entry_create0_data_en (entry0_create0_data_en    ),
  .ibuf_entry_create0_en      (entry0_create0_en         ),
  .ibuf_entry_create1_data_en (entry0_create1_data_en    ),
  .ibuf_entry_create1_en      (entry0_create1_en         ),
  .ibuf_entry_create2_data_en (entry0_create2_data_en    ),
  .ibuf_entry_create2_en      (entry0_create2_en         ),
  .ibuf_entry_halt_info       (entry0_halt_info          ),
  .ibuf_entry_inst            (entry0_inst               ),
  .ibuf_entry_pgflt           (entry0_pgflt              ),
  .ibuf_entry_pred_taken      (entry0_pred_taken         ),
  .ibuf_entry_retire0_en      (entry0_retire0_en         ),
  .ibuf_entry_retire1_en      (entry0_retire1_en         ),
  .ibuf_entry_vld             (entry0_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);




aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry1 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry1_acc_err            ),
  .ibuf_entry_create0_data_en (entry1_create0_data_en    ),
  .ibuf_entry_create0_en      (entry1_create0_en         ),
  .ibuf_entry_create1_data_en (entry1_create1_data_en    ),
  .ibuf_entry_create1_en      (entry1_create1_en         ),
  .ibuf_entry_create2_data_en (entry1_create2_data_en    ),
  .ibuf_entry_create2_en      (entry1_create2_en         ),
  .ibuf_entry_halt_info       (entry1_halt_info          ),
  .ibuf_entry_inst            (entry1_inst               ),
  .ibuf_entry_pgflt           (entry1_pgflt              ),
  .ibuf_entry_pred_taken      (entry1_pred_taken         ),
  .ibuf_entry_retire0_en      (entry1_retire0_en         ),
  .ibuf_entry_retire1_en      (entry1_retire1_en         ),
  .ibuf_entry_vld             (entry1_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);




aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry2 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry2_acc_err            ),
  .ibuf_entry_create0_data_en (entry2_create0_data_en    ),
  .ibuf_entry_create0_en      (entry2_create0_en         ),
  .ibuf_entry_create1_data_en (entry2_create1_data_en    ),
  .ibuf_entry_create1_en      (entry2_create1_en         ),
  .ibuf_entry_create2_data_en (entry2_create2_data_en    ),
  .ibuf_entry_create2_en      (entry2_create2_en         ),
  .ibuf_entry_halt_info       (entry2_halt_info          ),
  .ibuf_entry_inst            (entry2_inst               ),
  .ibuf_entry_pgflt           (entry2_pgflt              ),
  .ibuf_entry_pred_taken      (entry2_pred_taken         ),
  .ibuf_entry_retire0_en      (entry2_retire0_en         ),
  .ibuf_entry_retire1_en      (entry2_retire1_en         ),
  .ibuf_entry_vld             (entry2_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);




aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry3 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry3_acc_err            ),
  .ibuf_entry_create0_data_en (entry3_create0_data_en    ),
  .ibuf_entry_create0_en      (entry3_create0_en         ),
  .ibuf_entry_create1_data_en (entry3_create1_data_en    ),
  .ibuf_entry_create1_en      (entry3_create1_en         ),
  .ibuf_entry_create2_data_en (entry3_create2_data_en    ),
  .ibuf_entry_create2_en      (entry3_create2_en         ),
  .ibuf_entry_halt_info       (entry3_halt_info          ),
  .ibuf_entry_inst            (entry3_inst               ),
  .ibuf_entry_pgflt           (entry3_pgflt              ),
  .ibuf_entry_pred_taken      (entry3_pred_taken         ),
  .ibuf_entry_retire0_en      (entry3_retire0_en         ),
  .ibuf_entry_retire1_en      (entry3_retire1_en         ),
  .ibuf_entry_vld             (entry3_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);




aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry4 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry4_acc_err            ),
  .ibuf_entry_create0_data_en (entry4_create0_data_en    ),
  .ibuf_entry_create0_en      (entry4_create0_en         ),
  .ibuf_entry_create1_data_en (entry4_create1_data_en    ),
  .ibuf_entry_create1_en      (entry4_create1_en         ),
  .ibuf_entry_create2_data_en (entry4_create2_data_en    ),
  .ibuf_entry_create2_en      (entry4_create2_en         ),
  .ibuf_entry_halt_info       (entry4_halt_info          ),
  .ibuf_entry_inst            (entry4_inst               ),
  .ibuf_entry_pgflt           (entry4_pgflt              ),
  .ibuf_entry_pred_taken      (entry4_pred_taken         ),
  .ibuf_entry_retire0_en      (entry4_retire0_en         ),
  .ibuf_entry_retire1_en      (entry4_retire1_en         ),
  .ibuf_entry_vld             (entry4_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);




aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry5 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry5_acc_err            ),
  .ibuf_entry_create0_data_en (entry5_create0_data_en    ),
  .ibuf_entry_create0_en      (entry5_create0_en         ),
  .ibuf_entry_create1_data_en (entry5_create1_data_en    ),
  .ibuf_entry_create1_en      (entry5_create1_en         ),
  .ibuf_entry_create2_data_en (entry5_create2_data_en    ),
  .ibuf_entry_create2_en      (entry5_create2_en         ),
  .ibuf_entry_halt_info       (entry5_halt_info          ),
  .ibuf_entry_inst            (entry5_inst               ),
  .ibuf_entry_pgflt           (entry5_pgflt              ),
  .ibuf_entry_pred_taken      (entry5_pred_taken         ),
  .ibuf_entry_retire0_en      (entry5_retire0_en         ),
  .ibuf_entry_retire1_en      (entry5_retire1_en         ),
  .ibuf_entry_vld             (entry5_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);









assign ibuf_retire0_en = pop0_vld && ctrl_ibuf_pop_en;
assign ibuf_retire1_en = ibuf_inst32 && ctrl_ibuf_pop_en;

assign ibuf_retire0_en_vld = ibuf_retire0_en;
assign ibuf_inst_32_vld = ibuf_inst32;

assign ibuf_flush_en   = rtu_ifu_flush_fe || pcgen_ibuf_chgflw_vld;


always @(posedge ibuf_cpuclk or negedge cpurst_b)
begin
  if(!cpurst_b)
    pop0[ENTRY_NUM-1:0] <= {{(ENTRY_NUM-1){1'b0}}, 1'b1};
  else if(ibuf_flush_en)
    pop0[ENTRY_NUM-1:0] <= pop0[ENTRY_NUM-1:0];
  else if(ibuf_retire0_en_vld)
    pop0[ENTRY_NUM-1:0] <= pop0_shift[ENTRY_NUM-1:0];


end


always @( pop0[5:0]
       or ibuf_inst_32_vld)
begin
  if(ibuf_inst_32_vld)
    pop0_shift[ENTRY_NUM-1:0] = {pop0[ENTRY_NUM-3:0],
                                 pop0[ENTRY_NUM-1:ENTRY_NUM-2]};
  else
    pop0_shift[ENTRY_NUM-1:0] = {pop0[ENTRY_NUM-2:0],
                                 pop0[ENTRY_NUM-1]};

end











assign {entry5_retire0_en,
        entry4_retire0_en,
        entry3_retire0_en,
        entry2_retire0_en,
        entry1_retire0_en,
        entry0_retire0_en} = pop0[ENTRY_NUM-1:0] & {ENTRY_NUM{ibuf_retire0_en}};


assign pop1[ENTRY_NUM-1:0] = {pop0[ENTRY_NUM-2:0],
                              pop0[ENTRY_NUM-1]};


assign {entry5_retire1_en,
        entry4_retire1_en,
        entry3_retire1_en,
        entry2_retire1_en,
        entry1_retire1_en,
        entry0_retire1_en} = pop1[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_retire1_en}};


always @( entry1_acc_err
       or entry2_inst[15:0]
       or entry1_pgflt
       or entry5_inst[15:0]
       or entry4_halt_info[21:0]
       or entry0_acc_err
       or entry2_pgflt
       or entry0_pgflt
       or entry5_vld
       or entry5_pgflt
       or entry0_vld
       or entry1_inst[15:0]
       or entry2_acc_err
       or entry2_halt_info[21:0]
       or pop0[5:0]
       or entry3_pred_taken[1:0]
       or entry3_acc_err
       or entry3_pgflt
       or entry1_vld
       or entry4_pgflt
       or entry0_halt_info[21:0]
       or entry3_halt_info[21:0]
       or entry4_acc_err
       or entry4_pred_taken[1:0]
       or entry0_pred_taken[1:0]
       or entry5_acc_err
       or entry1_halt_info[21:0]
       or entry4_inst[15:0]
       or entry2_vld
       or entry3_vld
       or entry5_pred_taken[1:0]
       or entry4_vld
       or entry5_halt_info[21:0]
       or entry3_inst[15:0]
       or entry2_pred_taken[1:0]
       or entry1_pred_taken[1:0]
       or entry0_inst[15:0])
begin
  case(pop0[ENTRY_NUM-1:0])
  6'b0001:
  begin
    pop0_vld          = entry0_vld;
    pop0_inst[15:0]   = entry0_inst[15:0];
    pop0_pred_taken[1:0] = entry0_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry0_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry0_acc_err;
    pop0_pgflt        = entry0_pgflt;
  end
  6'b0010:
  begin
    pop0_vld          = entry1_vld;
    pop0_inst[15:0]   = entry1_inst[15:0];
    pop0_pred_taken[1:0] = entry1_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry1_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry1_acc_err;
    pop0_pgflt        = entry1_pgflt;
  end
  6'b0100:
  begin
    pop0_vld          = entry2_vld;
    pop0_inst[15:0]   = entry2_inst[15:0];
    pop0_pred_taken[1:0] = entry2_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry2_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry2_acc_err;
    pop0_pgflt        = entry2_pgflt;
  end
  6'b1000:
  begin
    pop0_vld          = entry3_vld;
    pop0_inst[15:0]   = entry3_inst[15:0];
    pop0_pred_taken[1:0] = entry3_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry3_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry3_acc_err;
    pop0_pgflt        = entry3_pgflt;
  end
  6'b10000:
  begin
    pop0_vld          = entry4_vld;
    pop0_inst[15:0]   = entry4_inst[15:0];
    pop0_pred_taken[1:0] = entry4_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry4_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry4_acc_err;
    pop0_pgflt        = entry4_pgflt;
  end
  6'b100000:
  begin
    pop0_vld          = entry5_vld;
    pop0_inst[15:0]   = entry5_inst[15:0];
    pop0_pred_taken[1:0] = entry5_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry5_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry5_acc_err;
    pop0_pgflt        = entry5_pgflt;
  end
  default:
  begin
    pop0_vld          = 1'bx;
    pop0_inst[15:0]   = 16'bx;
    pop0_pred_taken[1:0] = 2'bx;
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'bx}};
    pop0_acc_err      = 1'bx;
    pop0_pgflt        = 1'bx;
  end
  endcase

end



always @( entry1_acc_err
       or entry2_inst[15:0]
       or entry1_pgflt
       or entry5_inst[15:0]
       or entry4_halt_info[21:0]
       or entry0_acc_err
       or entry0_pgflt
       or entry2_pgflt
       or entry5_vld
       or entry5_pgflt
       or entry0_vld
       or entry1_inst[15:0]
       or entry2_acc_err
       or entry2_halt_info[21:0]
       or pop1[5:0]
       or entry3_pred_taken[1:0]
       or entry3_pgflt
       or entry3_acc_err
       or entry4_pgflt
       or entry1_vld
       or entry0_halt_info[21:0]
       or entry3_halt_info[21:0]
       or entry4_acc_err
       or entry4_pred_taken[1:0]
       or entry0_pred_taken[1:0]
       or entry5_acc_err
       or entry1_halt_info[21:0]
       or entry4_inst[15:0]
       or entry2_vld
       or entry3_vld
       or entry5_pred_taken[1:0]
       or entry4_vld
       or entry5_halt_info[21:0]
       or entry3_inst[15:0]
       or entry2_pred_taken[1:0]
       or entry1_pred_taken[1:0]
       or entry0_inst[15:0])
begin
  case(pop1[ENTRY_NUM-1:0])
  6'b0001:
  begin
    pop1_vld          = entry0_vld;
    pop1_inst[15:0]   = entry0_inst[15:0];
    pop1_pred_taken[1:0] = entry0_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry0_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry0_acc_err;
    pop1_pgflt        = entry0_pgflt;
  end
  6'b0010:
  begin
    pop1_vld          = entry1_vld;
    pop1_inst[15:0]   = entry1_inst[15:0];
    pop1_pred_taken[1:0] = entry1_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry1_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry1_acc_err;
    pop1_pgflt        = entry1_pgflt;
  end
  6'b0100:
  begin
    pop1_vld          = entry2_vld;
    pop1_inst[15:0]   = entry2_inst[15:0];
    pop1_pred_taken[1:0] = entry2_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry2_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry2_acc_err;
    pop1_pgflt        = entry2_pgflt;
  end
  6'b1000:
  begin
    pop1_vld          = entry3_vld;
    pop1_inst[15:0]   = entry3_inst[15:0];
    pop1_pred_taken[1:0] = entry3_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry3_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry3_acc_err;
    pop1_pgflt        = entry3_pgflt;
  end
  6'b10000:
  begin
    pop1_vld          = entry4_vld;
    pop1_inst[15:0]   = entry4_inst[15:0];
    pop1_pred_taken[1:0] = entry4_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry4_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry4_acc_err;
    pop1_pgflt        = entry4_pgflt;
  end
  6'b100000:
  begin
    pop1_vld          = entry5_vld;
    pop1_inst[15:0]   = entry5_inst[15:0];
    pop1_pred_taken[1:0] = entry5_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry5_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry5_acc_err;
    pop1_pgflt        = entry5_pgflt;
  end
  default:
  begin
    pop1_vld          = 1'bx;
    pop1_inst[15:0]   = 16'bx;
    pop1_pred_taken[1:0] = 2'bx;
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'bx}};
    pop1_acc_err      = 1'bx;
    pop1_pgflt        = 1'bx;
  end
  endcase

end









assign ipack_bypass_vld = ibuf_empty && ipack_ibuf_inst_vld;
assign ipack_create0_en = ipack_ibuf_inst_vld
                        && !(ibuf_empty && 
                             (ipack_ibuf_inst_two && !pop_entry_vld && !idu_ifu_id_stall
                               || ipack_ibuf_inst_one && !pop_entry_vld
                               || ipack_ibuf_inst_one && !idu_ifu_id_stall
                               || ipack_inst_32 && !ipack_ibuf_inst_all && !pop_entry_vld
                               || ipack_inst_32 && !ipack_ibuf_inst_all && !idu_ifu_id_stall));

assign ipack_create0_data_en = ipack_ibuf_inst_vld_raw && !ibuf_entry_stall
                            && (!ibuf_empty || pop_entry_vld || ipack_ibuf_inst_two);
assign dtu_create0_en   = rtu_yy_xx_dbgon && dtu_ifu_debug_inst_vld;

assign ibuf_create0_en  = ipack_create0_en || dtu_create0_en;
assign ibuf_create0_data_en  = ipack_create0_data_en || dtu_create0_en;



assign ipack_create1_en = ipack_ibuf_inst_vld && !ipack_ibuf_inst_one
                        && (!ibuf_empty || idu_ifu_id_stall && pop_entry_vld);
assign ipack_create1_data_en = ipack_ibuf_inst_vld_raw && !ibuf_entry_stall && !ipack_ibuf_inst_one
                        && (!ibuf_empty || pop_entry_vld);
assign dtu_create1_en   = dtu_create0_en && dtu_ifu_debug_inst[1:0] == 2'b11;

assign ibuf_create1_en  = ipack_create1_en || dtu_create1_en;
assign ibuf_create1_data_en  = ipack_create1_data_en || dtu_create1_en;


assign ibuf_create2_en = ipack_ibuf_inst_vld && ipack_ibuf_inst_all 
                        && !pred_ibuf_chgflw_vld0
                        && (!ibuf_empty || idu_ifu_id_stall && pop_entry_vld);
assign ibuf_create2_data_en = ipack_ibuf_inst_vld_raw && !ibuf_entry_stall && ipack_ibuf_inst_all 
                        && !pred_ibuf_chgflw_vld0
                        && (!ibuf_empty || pop_entry_vld);



always @(posedge ibuf_cpuclk or negedge cpurst_b)
begin
  if(!cpurst_b)
    push0[ENTRY_NUM-1:0] <= {{(ENTRY_NUM-1){1'b0}}, 1'b1};
  else if(ibuf_flush_en)
    push0[ENTRY_NUM-1:0] <= pop0[ENTRY_NUM-1:0];
  else if(ibuf_create0_en)
    push0[ENTRY_NUM-1:0] <= push0_shift[ENTRY_NUM-1:0];
end


always @( push0[5:0]
       or ibuf_create1_en
       or ibuf_create2_en)
begin
  if(ibuf_create2_en)
    push0_shift[ENTRY_NUM-1:0] = {push0[ENTRY_NUM-4:0],
                                  push0[ENTRY_NUM-1:ENTRY_NUM-3]};
  else if(ibuf_create1_en)
    push0_shift[ENTRY_NUM-1:0] = {push0[ENTRY_NUM-3:0],
                                  push0[ENTRY_NUM-1:ENTRY_NUM-2]};
  else
    push0_shift[ENTRY_NUM-1:0] = {push0[ENTRY_NUM-2:0],
                                  push0[ENTRY_NUM-1]};

end












assign push0_bypass[ENTRY_NUM-1:0] = push0[ENTRY_NUM-1:0];


assign {entry5_create0_en,
        entry4_create0_en,
        entry3_create0_en,
        entry2_create0_en,
        entry1_create0_en,
        entry0_create0_en} = push0_bypass[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create0_en}};

assign {entry5_create0_data_en,
        entry4_create0_data_en,
        entry3_create0_data_en,
        entry2_create0_data_en,
        entry1_create0_data_en,
        entry0_create0_data_en} = push0[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create0_data_en}};


assign push1[ENTRY_NUM-1:0] = {push0[ENTRY_NUM-2:0],
                               push0[ENTRY_NUM-1]};


assign push1_bypass[ENTRY_NUM-1:0] = {push0_bypass[ENTRY_NUM-2:0],
                                      push0_bypass[ENTRY_NUM-1]};


assign {entry5_create1_en,
        entry4_create1_en,
        entry3_create1_en,
        entry2_create1_en,
        entry1_create1_en,
        entry0_create1_en} = push1_bypass[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create1_en}};

assign {entry5_create1_data_en,
        entry4_create1_data_en,
        entry3_create1_data_en,
        entry2_create1_data_en,
        entry1_create1_data_en,
        entry0_create1_data_en} = push1[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create1_data_en}};


assign push2[ENTRY_NUM-1:0] = {push0[ENTRY_NUM-3:0],
                               push0[ENTRY_NUM-1:ENTRY_NUM-2]};


assign push2_bypass[ENTRY_NUM-1:0] = {push0_bypass[ENTRY_NUM-3:0],
                                      push0_bypass[ENTRY_NUM-1:ENTRY_NUM-2]};


assign {entry5_create2_en,
        entry4_create2_en,
        entry3_create2_en,
        entry2_create2_en,
        entry1_create2_en,
        entry0_create2_en} = push2_bypass[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create2_en}};

assign {entry5_create2_data_en,
        entry4_create2_data_en,
        entry3_create2_data_en,
        entry2_create2_data_en,
        entry1_create2_data_en,
        entry0_create2_data_en} = push2[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create2_data_en}};


assign ipack_inst_32 = ipack_ibuf_inst[1:0] == 2'b11;
assign ibuf_create0_inst[15:0] =
                                  rtu_yy_xx_dbgon ? dtu_ifu_debug_inst[15:0]


                               : ipack_ibuf_inst_full && (!pop_entry_vld 
                                      || !idu_ifu_id_stall && ibuf_empty)
                               ? ipack_ibuf_inst[47:32]


                               : ipack_ibuf_inst_two && !ipack_inst_32 
                                   && (!pop_entry_vld || !idu_ifu_id_stall && ibuf_empty)
                               ? ipack_ibuf_inst[31:16]
                               : ipack_ibuf_inst[15:0];
assign ibuf_create1_inst[15:0] =
                                 rtu_yy_xx_dbgon ? dtu_ifu_debug_inst[31:16]
                               : ipack_ibuf_inst[31:16];
assign ibuf_create2_inst[15:0] = ipack_ibuf_inst[47:32];

assign ibuf_create0_pred_taken[1:0] = ipack_ibuf_inst_two
                                   && (!pop_entry_vld || !idu_ifu_id_stall && ibuf_empty)
                                    ? pred_ibuf_br_taken1[1:0]
                                    : pred_ibuf_br_taken0[1:0];
assign ibuf_create1_pred_taken[1:0] = pred_ibuf_br_taken1[1:0];
assign ibuf_create2_pred_taken[1:0] = pred_ibuf_br_taken1[1:0];

assign ibuf_create0_halt_info[`TDT_HINFO_WIDTH-1:0]  = ipack_ibuf_inst_two
                                   && (!pop_entry_vld || !idu_ifu_id_stall && ibuf_empty)
                                    ? pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0]
                                    : pred_ibuf_halt_info0[`TDT_HINFO_WIDTH-1:0];
assign ibuf_create1_halt_info[`TDT_HINFO_WIDTH-1:0]  = pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];
assign ibuf_create2_halt_info[`TDT_HINFO_WIDTH-1:0]  = pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];

assign ibuf_create0_acc_err    = ipack_ibuf_acc_err[0];
assign ibuf_create1_acc_err    = ipack_ibuf_acc_err[1];
assign ibuf_create2_acc_err    = ipack_ibuf_acc_err[2];

assign ibuf_create0_pgflt    = ipack_ibuf_pgflt[0];
assign ibuf_create1_pgflt    = ipack_ibuf_pgflt[1];
assign ibuf_create2_pgflt    = ipack_ibuf_pgflt[2];








assign ibuf_vld_num[2:0] = {2'b0, entry0_vld}
                         + {2'b0, entry1_vld}
                         + {2'b0, entry2_vld}
                         + {2'b0, entry3_vld}
                         + {2'b0, entry4_vld}
                         + {2'b0, entry5_vld};

assign ibuf_full         = ibuf_vld_num[2:0] == 3'b110; 
assign ibuf_one_avalbe   = ibuf_vld_num[2:0] == 3'b101; 
assign ibuf_two_avalbe   = ibuf_vld_num[2:0] == 3'b100; 

assign ibuf_four_avalbe  = ibuf_vld_num[2:0] == 3'b010;       
assign ibuf_five_avalbe  = ibuf_vld_num[2:0] == 3'b001;       

assign ibuf_empty        = !(entry0_vld || entry1_vld || entry2_vld
                          || entry3_vld || entry4_vld || entry5_vld);




assign pop0_inst_32  = pop0_inst[1:0] == 2'b11;
assign ibuf_inst32   = pop0_vld && pop1_vld && pop0_inst_32;





































assign ibuf_entry_stall = ibuf_full && ipack_ibuf_inst_vld_raw
                       || ibuf_one_avalbe && ipack_ibuf_inst_vld_raw
                          && !ipack_ibuf_inst_one
                       || ibuf_two_avalbe && ipack_ibuf_inst_full;
assign ibuf_stall       = ibuf_entry_stall || !dtu_ifu_halt_info_vld && ipack_ibuf_inst_vld_raw;
assign ibuf_inst_fetch = 1'b1;






aq_ifu_ibuf_pop_entry  x_aq_ifu_ibuf_pop_entry0 (
  .cp0_ifu_icg_en               (cp0_ifu_icg_en              ),
  .cp0_yy_clk_en                (cp0_yy_clk_en               ),
  .cpurst_b                     (cpurst_b                    ),
  .forever_cpuclk               (forever_cpuclk              ),
  .ibuf_cpuclk                  (ibuf_cpuclk                 ),
  .ibuf_entry_acc_err           (pop_entry0_acc_err          ),
  .ibuf_entry_create_acc_err    (pop_entry0_create_acc_err   ),
  .ibuf_entry_create_data_en    (pop_entry0_create_data_en   ),
  .ibuf_entry_create_en         (pop_entry0_create_en        ),
  .ibuf_entry_create_halt_info  (pop_entry0_create_halt_info ),
  .ibuf_entry_create_inst       (pop_entry0_create_inst      ),
  .ibuf_entry_create_pgflt      (pop_entry0_create_pgflt     ),
  .ibuf_entry_create_pred_taken (pop_entry0_create_pred_taken),
  .ibuf_entry_halt_info         (pop_entry0_halt_info        ),
  .ibuf_entry_inst              (pop_entry0_inst             ),
  .ibuf_entry_pgflt             (pop_entry0_pgflt            ),
  .ibuf_entry_pred_taken        (pop_entry0_pred_taken       ),
  .ibuf_entry_retire_en         (pop_entry0_retire_en        ),
  .ibuf_entry_vld               (pop_entry0_vld              ),
  .ibuf_flush_en                (ibuf_flush_en               ),
  .pad_yy_icg_scan_en           (pad_yy_icg_scan_en          ),
  .vec_ibuf_warm_up             (vec_ibuf_warm_up            )
);




aq_ifu_ibuf_pop_entry  x_aq_ifu_ibuf_pop_entry1 (
  .cp0_ifu_icg_en               (cp0_ifu_icg_en              ),
  .cp0_yy_clk_en                (cp0_yy_clk_en               ),
  .cpurst_b                     (cpurst_b                    ),
  .forever_cpuclk               (forever_cpuclk              ),
  .ibuf_cpuclk                  (ibuf_cpuclk                 ),
  .ibuf_entry_acc_err           (pop_entry1_acc_err          ),
  .ibuf_entry_create_acc_err    (pop_entry1_create_acc_err   ),
  .ibuf_entry_create_data_en    (pop_entry1_create_data_en   ),
  .ibuf_entry_create_en         (pop_entry1_create_en        ),
  .ibuf_entry_create_halt_info  (pop_entry1_create_halt_info ),
  .ibuf_entry_create_inst       (pop_entry1_create_inst      ),
  .ibuf_entry_create_pgflt      (pop_entry1_create_pgflt     ),
  .ibuf_entry_create_pred_taken (pop_entry1_create_pred_taken),
  .ibuf_entry_halt_info         (pop_entry1_halt_info        ),
  .ibuf_entry_inst              (pop_entry1_inst             ),
  .ibuf_entry_pgflt             (pop_entry1_pgflt            ),
  .ibuf_entry_pred_taken        (pop_entry1_pred_taken       ),
  .ibuf_entry_retire_en         (pop_entry1_retire_en        ),
  .ibuf_entry_vld               (pop_entry1_vld              ),
  .ibuf_flush_en                (ibuf_flush_en               ),
  .pad_yy_icg_scan_en           (pad_yy_icg_scan_en          ),
  .vec_ibuf_warm_up             (vec_ibuf_warm_up            )
);










assign pop_entry0_create_en = ibuf_retire0_en
                           || ipack_bypass_vld && !pop_entry_vld && idu_ifu_id_stall
                           || ipack_bypass_vld && !pop_entry_vld && ipack_ibuf_inst_two
                           || ipack_bypass_vld && pop_entry_vld && !idu_ifu_id_stall;
assign pop_entry0_create_data_en = pop0_vld || ipack_bypass_vld;





assign pop_entry1_create_en = ibuf_retire1_en
                           || ipack_bypass_vld && ipack_inst_32 && !pop_entry_vld && idu_ifu_id_stall
                           || ipack_bypass_vld && ipack_inst_32 && pop_entry_vld && !idu_ifu_id_stall;
assign pop_entry1_create_data_en = ibuf_inst32 || ipack_bypass_vld && ipack_inst_32;



assign pop_entry0_create_inst[15:0] = pop0_vld ? pop0_inst[15:0]
                                    : idu_ifu_id_stall || pop_entry_vld
                                    ? ipack_ibuf_inst[15:0]
                                    : ipack_inst_32 ? ipack_ibuf_inst[47:32]
                                    : ipack_ibuf_inst[31:16];
assign pop_entry1_create_inst[15:0] = pop1_vld ? pop1_inst[15:0] : ipack_ibuf_inst[31:16];


assign pop_entry0_create_pred_taken[1:0] = pop0_vld ? pop0_pred_taken[1:0]
                                    : idu_ifu_id_stall || pop_entry_vld ? pred_ibuf_br_taken0[1:0]
                                    : pred_ibuf_br_taken1[1:0];
assign pop_entry1_create_pred_taken[1:0] = 2'b0;


assign pop_entry0_create_halt_info[`TDT_HINFO_WIDTH-1:0] = pop0_vld ? pop0_halt_info[`TDT_HINFO_WIDTH-1:0]
                                    : idu_ifu_id_stall || pop_entry_vld ? pred_ibuf_halt_info0[`TDT_HINFO_WIDTH-1:0]
                                    : pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];
assign pop_entry1_create_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'b0}};


assign pop_entry0_create_acc_err = pop0_vld ? pop0_acc_err
                                 : idu_ifu_id_stall || pop_entry_vld ? ipack_ibuf_acc_err[0]
                                 : ipack_ibuf_acc_err[1];
assign pop_entry1_create_acc_err = pop1_vld ? pop1_acc_err : ipack_ibuf_acc_err[1];


assign pop_entry0_create_pgflt = pop0_vld ? pop0_pgflt
                               : idu_ifu_id_stall || pop_entry_vld ? ipack_ibuf_pgflt[0]
                               : ipack_ibuf_pgflt[1];
assign pop_entry1_create_pgflt = pop1_vld ? pop1_pgflt : ipack_ibuf_pgflt[1];

assign ipack_expt_high          = ipack_inst_32 && !ipack_ibuf_acc_err[0] && ipack_ibuf_acc_err[1]
                               || ipack_inst_32 && !ipack_ibuf_pgflt[0] && ipack_ibuf_pgflt[1];




assign pop_entry0_retire_en = ctrl_ibuf_pop_en;
assign pop_entry1_retire_en = ctrl_ibuf_pop_en;




assign pop_entry_vld             = pop_entry0_vld;
assign pop_entry_inst[31:0]      = {pop_entry1_inst[15:0], pop_entry0_inst[15:0]};
assign pop_entry_pred_taken[1:0] = pop_entry0_pred_taken[1:0] | pop_entry1_pred_taken[1:0]; 
assign pop_entry_halt_info[`TDT_HINFO_WIDTH-1:0]  = pop_entry0_halt_info[`TDT_HINFO_WIDTH-1:0] | pop_entry1_halt_info[`TDT_HINFO_WIDTH-1:0]; 
assign pop_entry_acc_err         = pop_entry0_acc_err || pop_entry1_vld && pop_entry1_acc_err;
assign pop_entry_pgflt           = pop_entry0_pgflt || pop_entry1_vld && pop_entry1_pgflt;
assign pop_entry_expt_high       = !pop_entry0_acc_err && pop_entry1_vld && pop_entry1_acc_err
                                || !pop_entry0_pgflt && pop_entry1_vld && pop_entry1_pgflt;





assign ibuf_ctrl_inst_fetch = ibuf_inst_fetch && !ibuf_stall;


assign ibuf_ipack_stall = ibuf_stall;




assign ibuf_pred_stall  = ibuf_stall;
assign ibuf_pred_hungry = ibuf_empty || ibuf_five_avalbe || ibuf_four_avalbe;


assign ibuf_top_vld_num[2:0] = ibuf_vld_num[2:0];
assign ibuf_top_id_stall     = idu_ifu_id_stall;
assign ibuf_top_pop_entry_vld = pop_entry_vld;


assign ifu_idu_id_inst_vld   = pop_entry_vld || ipack_ibuf_inst_vld && dtu_ifu_halt_info_vld; 
assign ifu_idu_id_inst[31:0] = pop_entry_vld ? pop_entry_inst[31:0]
                                          : ipack_ibuf_inst[31:0];
assign ifu_idu_id_bht_pred[1:0]   = pop_entry_vld ? pop_entry_pred_taken[1:0]
                                                  : pred_ibuf_br_taken0[1:0];
assign ifu_idu_id_halt_info[`TDT_HINFO_WIDTH-1:0]  = pop_entry_vld ? pop_entry_halt_info[`TDT_HINFO_WIDTH-1:0]
                                                  : pred_ibuf_halt_info0[`TDT_HINFO_WIDTH-1:0];
assign ifu_idu_id_expt_acc_error  = pop_entry_vld ? pop_entry_acc_err
                                                  : |ipack_ibuf_acc_err[1:0];
assign ifu_idu_id_expt_page_fault = pop_entry_vld ? pop_entry_pgflt
                                                  : |ipack_ibuf_pgflt[1:0];
assign ifu_idu_id_expt_high       = pop_entry_vld ? pop_entry_expt_high
                                                  : ipack_expt_high;




endmodule
module aq_ifu_ibuf(
  cp0_ifu_icg_en,
  cp0_yy_clk_en,
  cpurst_b,
  ctrl_ibuf_pop_en,
  dtu_ifu_debug_inst,
  dtu_ifu_debug_inst_vld,
  dtu_ifu_halt_info_vld,
  forever_cpuclk,
  ibuf_ctrl_inst_fetch,
  ibuf_ipack_stall,
  ibuf_pred_hungry,
  ibuf_pred_stall,
  ibuf_top_id_stall,
  ibuf_top_pop_entry_vld,
  ibuf_top_vld_num,
  idu_ifu_id_stall,
  ifu_idu_id_bht_pred,
  ifu_idu_id_expt_acc_error,
  ifu_idu_id_expt_high,
  ifu_idu_id_expt_page_fault,
  ifu_idu_id_halt_info,
  ifu_idu_id_inst,
  ifu_idu_id_inst_vld,
  ipack_ibuf_acc_err,
  ipack_ibuf_inst,
  ipack_ibuf_inst_all,
  ipack_ibuf_inst_full,
  ipack_ibuf_inst_one,
  ipack_ibuf_inst_two,
  ipack_ibuf_inst_vld,
  ipack_ibuf_inst_vld_raw,
  ipack_ibuf_pgflt,
  pad_yy_icg_scan_en,
  pcgen_ibuf_chgflw_vld,
  pred_ibuf_br_taken0,
  pred_ibuf_br_taken1,
  pred_ibuf_chgflw_vld0,
  pred_ibuf_halt_info0,
  pred_ibuf_halt_info1,
  rtu_ifu_flush_fe,
  rtu_yy_xx_dbgon,
  vec_ibuf_warm_up
);



input           cp0_ifu_icg_en;              
input           cp0_yy_clk_en;               
input           cpurst_b;                    
input           ctrl_ibuf_pop_en;            
input   [31:0]  dtu_ifu_debug_inst;          
input           dtu_ifu_debug_inst_vld;      
input           dtu_ifu_halt_info_vld;       
input           forever_cpuclk;              
input           idu_ifu_id_stall;            
input   [2 :0]  ipack_ibuf_acc_err;          
input   [47:0]  ipack_ibuf_inst;             
input           ipack_ibuf_inst_all;         
input           ipack_ibuf_inst_full;        
input           ipack_ibuf_inst_one;         
input           ipack_ibuf_inst_two;         
input           ipack_ibuf_inst_vld;         
input           ipack_ibuf_inst_vld_raw;     
input   [2 :0]  ipack_ibuf_pgflt;            
input           pad_yy_icg_scan_en;          
input           pcgen_ibuf_chgflw_vld;       
input   [1 :0]  pred_ibuf_br_taken0;         
input   [1 :0]  pred_ibuf_br_taken1;         
input           pred_ibuf_chgflw_vld0;       
input   [21:0]  pred_ibuf_halt_info0;        
input   [21:0]  pred_ibuf_halt_info1;        
input           rtu_ifu_flush_fe;            
input           rtu_yy_xx_dbgon;             
input           vec_ibuf_warm_up;            
output          ibuf_ctrl_inst_fetch;        
output          ibuf_ipack_stall;            
output          ibuf_pred_hungry;            
output          ibuf_pred_stall;             
output          ibuf_top_id_stall;           
output          ibuf_top_pop_entry_vld;      
output  [2 :0]  ibuf_top_vld_num;            
output  [1 :0]  ifu_idu_id_bht_pred;         
output          ifu_idu_id_expt_acc_error;   
output          ifu_idu_id_expt_high;        
output          ifu_idu_id_expt_page_fault;  
output  [21:0]  ifu_idu_id_halt_info;        
output  [31:0]  ifu_idu_id_inst;             
output          ifu_idu_id_inst_vld;         


reg     [5 :0]  pop0;                        
reg             pop0_acc_err;                
reg     [21:0]  pop0_halt_info;              
reg     [15:0]  pop0_inst;                   
reg             pop0_pgflt;                  
reg     [1 :0]  pop0_pred_taken;             
reg     [5 :0]  pop0_shift;                  
reg             pop0_vld;                    
reg             pop1_acc_err;                
reg     [21:0]  pop1_halt_info;              
reg     [15:0]  pop1_inst;                   
reg             pop1_pgflt;                  
reg     [1 :0]  pop1_pred_taken;             
reg             pop1_vld;                    
reg     [5 :0]  push0;                       
reg     [5 :0]  push0_shift;                 


wire            cp0_ifu_icg_en;              
wire            cp0_yy_clk_en;               
wire            cpurst_b;                    
wire            ctrl_ibuf_pop_en;            
wire            dtu_create0_en;              
wire            dtu_create1_en;              
wire    [31:0]  dtu_ifu_debug_inst;          
wire            dtu_ifu_debug_inst_vld;      
wire            dtu_ifu_halt_info_vld;       
wire            entry0_acc_err;              
wire            entry0_create0_data_en;      
wire            entry0_create0_en;           
wire            entry0_create1_data_en;      
wire            entry0_create1_en;           
wire            entry0_create2_data_en;      
wire            entry0_create2_en;           
wire    [21:0]  entry0_halt_info;            
wire    [15:0]  entry0_inst;                 
wire            entry0_pgflt;                
wire    [1 :0]  entry0_pred_taken;           
wire            entry0_retire0_en;           
wire            entry0_retire1_en;           
wire            entry0_vld;                  
wire            entry1_acc_err;              
wire            entry1_create0_data_en;      
wire            entry1_create0_en;           
wire            entry1_create1_data_en;      
wire            entry1_create1_en;           
wire            entry1_create2_data_en;      
wire            entry1_create2_en;           
wire    [21:0]  entry1_halt_info;            
wire    [15:0]  entry1_inst;                 
wire            entry1_pgflt;                
wire    [1 :0]  entry1_pred_taken;           
wire            entry1_retire0_en;           
wire            entry1_retire1_en;           
wire            entry1_vld;                  
wire            entry2_acc_err;              
wire            entry2_create0_data_en;      
wire            entry2_create0_en;           
wire            entry2_create1_data_en;      
wire            entry2_create1_en;           
wire            entry2_create2_data_en;      
wire            entry2_create2_en;           
wire    [21:0]  entry2_halt_info;            
wire    [15:0]  entry2_inst;                 
wire            entry2_pgflt;                
wire    [1 :0]  entry2_pred_taken;           
wire            entry2_retire0_en;           
wire            entry2_retire1_en;           
wire            entry2_vld;                  
wire            entry3_acc_err;              
wire            entry3_create0_data_en;      
wire            entry3_create0_en;           
wire            entry3_create1_data_en;      
wire            entry3_create1_en;           
wire            entry3_create2_data_en;      
wire            entry3_create2_en;           
wire    [21:0]  entry3_halt_info;            
wire    [15:0]  entry3_inst;                 
wire            entry3_pgflt;                
wire    [1 :0]  entry3_pred_taken;           
wire            entry3_retire0_en;           
wire            entry3_retire1_en;           
wire            entry3_vld;                  
wire            entry4_acc_err;              
wire            entry4_create0_data_en;      
wire            entry4_create0_en;           
wire            entry4_create1_data_en;      
wire            entry4_create1_en;           
wire            entry4_create2_data_en;      
wire            entry4_create2_en;           
wire    [21:0]  entry4_halt_info;            
wire    [15:0]  entry4_inst;                 
wire            entry4_pgflt;                
wire    [1 :0]  entry4_pred_taken;           
wire            entry4_retire0_en;           
wire            entry4_retire1_en;           
wire            entry4_vld;                  
wire            entry5_acc_err;              
wire            entry5_create0_data_en;      
wire            entry5_create0_en;           
wire            entry5_create1_data_en;      
wire            entry5_create1_en;           
wire            entry5_create2_data_en;      
wire            entry5_create2_en;           
wire    [21:0]  entry5_halt_info;            
wire    [15:0]  entry5_inst;                 
wire            entry5_pgflt;                
wire    [1 :0]  entry5_pred_taken;           
wire            entry5_retire0_en;           
wire            entry5_retire1_en;           
wire            entry5_vld;                  
wire            forever_cpuclk;              
wire            ibuf_cpuclk;                 
wire            ibuf_create0_acc_err;        
wire            ibuf_create0_data_en;        
wire            ibuf_create0_en;             
wire    [21:0]  ibuf_create0_halt_info;      
wire    [15:0]  ibuf_create0_inst;           
wire            ibuf_create0_pgflt;          
wire    [1 :0]  ibuf_create0_pred_taken;     
wire            ibuf_create1_acc_err;        
wire            ibuf_create1_data_en;        
wire            ibuf_create1_en;             
wire    [21:0]  ibuf_create1_halt_info;      
wire    [15:0]  ibuf_create1_inst;           
wire            ibuf_create1_pgflt;          
wire    [1 :0]  ibuf_create1_pred_taken;     
wire            ibuf_create2_acc_err;        
wire            ibuf_create2_data_en;        
wire            ibuf_create2_en;             
wire    [21:0]  ibuf_create2_halt_info;      
wire    [15:0]  ibuf_create2_inst;           
wire            ibuf_create2_pgflt;          
wire    [1 :0]  ibuf_create2_pred_taken;     
wire            ibuf_ctrl_inst_fetch;        
wire            ibuf_empty;                  
wire            ibuf_entry_stall;            
wire            ibuf_five_avalbe;            
wire            ibuf_flush_en;               
wire            ibuf_four_avalbe;            
wire            ibuf_full;                   
wire            ibuf_icg_en;                 
wire            ibuf_inst32;                 
wire            ibuf_inst_32_vld;            
wire            ibuf_inst_fetch;             
wire            ibuf_ipack_stall;            
wire            ibuf_one_avalbe;             
wire            ibuf_pred_hungry;            
wire            ibuf_pred_stall;             
wire            ibuf_retire0_en;             
wire            ibuf_retire0_en_vld;         
wire            ibuf_retire1_en;             
wire            ibuf_stall;                  
wire            ibuf_top_id_stall;           
wire            ibuf_top_pop_entry_vld;      
wire    [2 :0]  ibuf_top_vld_num;            
wire            ibuf_two_avalbe;             
wire    [2 :0]  ibuf_vld_num;                
wire            idu_ifu_id_stall;            
wire    [1 :0]  ifu_idu_id_bht_pred;         
wire            ifu_idu_id_expt_acc_error;   
wire            ifu_idu_id_expt_high;        
wire            ifu_idu_id_expt_page_fault;  
wire    [21:0]  ifu_idu_id_halt_info;        
wire    [31:0]  ifu_idu_id_inst;             
wire            ifu_idu_id_inst_vld;         
wire            ipack_bypass_vld;            
wire            ipack_create0_data_en;       
wire            ipack_create0_en;            
wire            ipack_create1_data_en;       
wire            ipack_create1_en;            
wire            ipack_expt_high;             
wire    [2 :0]  ipack_ibuf_acc_err;          
wire    [47:0]  ipack_ibuf_inst;             
wire            ipack_ibuf_inst_all;         
wire            ipack_ibuf_inst_full;        
wire            ipack_ibuf_inst_one;         
wire            ipack_ibuf_inst_two;         
wire            ipack_ibuf_inst_vld;         
wire            ipack_ibuf_inst_vld_raw;     
wire    [2 :0]  ipack_ibuf_pgflt;            
wire            ipack_inst_32;               
wire            pad_yy_icg_scan_en;          
wire            pcgen_ibuf_chgflw_vld;       
wire            pop0_inst_32;                
wire    [5 :0]  pop1;                        
wire            pop_entry0_acc_err;          
wire            pop_entry0_create_acc_err;   
wire            pop_entry0_create_data_en;   
wire            pop_entry0_create_en;        
wire    [21:0]  pop_entry0_create_halt_info; 
wire    [15:0]  pop_entry0_create_inst;      
wire            pop_entry0_create_pgflt;     
wire    [1 :0]  pop_entry0_create_pred_taken; 
wire    [21:0]  pop_entry0_halt_info;        
wire    [15:0]  pop_entry0_inst;             
wire            pop_entry0_pgflt;            
wire    [1 :0]  pop_entry0_pred_taken;       
wire            pop_entry0_retire_en;        
wire            pop_entry0_vld;              
wire            pop_entry1_acc_err;          
wire            pop_entry1_create_acc_err;   
wire            pop_entry1_create_data_en;   
wire            pop_entry1_create_en;        
wire    [21:0]  pop_entry1_create_halt_info; 
wire    [15:0]  pop_entry1_create_inst;      
wire            pop_entry1_create_pgflt;     
wire    [1 :0]  pop_entry1_create_pred_taken; 
wire    [21:0]  pop_entry1_halt_info;        
wire    [15:0]  pop_entry1_inst;             
wire            pop_entry1_pgflt;            
wire    [1 :0]  pop_entry1_pred_taken;       
wire            pop_entry1_retire_en;        
wire            pop_entry1_vld;              
wire            pop_entry_acc_err;           
wire            pop_entry_expt_high;         
wire    [21:0]  pop_entry_halt_info;         
wire    [31:0]  pop_entry_inst;              
wire            pop_entry_pgflt;             
wire    [1 :0]  pop_entry_pred_taken;        
wire            pop_entry_vld;               
wire    [1 :0]  pred_ibuf_br_taken0;         
wire    [1 :0]  pred_ibuf_br_taken1;         
wire            pred_ibuf_chgflw_vld0;       
wire    [21:0]  pred_ibuf_halt_info0;        
wire    [21:0]  pred_ibuf_halt_info1;        
wire    [5 :0]  push0_bypass;                
wire    [5 :0]  push1;                       
wire    [5 :0]  push1_bypass;                
wire    [5 :0]  push2;                       
wire    [5 :0]  push2_bypass;                
wire            rtu_ifu_flush_fe;            
wire            rtu_yy_xx_dbgon;             
wire            vec_ibuf_warm_up;            















assign ibuf_icg_en = !ibuf_empty
                   || pop0_vld
                   || pop_entry_vld
                   || ipack_ibuf_inst_vld
                   || dtu_create0_en;

gated_clk_cell  x_ifu_ibuf_icg_cell (
  .clk_in             (forever_cpuclk    ),
  .clk_out            (ibuf_cpuclk       ),
  .external_en        (1'b0              ),
  .global_en          (cp0_yy_clk_en     ),
  .local_en           (ibuf_icg_en       ),
  .module_en          (cp0_ifu_icg_en    ),
  .pad_yy_icg_scan_en (pad_yy_icg_scan_en)
);












parameter ENTRY_NUM = 6;



aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry0 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry0_acc_err            ),
  .ibuf_entry_create0_data_en (entry0_create0_data_en    ),
  .ibuf_entry_create0_en      (entry0_create0_en         ),
  .ibuf_entry_create1_data_en (entry0_create1_data_en    ),
  .ibuf_entry_create1_en      (entry0_create1_en         ),
  .ibuf_entry_create2_data_en (entry0_create2_data_en    ),
  .ibuf_entry_create2_en      (entry0_create2_en         ),
  .ibuf_entry_halt_info       (entry0_halt_info          ),
  .ibuf_entry_inst            (entry0_inst               ),
  .ibuf_entry_pgflt           (entry0_pgflt              ),
  .ibuf_entry_pred_taken      (entry0_pred_taken         ),
  .ibuf_entry_retire0_en      (entry0_retire0_en         ),
  .ibuf_entry_retire1_en      (entry0_retire1_en         ),
  .ibuf_entry_vld             (entry0_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);




aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry1 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry1_acc_err            ),
  .ibuf_entry_create0_data_en (entry1_create0_data_en    ),
  .ibuf_entry_create0_en      (entry1_create0_en         ),
  .ibuf_entry_create1_data_en (entry1_create1_data_en    ),
  .ibuf_entry_create1_en      (entry1_create1_en         ),
  .ibuf_entry_create2_data_en (entry1_create2_data_en    ),
  .ibuf_entry_create2_en      (entry1_create2_en         ),
  .ibuf_entry_halt_info       (entry1_halt_info          ),
  .ibuf_entry_inst            (entry1_inst               ),
  .ibuf_entry_pgflt           (entry1_pgflt              ),
  .ibuf_entry_pred_taken      (entry1_pred_taken         ),
  .ibuf_entry_retire0_en      (entry1_retire0_en         ),
  .ibuf_entry_retire1_en      (entry1_retire1_en         ),
  .ibuf_entry_vld             (entry1_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);




aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry2 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry2_acc_err            ),
  .ibuf_entry_create0_data_en (entry2_create0_data_en    ),
  .ibuf_entry_create0_en      (entry2_create0_en         ),
  .ibuf_entry_create1_data_en (entry2_create1_data_en    ),
  .ibuf_entry_create1_en      (entry2_create1_en         ),
  .ibuf_entry_create2_data_en (entry2_create2_data_en    ),
  .ibuf_entry_create2_en      (entry2_create2_en         ),
  .ibuf_entry_halt_info       (entry2_halt_info          ),
  .ibuf_entry_inst            (entry2_inst               ),
  .ibuf_entry_pgflt           (entry2_pgflt              ),
  .ibuf_entry_pred_taken      (entry2_pred_taken         ),
  .ibuf_entry_retire0_en      (entry2_retire0_en         ),
  .ibuf_entry_retire1_en      (entry2_retire1_en         ),
  .ibuf_entry_vld             (entry2_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);




aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry3 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry3_acc_err            ),
  .ibuf_entry_create0_data_en (entry3_create0_data_en    ),
  .ibuf_entry_create0_en      (entry3_create0_en         ),
  .ibuf_entry_create1_data_en (entry3_create1_data_en    ),
  .ibuf_entry_create1_en      (entry3_create1_en         ),
  .ibuf_entry_create2_data_en (entry3_create2_data_en    ),
  .ibuf_entry_create2_en      (entry3_create2_en         ),
  .ibuf_entry_halt_info       (entry3_halt_info          ),
  .ibuf_entry_inst            (entry3_inst               ),
  .ibuf_entry_pgflt           (entry3_pgflt              ),
  .ibuf_entry_pred_taken      (entry3_pred_taken         ),
  .ibuf_entry_retire0_en      (entry3_retire0_en         ),
  .ibuf_entry_retire1_en      (entry3_retire1_en         ),
  .ibuf_entry_vld             (entry3_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);




aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry4 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry4_acc_err            ),
  .ibuf_entry_create0_data_en (entry4_create0_data_en    ),
  .ibuf_entry_create0_en      (entry4_create0_en         ),
  .ibuf_entry_create1_data_en (entry4_create1_data_en    ),
  .ibuf_entry_create1_en      (entry4_create1_en         ),
  .ibuf_entry_create2_data_en (entry4_create2_data_en    ),
  .ibuf_entry_create2_en      (entry4_create2_en         ),
  .ibuf_entry_halt_info       (entry4_halt_info          ),
  .ibuf_entry_inst            (entry4_inst               ),
  .ibuf_entry_pgflt           (entry4_pgflt              ),
  .ibuf_entry_pred_taken      (entry4_pred_taken         ),
  .ibuf_entry_retire0_en      (entry4_retire0_en         ),
  .ibuf_entry_retire1_en      (entry4_retire1_en         ),
  .ibuf_entry_vld             (entry4_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);




aq_ifu_ibuf_entry  x_aq_ifu_ibuf_entry5 (
  .cp0_ifu_icg_en             (cp0_ifu_icg_en            ),
  .cp0_yy_clk_en              (cp0_yy_clk_en             ),
  .cpurst_b                   (cpurst_b                  ),
  .forever_cpuclk             (forever_cpuclk            ),
  .ibuf_cpuclk                (ibuf_cpuclk               ),
  .ibuf_create0_acc_err       (ibuf_create0_acc_err      ),
  .ibuf_create0_halt_info     (ibuf_create0_halt_info    ),
  .ibuf_create0_inst          (ibuf_create0_inst         ),
  .ibuf_create0_pgflt         (ibuf_create0_pgflt        ),
  .ibuf_create0_pred_taken    (ibuf_create0_pred_taken   ),
  .ibuf_create1_acc_err       (ibuf_create1_acc_err      ),
  .ibuf_create1_halt_info     (ibuf_create1_halt_info    ),
  .ibuf_create1_inst          (ibuf_create1_inst         ),
  .ibuf_create1_pgflt         (ibuf_create1_pgflt        ),
  .ibuf_create1_pred_taken    (ibuf_create1_pred_taken   ),
  .ibuf_create2_acc_err       (ibuf_create2_acc_err      ),
  .ibuf_create2_halt_info     (ibuf_create2_halt_info    ),
  .ibuf_create2_inst          (ibuf_create2_inst         ),
  .ibuf_create2_pgflt         (ibuf_create2_pgflt        ),
  .ibuf_create2_pred_taken    (ibuf_create2_pred_taken   ),
  .ibuf_entry_acc_err         (entry5_acc_err            ),
  .ibuf_entry_create0_data_en (entry5_create0_data_en    ),
  .ibuf_entry_create0_en      (entry5_create0_en         ),
  .ibuf_entry_create1_data_en (entry5_create1_data_en    ),
  .ibuf_entry_create1_en      (entry5_create1_en         ),
  .ibuf_entry_create2_data_en (entry5_create2_data_en    ),
  .ibuf_entry_create2_en      (entry5_create2_en         ),
  .ibuf_entry_halt_info       (entry5_halt_info          ),
  .ibuf_entry_inst            (entry5_inst               ),
  .ibuf_entry_pgflt           (entry5_pgflt              ),
  .ibuf_entry_pred_taken      (entry5_pred_taken         ),
  .ibuf_entry_retire0_en      (entry5_retire0_en         ),
  .ibuf_entry_retire1_en      (entry5_retire1_en         ),
  .ibuf_entry_vld             (entry5_vld                ),
  .ibuf_flush_en              (ibuf_flush_en             ),
  .pad_yy_icg_scan_en         (pad_yy_icg_scan_en        ),
  .vec_ibuf_warm_up           (vec_ibuf_warm_up          )
);









assign ibuf_retire0_en = pop0_vld && ctrl_ibuf_pop_en;
assign ibuf_retire1_en = ibuf_inst32 && ctrl_ibuf_pop_en;

assign ibuf_retire0_en_vld = ibuf_retire0_en;
assign ibuf_inst_32_vld = ibuf_inst32;

assign ibuf_flush_en   = rtu_ifu_flush_fe || pcgen_ibuf_chgflw_vld;


always @(posedge ibuf_cpuclk or negedge cpurst_b)
begin
  if(!cpurst_b)
    pop0[ENTRY_NUM-1:0] <= {{(ENTRY_NUM-1){1'b0}}, 1'b1};
  else if(ibuf_flush_en)
    pop0[ENTRY_NUM-1:0] <= pop0[ENTRY_NUM-1:0];
  else if(ibuf_retire0_en_vld)
    pop0[ENTRY_NUM-1:0] <= pop0_shift[ENTRY_NUM-1:0];


end


always @( pop0[5:0]
       or ibuf_inst_32_vld)
begin
  if(ibuf_inst_32_vld)
    pop0_shift[ENTRY_NUM-1:0] = {pop0[ENTRY_NUM-3:0],
                                 pop0[ENTRY_NUM-1:ENTRY_NUM-2]};
  else
    pop0_shift[ENTRY_NUM-1:0] = {pop0[ENTRY_NUM-2:0],
                                 pop0[ENTRY_NUM-1]};

end











assign {entry5_retire0_en,
        entry4_retire0_en,
        entry3_retire0_en,
        entry2_retire0_en,
        entry1_retire0_en,
        entry0_retire0_en} = pop0[ENTRY_NUM-1:0] & {ENTRY_NUM{ibuf_retire0_en}};


assign pop1[ENTRY_NUM-1:0] = {pop0[ENTRY_NUM-2:0],
                              pop0[ENTRY_NUM-1]};


assign {entry5_retire1_en,
        entry4_retire1_en,
        entry3_retire1_en,
        entry2_retire1_en,
        entry1_retire1_en,
        entry0_retire1_en} = pop1[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_retire1_en}};


always @( entry1_acc_err
       or entry2_inst[15:0]
       or entry1_pgflt
       or entry5_inst[15:0]
       or entry4_halt_info[21:0]
       or entry0_acc_err
       or entry2_pgflt
       or entry0_pgflt
       or entry5_vld
       or entry5_pgflt
       or entry0_vld
       or entry1_inst[15:0]
       or entry2_acc_err
       or entry2_halt_info[21:0]
       or pop0[5:0]
       or entry3_pred_taken[1:0]
       or entry3_acc_err
       or entry3_pgflt
       or entry1_vld
       or entry4_pgflt
       or entry0_halt_info[21:0]
       or entry3_halt_info[21:0]
       or entry4_acc_err
       or entry4_pred_taken[1:0]
       or entry0_pred_taken[1:0]
       or entry5_acc_err
       or entry1_halt_info[21:0]
       or entry4_inst[15:0]
       or entry2_vld
       or entry3_vld
       or entry5_pred_taken[1:0]
       or entry4_vld
       or entry5_halt_info[21:0]
       or entry3_inst[15:0]
       or entry2_pred_taken[1:0]
       or entry1_pred_taken[1:0]
       or entry0_inst[15:0])
begin
  case(pop0[ENTRY_NUM-1:0])
  6'b0001:
  begin
    pop0_vld          = entry0_vld;
    pop0_inst[15:0]   = entry0_inst[15:0];
    pop0_pred_taken[1:0] = entry0_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry0_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry0_acc_err;
    pop0_pgflt        = entry0_pgflt;
  end
  6'b0010:
  begin
    pop0_vld          = entry1_vld;
    pop0_inst[15:0]   = entry1_inst[15:0];
    pop0_pred_taken[1:0] = entry1_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry1_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry1_acc_err;
    pop0_pgflt        = entry1_pgflt;
  end
  6'b0100:
  begin
    pop0_vld          = entry2_vld;
    pop0_inst[15:0]   = entry2_inst[15:0];
    pop0_pred_taken[1:0] = entry2_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry2_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry2_acc_err;
    pop0_pgflt        = entry2_pgflt;
  end
  6'b1000:
  begin
    pop0_vld          = entry3_vld;
    pop0_inst[15:0]   = entry3_inst[15:0];
    pop0_pred_taken[1:0] = entry3_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry3_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry3_acc_err;
    pop0_pgflt        = entry3_pgflt;
  end
  6'b10000:
  begin
    pop0_vld          = entry4_vld;
    pop0_inst[15:0]   = entry4_inst[15:0];
    pop0_pred_taken[1:0] = entry4_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry4_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry4_acc_err;
    pop0_pgflt        = entry4_pgflt;
  end
  6'b100000:
  begin
    pop0_vld          = entry5_vld;
    pop0_inst[15:0]   = entry5_inst[15:0];
    pop0_pred_taken[1:0] = entry5_pred_taken[1:0];
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0]  = entry5_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop0_acc_err      = entry5_acc_err;
    pop0_pgflt        = entry5_pgflt;
  end
  default:
  begin
    pop0_vld          = 1'bx;
    pop0_inst[15:0]   = 16'bx;
    pop0_pred_taken[1:0] = 2'bx;
    pop0_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'bx}};
    pop0_acc_err      = 1'bx;
    pop0_pgflt        = 1'bx;
  end
  endcase

end



always @( entry1_acc_err
       or entry2_inst[15:0]
       or entry1_pgflt
       or entry5_inst[15:0]
       or entry4_halt_info[21:0]
       or entry0_acc_err
       or entry0_pgflt
       or entry2_pgflt
       or entry5_vld
       or entry5_pgflt
       or entry0_vld
       or entry1_inst[15:0]
       or entry2_acc_err
       or entry2_halt_info[21:0]
       or pop1[5:0]
       or entry3_pred_taken[1:0]
       or entry3_pgflt
       or entry3_acc_err
       or entry4_pgflt
       or entry1_vld
       or entry0_halt_info[21:0]
       or entry3_halt_info[21:0]
       or entry4_acc_err
       or entry4_pred_taken[1:0]
       or entry0_pred_taken[1:0]
       or entry5_acc_err
       or entry1_halt_info[21:0]
       or entry4_inst[15:0]
       or entry2_vld
       or entry3_vld
       or entry5_pred_taken[1:0]
       or entry4_vld
       or entry5_halt_info[21:0]
       or entry3_inst[15:0]
       or entry2_pred_taken[1:0]
       or entry1_pred_taken[1:0]
       or entry0_inst[15:0])
begin
  case(pop1[ENTRY_NUM-1:0])
  6'b0001:
  begin
    pop1_vld          = entry0_vld;
    pop1_inst[15:0]   = entry0_inst[15:0];
    pop1_pred_taken[1:0] = entry0_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry0_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry0_acc_err;
    pop1_pgflt        = entry0_pgflt;
  end
  6'b0010:
  begin
    pop1_vld          = entry1_vld;
    pop1_inst[15:0]   = entry1_inst[15:0];
    pop1_pred_taken[1:0] = entry1_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry1_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry1_acc_err;
    pop1_pgflt        = entry1_pgflt;
  end
  6'b0100:
  begin
    pop1_vld          = entry2_vld;
    pop1_inst[15:0]   = entry2_inst[15:0];
    pop1_pred_taken[1:0] = entry2_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry2_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry2_acc_err;
    pop1_pgflt        = entry2_pgflt;
  end
  6'b1000:
  begin
    pop1_vld          = entry3_vld;
    pop1_inst[15:0]   = entry3_inst[15:0];
    pop1_pred_taken[1:0] = entry3_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry3_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry3_acc_err;
    pop1_pgflt        = entry3_pgflt;
  end
  6'b10000:
  begin
    pop1_vld          = entry4_vld;
    pop1_inst[15:0]   = entry4_inst[15:0];
    pop1_pred_taken[1:0] = entry4_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry4_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry4_acc_err;
    pop1_pgflt        = entry4_pgflt;
  end
  6'b100000:
  begin
    pop1_vld          = entry5_vld;
    pop1_inst[15:0]   = entry5_inst[15:0];
    pop1_pred_taken[1:0] = entry5_pred_taken[1:0];
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = entry5_halt_info[`TDT_HINFO_WIDTH-1:0];
    pop1_acc_err      = entry5_acc_err;
    pop1_pgflt        = entry5_pgflt;
  end
  default:
  begin
    pop1_vld          = 1'bx;
    pop1_inst[15:0]   = 16'bx;
    pop1_pred_taken[1:0] = 2'bx;
    pop1_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'bx}};
    pop1_acc_err      = 1'bx;
    pop1_pgflt        = 1'bx;
  end
  endcase

end









assign ipack_bypass_vld = ibuf_empty && ipack_ibuf_inst_vld;
assign ipack_create0_en = ipack_ibuf_inst_vld
                        && !(ibuf_empty && 
                             (ipack_ibuf_inst_two && !pop_entry_vld && !idu_ifu_id_stall
                               || ipack_ibuf_inst_one && !pop_entry_vld
                               || ipack_ibuf_inst_one && !idu_ifu_id_stall
                               || ipack_inst_32 && !ipack_ibuf_inst_all && !pop_entry_vld
                               || ipack_inst_32 && !ipack_ibuf_inst_all && !idu_ifu_id_stall));

assign ipack_create0_data_en = ipack_ibuf_inst_vld_raw && !ibuf_entry_stall
                            && (!ibuf_empty || pop_entry_vld || ipack_ibuf_inst_two);
assign dtu_create0_en   = rtu_yy_xx_dbgon && dtu_ifu_debug_inst_vld;

assign ibuf_create0_en  = ipack_create0_en || dtu_create0_en;
assign ibuf_create0_data_en  = ipack_create0_data_en || dtu_create0_en;



assign ipack_create1_en = ipack_ibuf_inst_vld && !ipack_ibuf_inst_one
                        && (!ibuf_empty || idu_ifu_id_stall && pop_entry_vld);
assign ipack_create1_data_en = ipack_ibuf_inst_vld_raw && !ibuf_entry_stall && !ipack_ibuf_inst_one
                        && (!ibuf_empty || pop_entry_vld);
assign dtu_create1_en   = dtu_create0_en && dtu_ifu_debug_inst[1:0] == 2'b11;

assign ibuf_create1_en  = ipack_create1_en || dtu_create1_en;
assign ibuf_create1_data_en  = ipack_create1_data_en || dtu_create1_en;


assign ibuf_create2_en = ipack_ibuf_inst_vld && ipack_ibuf_inst_all 
                        && !pred_ibuf_chgflw_vld0
                        && (!ibuf_empty || idu_ifu_id_stall && pop_entry_vld);
assign ibuf_create2_data_en = ipack_ibuf_inst_vld_raw && !ibuf_entry_stall && ipack_ibuf_inst_all 
                        && !pred_ibuf_chgflw_vld0
                        && (!ibuf_empty || pop_entry_vld);



always @(posedge ibuf_cpuclk or negedge cpurst_b)
begin
  if(!cpurst_b)
    push0[ENTRY_NUM-1:0] <= {{(ENTRY_NUM-1){1'b0}}, 1'b1};
  else if(ibuf_flush_en)
    push0[ENTRY_NUM-1:0] <= pop0[ENTRY_NUM-1:0];
  else if(ibuf_create0_en)
    push0[ENTRY_NUM-1:0] <= push0_shift[ENTRY_NUM-1:0];
end


always @( push0[5:0]
       or ibuf_create1_en
       or ibuf_create2_en)
begin
  if(ibuf_create2_en)
    push0_shift[ENTRY_NUM-1:0] = {push0[ENTRY_NUM-4:0],
                                  push0[ENTRY_NUM-1:ENTRY_NUM-3]};
  else if(ibuf_create1_en)
    push0_shift[ENTRY_NUM-1:0] = {push0[ENTRY_NUM-3:0],
                                  push0[ENTRY_NUM-1:ENTRY_NUM-2]};
  else
    push0_shift[ENTRY_NUM-1:0] = {push0[ENTRY_NUM-2:0],
                                  push0[ENTRY_NUM-1]};

end












assign push0_bypass[ENTRY_NUM-1:0] = push0[ENTRY_NUM-1:0];


assign {entry5_create0_en,
        entry4_create0_en,
        entry3_create0_en,
        entry2_create0_en,
        entry1_create0_en,
        entry0_create0_en} = push0_bypass[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create0_en}};

assign {entry5_create0_data_en,
        entry4_create0_data_en,
        entry3_create0_data_en,
        entry2_create0_data_en,
        entry1_create0_data_en,
        entry0_create0_data_en} = push0[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create0_data_en}};


assign push1[ENTRY_NUM-1:0] = {push0[ENTRY_NUM-2:0],
                               push0[ENTRY_NUM-1]};


assign push1_bypass[ENTRY_NUM-1:0] = {push0_bypass[ENTRY_NUM-2:0],
                                      push0_bypass[ENTRY_NUM-1]};


assign {entry5_create1_en,
        entry4_create1_en,
        entry3_create1_en,
        entry2_create1_en,
        entry1_create1_en,
        entry0_create1_en} = push1_bypass[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create1_en}};

assign {entry5_create1_data_en,
        entry4_create1_data_en,
        entry3_create1_data_en,
        entry2_create1_data_en,
        entry1_create1_data_en,
        entry0_create1_data_en} = push1[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create1_data_en}};


assign push2[ENTRY_NUM-1:0] = {push0[ENTRY_NUM-3:0],
                               push0[ENTRY_NUM-1:ENTRY_NUM-2]};


assign push2_bypass[ENTRY_NUM-1:0] = {push0_bypass[ENTRY_NUM-3:0],
                                      push0_bypass[ENTRY_NUM-1:ENTRY_NUM-2]};


assign {entry5_create2_en,
        entry4_create2_en,
        entry3_create2_en,
        entry2_create2_en,
        entry1_create2_en,
        entry0_create2_en} = push2_bypass[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create2_en}};

assign {entry5_create2_data_en,
        entry4_create2_data_en,
        entry3_create2_data_en,
        entry2_create2_data_en,
        entry1_create2_data_en,
        entry0_create2_data_en} = push2[ENTRY_NUM-1:0] &
                             {ENTRY_NUM{ibuf_create2_data_en}};


assign ipack_inst_32 = ipack_ibuf_inst[1:0] == 2'b11;
assign ibuf_create0_inst[15:0] =
                                  rtu_yy_xx_dbgon ? dtu_ifu_debug_inst[15:0]


                               : ipack_ibuf_inst_full && (!pop_entry_vld 
                                      || !idu_ifu_id_stall && ibuf_empty)
                               ? ipack_ibuf_inst[47:32]


                               : ipack_ibuf_inst_two && !ipack_inst_32 
                                   && (!pop_entry_vld || !idu_ifu_id_stall && ibuf_empty)
                               ? ipack_ibuf_inst[31:16]
                               : ipack_ibuf_inst[15:0];
assign ibuf_create1_inst[15:0] =
                                 rtu_yy_xx_dbgon ? dtu_ifu_debug_inst[31:16]
                               : ipack_ibuf_inst[31:16];
assign ibuf_create2_inst[15:0] = ipack_ibuf_inst[47:32];

assign ibuf_create0_pred_taken[1:0] = ipack_ibuf_inst_two
                                   && (!pop_entry_vld || !idu_ifu_id_stall && ibuf_empty)
                                    ? pred_ibuf_br_taken1[1:0]
                                    : pred_ibuf_br_taken0[1:0];
assign ibuf_create1_pred_taken[1:0] = pred_ibuf_br_taken1[1:0];
assign ibuf_create2_pred_taken[1:0] = pred_ibuf_br_taken1[1:0];

assign ibuf_create0_halt_info[`TDT_HINFO_WIDTH-1:0]  = ipack_ibuf_inst_two
                                   && (!pop_entry_vld || !idu_ifu_id_stall && ibuf_empty)
                                    ? pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0]
                                    : pred_ibuf_halt_info0[`TDT_HINFO_WIDTH-1:0];
assign ibuf_create1_halt_info[`TDT_HINFO_WIDTH-1:0]  = pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];
assign ibuf_create2_halt_info[`TDT_HINFO_WIDTH-1:0]  = pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];

assign ibuf_create0_acc_err    = ipack_ibuf_acc_err[0];
assign ibuf_create1_acc_err    = ipack_ibuf_acc_err[1];
assign ibuf_create2_acc_err    = ipack_ibuf_acc_err[2];

assign ibuf_create0_pgflt    = ipack_ibuf_pgflt[0];
assign ibuf_create1_pgflt    = ipack_ibuf_pgflt[1];
assign ibuf_create2_pgflt    = ipack_ibuf_pgflt[2];








assign ibuf_vld_num[2:0] = {2'b0, entry0_vld}
                         + {2'b0, entry1_vld}
                         + {2'b0, entry2_vld}
                         + {2'b0, entry3_vld}
                         + {2'b0, entry4_vld}
                         + {2'b0, entry5_vld};

assign ibuf_full         = ibuf_vld_num[2:0] == 3'b110; 
assign ibuf_one_avalbe   = ibuf_vld_num[2:0] == 3'b101; 
assign ibuf_two_avalbe   = ibuf_vld_num[2:0] == 3'b100; 

assign ibuf_four_avalbe  = ibuf_vld_num[2:0] == 3'b010;       
assign ibuf_five_avalbe  = ibuf_vld_num[2:0] == 3'b001;       

assign ibuf_empty        = !(entry0_vld || entry1_vld || entry2_vld
                          || entry3_vld || entry4_vld || entry5_vld);




assign pop0_inst_32  = pop0_inst[1:0] == 2'b11;
assign ibuf_inst32   = pop0_vld && pop1_vld && pop0_inst_32;





































assign ibuf_entry_stall = ibuf_full && ipack_ibuf_inst_vld_raw
                       || ibuf_one_avalbe && ipack_ibuf_inst_vld_raw
                          && !ipack_ibuf_inst_one
                       || ibuf_two_avalbe && ipack_ibuf_inst_full;
assign ibuf_stall       = ibuf_entry_stall || !dtu_ifu_halt_info_vld && ipack_ibuf_inst_vld_raw;
assign ibuf_inst_fetch = 1'b1;






aq_ifu_ibuf_pop_entry  x_aq_ifu_ibuf_pop_entry0 (
  .cp0_ifu_icg_en               (cp0_ifu_icg_en              ),
  .cp0_yy_clk_en                (cp0_yy_clk_en               ),
  .cpurst_b                     (cpurst_b                    ),
  .forever_cpuclk               (forever_cpuclk              ),
  .ibuf_cpuclk                  (ibuf_cpuclk                 ),
  .ibuf_entry_acc_err           (pop_entry0_acc_err          ),
  .ibuf_entry_create_acc_err    (pop_entry0_create_acc_err   ),
  .ibuf_entry_create_data_en    (pop_entry0_create_data_en   ),
  .ibuf_entry_create_en         (pop_entry0_create_en        ),
  .ibuf_entry_create_halt_info  (pop_entry0_create_halt_info ),
  .ibuf_entry_create_inst       (pop_entry0_create_inst      ),
  .ibuf_entry_create_pgflt      (pop_entry0_create_pgflt     ),
  .ibuf_entry_create_pred_taken (pop_entry0_create_pred_taken),
  .ibuf_entry_halt_info         (pop_entry0_halt_info        ),
  .ibuf_entry_inst              (pop_entry0_inst             ),
  .ibuf_entry_pgflt             (pop_entry0_pgflt            ),
  .ibuf_entry_pred_taken        (pop_entry0_pred_taken       ),
  .ibuf_entry_retire_en         (pop_entry0_retire_en        ),
  .ibuf_entry_vld               (pop_entry0_vld              ),
  .ibuf_flush_en                (ibuf_flush_en               ),
  .pad_yy_icg_scan_en           (pad_yy_icg_scan_en          ),
  .vec_ibuf_warm_up             (vec_ibuf_warm_up            )
);




aq_ifu_ibuf_pop_entry  x_aq_ifu_ibuf_pop_entry1 (
  .cp0_ifu_icg_en               (cp0_ifu_icg_en              ),
  .cp0_yy_clk_en                (cp0_yy_clk_en               ),
  .cpurst_b                     (cpurst_b                    ),
  .forever_cpuclk               (forever_cpuclk              ),
  .ibuf_cpuclk                  (ibuf_cpuclk                 ),
  .ibuf_entry_acc_err           (pop_entry1_acc_err          ),
  .ibuf_entry_create_acc_err    (pop_entry1_create_acc_err   ),
  .ibuf_entry_create_data_en    (pop_entry1_create_data_en   ),
  .ibuf_entry_create_en         (pop_entry1_create_en        ),
  .ibuf_entry_create_halt_info  (pop_entry1_create_halt_info ),
  .ibuf_entry_create_inst       (pop_entry1_create_inst      ),
  .ibuf_entry_create_pgflt      (pop_entry1_create_pgflt     ),
  .ibuf_entry_create_pred_taken (pop_entry1_create_pred_taken),
  .ibuf_entry_halt_info         (pop_entry1_halt_info        ),
  .ibuf_entry_inst              (pop_entry1_inst             ),
  .ibuf_entry_pgflt             (pop_entry1_pgflt            ),
  .ibuf_entry_pred_taken        (pop_entry1_pred_taken       ),
  .ibuf_entry_retire_en         (pop_entry1_retire_en        ),
  .ibuf_entry_vld               (pop_entry1_vld              ),
  .ibuf_flush_en                (ibuf_flush_en               ),
  .pad_yy_icg_scan_en           (pad_yy_icg_scan_en          ),
  .vec_ibuf_warm_up             (vec_ibuf_warm_up            )
);










assign pop_entry0_create_en = ibuf_retire0_en
                           || ipack_bypass_vld && !pop_entry_vld && idu_ifu_id_stall
                           || ipack_bypass_vld && !pop_entry_vld && ipack_ibuf_inst_two
                           || ipack_bypass_vld && pop_entry_vld && !idu_ifu_id_stall;
assign pop_entry0_create_data_en = pop0_vld || ipack_bypass_vld;





assign pop_entry1_create_en = ibuf_retire1_en
                           || ipack_bypass_vld && ipack_inst_32 && !pop_entry_vld && idu_ifu_id_stall
                           || ipack_bypass_vld && ipack_inst_32 && pop_entry_vld && !idu_ifu_id_stall;
assign pop_entry1_create_data_en = ibuf_inst32 || ipack_bypass_vld && ipack_inst_32;



assign pop_entry0_create_inst[15:0] = pop0_vld ? pop0_inst[15:0]
                                    : idu_ifu_id_stall || pop_entry_vld
                                    ? ipack_ibuf_inst[15:0]
                                    : ipack_inst_32 ? ipack_ibuf_inst[47:32]
                                    : ipack_ibuf_inst[31:16];
assign pop_entry1_create_inst[15:0] = pop1_vld ? pop1_inst[15:0] : ipack_ibuf_inst[31:16];


assign pop_entry0_create_pred_taken[1:0] = pop0_vld ? pop0_pred_taken[1:0]
                                    : idu_ifu_id_stall || pop_entry_vld ? pred_ibuf_br_taken0[1:0]
                                    : pred_ibuf_br_taken1[1:0];
assign pop_entry1_create_pred_taken[1:0] = 2'b0;


assign pop_entry0_create_halt_info[`TDT_HINFO_WIDTH-1:0] = pop0_vld ? pop0_halt_info[`TDT_HINFO_WIDTH-1:0]
                                    : idu_ifu_id_stall || pop_entry_vld ? pred_ibuf_halt_info0[`TDT_HINFO_WIDTH-1:0]
                                    : pred_ibuf_halt_info1[`TDT_HINFO_WIDTH-1:0];
assign pop_entry1_create_halt_info[`TDT_HINFO_WIDTH-1:0] = {`TDT_HINFO_WIDTH{1'b0}};


assign pop_entry0_create_acc_err = pop0_vld ? pop0_acc_err
                                 : idu_ifu_id_stall || pop_entry_vld ? ipack_ibuf_acc_err[0]
                                 : ipack_ibuf_acc_err[1];
assign pop_entry1_create_acc_err = pop1_vld ? pop1_acc_err : ipack_ibuf_acc_err[1];


assign pop_entry0_create_pgflt = pop0_vld ? pop0_pgflt
                               : idu_ifu_id_stall || pop_entry_vld ? ipack_ibuf_pgflt[0]
                               : ipack_ibuf_pgflt[1];
assign pop_entry1_create_pgflt = pop1_vld ? pop1_pgflt : ipack_ibuf_pgflt[1];

assign ipack_expt_high          = ipack_inst_32 && !ipack_ibuf_acc_err[0] && ipack_ibuf_acc_err[1]
                               || ipack_inst_32 && !ipack_ibuf_pgflt[0] && ipack_ibuf_pgflt[1];




assign pop_entry0_retire_en = ctrl_ibuf_pop_en;
assign pop_entry1_retire_en = ctrl_ibuf_pop_en;




assign pop_entry_vld             = pop_entry0_vld;
assign pop_entry_inst[31:0]      = {pop_entry1_inst[15:0], pop_entry0_inst[15:0]};
assign pop_entry_pred_taken[1:0] = pop_entry0_pred_taken[1:0] | pop_entry1_pred_taken[1:0]; 
assign pop_entry_halt_info[`TDT_HINFO_WIDTH-1:0]  = pop_entry0_halt_info[`TDT_HINFO_WIDTH-1:0] | pop_entry1_halt_info[`TDT_HINFO_WIDTH-1:0]; 
assign pop_entry_acc_err         = pop_entry0_acc_err || pop_entry1_vld && pop_entry1_acc_err;
assign pop_entry_pgflt           = pop_entry0_pgflt || pop_entry1_vld && pop_entry1_pgflt;
assign pop_entry_expt_high       = !pop_entry0_acc_err && pop_entry1_vld && pop_entry1_acc_err
                                || !pop_entry0_pgflt && pop_entry1_vld && pop_entry1_pgflt;





assign ibuf_ctrl_inst_fetch = ibuf_inst_fetch && !ibuf_stall;


assign ibuf_ipack_stall = ibuf_stall;




assign ibuf_pred_stall  = ibuf_stall;
assign ibuf_pred_hungry = ibuf_empty || ibuf_five_avalbe || ibuf_four_avalbe;


assign ibuf_top_vld_num[2:0] = ibuf_vld_num[2:0];
assign ibuf_top_id_stall     = idu_ifu_id_stall;
assign ibuf_top_pop_entry_vld = pop_entry_vld;


assign ifu_idu_id_inst_vld   = pop_entry_vld || ipack_ibuf_inst_vld && dtu_ifu_halt_info_vld; 
assign ifu_idu_id_inst[31:0] = pop_entry_vld ? pop_entry_inst[31:0]
                                          : ipack_ibuf_inst[31:0];
assign ifu_idu_id_bht_pred[1:0]   = pop_entry_vld ? pop_entry_pred_taken[1:0]
                                                  : pred_ibuf_br_taken0[1:0];
assign ifu_idu_id_halt_info[`TDT_HINFO_WIDTH-1:0]  = pop_entry_vld ? pop_entry_halt_info[`TDT_HINFO_WIDTH-1:0]
                                                  : pred_ibuf_halt_info0[`TDT_HINFO_WIDTH-1:0];
assign ifu_idu_id_expt_acc_error  = pop_entry_vld ? pop_entry_acc_err
                                                  : |ipack_ibuf_acc_err[1:0];
assign ifu_idu_id_expt_page_fault = pop_entry_vld ? pop_entry_pgflt
                                                  : |ipack_ibuf_pgflt[1:0];
assign ifu_idu_id_expt_high       = pop_entry_vld ? pop_entry_expt_high
                                                  : ipack_expt_high;




endmodule