ct_lsu_pfu
// &ConnRule(s/_x$/[2]/); @279 // &ConnRule(s/_v$/_2/); @280 // &Instance("ct_lsu_pfu_pfb_entry","x_ct_lsu_pfu_pfb_entry_2"); @281 ct_lsu_pfu_pfb_entry x_ct_lsu_pfu_pfb_entry_2 ( .amr_wa_cancel (amr_wa_cancel ), .cp0_lsu_icg_en (cp0_lsu_icg_en ), .cp0_lsu_l2_st_pref_en (cp0_lsu_l2_st_pref_en ), .cp0_lsu_pfu_mmu_dis (cp0_lsu_pfu_mmu_dis ), .cp0_yy_clk_en (cp0_yy_clk_en ), .cp0_yy_priv_mode (cp0_yy_priv_mode ), .cpurst_b (cpurst_b ), .ld_da_ldfifo_pc (ld_da_ldfifo_pc ), .ld_da_page_sec_ff (ld_da_page_sec_ff ), .ld_da_page_share_ff (ld_da_page_share_ff ), .ld_da_pfu_act_dp_vld (ld_da_pfu_act_dp_vld ), .ld_da_pfu_act_vld (ld_da_pfu_act_vld ), .ld_da_pfu_evict_cnt_vld (ld_da_pfu_evict_cnt_vld ), .ld_da_pfu_pf_inst_vld (ld_da_pfu_pf_inst_vld ), .ld_da_ppfu_va (ld_da_ppfu_va ), .ld_da_ppn_ff (ld_da_ppn_ff ), .lsu_pfu_l1_dist_sel (lsu_pfu_l1_dist_sel ), .lsu_pfu_l2_dist_sel (lsu_pfu_l2_dist_sel ), .lsu_special_clk (lsu_special_clk ), .pad_yy_icg_scan_en (pad_yy_icg_scan_en ), .pfb_no_req_cnt_val (pfb_no_req_cnt_val ), .pfb_timeout_cnt_val (pfb_timeout_cnt_val ), .pfu_biu_pe_req_sel_l1 (pfu_biu_pe_req_sel_l1 ), .pfu_dcache_pref_en (pfu_dcache_pref_en ), .pfu_get_page_sec (pfu_get_page_sec ), .pfu_get_page_share (pfu_get_page_share ), .pfu_get_ppn (pfu_get_ppn ), .pfu_get_ppn_err (pfu_get_ppn_err ), .pfu_get_ppn_vld (pfu_get_ppn_vld ), .pfu_l2_pref_en (pfu_l2_pref_en ), .pfu_mmu_pe_req_sel_l1 (pfu_mmu_pe_req_sel_l1 ), .pfu_pfb_create_pc (pfu_pfb_create_pc ), .pfu_pfb_create_stride (pfu_pfb_create_stride ), .pfu_pfb_create_stride_neg (pfu_pfb_create_stride_neg ), .pfu_pfb_create_strideh_6to0 (pfu_pfb_create_strideh_6to0 ), .pfu_pfb_create_type_ld (pfu_pfb_create_type_ld ), .pfu_pfb_entry_biu_pe_req_grnt_x (pfu_pfb_entry_biu_pe_req_grnt[2] ), .pfu_pfb_entry_biu_pe_req_src_v (pfu_pfb_entry_biu_pe_req_src_2 ), .pfu_pfb_entry_biu_pe_req_x (pfu_pfb_entry_biu_pe_req[2] ), .pfu_pfb_entry_create_dp_vld_x (pfu_pfb_entry_create_dp_vld[2] ), .pfu_pfb_entry_create_gateclk_en_x (pfu_pfb_entry_create_gateclk_en[2] ), .pfu_pfb_entry_create_vld_x (pfu_pfb_entry_create_vld[2] ), .pfu_pfb_entry_evict_x (pfu_pfb_entry_evict[2] ), .pfu_pfb_entry_from_lfb_dcache_hit_x (pfu_pfb_entry_from_lfb_dcache_hit[2] ), .pfu_pfb_entry_from_lfb_dcache_miss_x (pfu_pfb_entry_from_lfb_dcache_miss[2]), .pfu_pfb_entry_hit_pc_x (pfu_pfb_entry_hit_pc[2] ), .pfu_pfb_entry_l1_page_sec_x (pfu_pfb_entry_l1_page_sec[2] ), .pfu_pfb_entry_l1_page_share_x (pfu_pfb_entry_l1_page_share[2] ), .pfu_pfb_entry_l1_pf_addr_v (pfu_pfb_entry_l1_pf_addr_2 ), .pfu_pfb_entry_l1_vpn_v (pfu_pfb_entry_l1_vpn_2 ), .pfu_pfb_entry_l2_page_sec_x (pfu_pfb_entry_l2_page_sec[2] ), .pfu_pfb_entry_l2_page_share_x (pfu_pfb_entry_l2_page_share[2] ), .pfu_pfb_entry_l2_pf_addr_v (pfu_pfb_entry_l2_pf_addr_2 ), .pfu_pfb_entry_l2_vpn_v (pfu_pfb_entry_l2_vpn_2 ), .pfu_pfb_entry_mmu_pe_req_grnt_x (pfu_pfb_entry_mmu_pe_req_grnt[2] ), .pfu_pfb_entry_mmu_pe_req_src_v (pfu_pfb_entry_mmu_pe_req_src_2 ), .pfu_pfb_entry_mmu_pe_req_x (pfu_pfb_entry_mmu_pe_req[2] ), .pfu_pfb_entry_priv_mode_v (pfu_pfb_entry_priv_mode_2 ), .pfu_pfb_entry_vld_x (pfu_pfb_entry_vld[2] ), .pfu_pop_all_part_vld (pfu_pop_all_part_vld ), .st_da_page_sec_ff (st_da_page_sec_ff ), .st_da_page_share_ff (st_da_page_share_ff ), .st_da_pc (st_da_pc ), .st_da_pfu_act_vld (st_da_pfu_act_vld ), .st_da_pfu_evict_cnt_vld (st_da_pfu_evict_cnt_vld ), .st_da_pfu_pf_inst_vld (st_da_pfu_pf_inst_vld ), .st_da_ppfu_va (st_da_ppfu_va ), .st_da_ppn_ff (st_da_ppn_ff ) ); // &ConnRule(s/_x$/[3]/); @283 // &ConnRule(s/_v$/_3/); @284 // &Instance("ct_lsu_pfu_pfb_entry","x_ct_lsu_pfu_pfb_entry_3"); @285 ct_lsu_pfu_pfb_entry x_ct_lsu_pfu_pfb_entry_3 ( .amr_wa_cancel (amr_wa_cancel ), .cp0_lsu_icg_en (cp0_lsu_icg_en ), .cp0_lsu_l2_st_pref_en (cp0_lsu_l2_st_pref_en ), .cp0_lsu_pfu_mmu_dis (cp0_lsu_pfu_mmu_dis ), .cp0_yy_clk_en (cp0_yy_clk_en ), .cp0_yy_priv_mode (cp0_yy_priv_mode ), .cpurst_b (cpurst_b ), .ld_da_ldfifo_pc (ld_da_ldfifo_pc ), .ld_da_page_sec_ff (ld_da_page_sec_ff ), .ld_da_page_share_ff (ld_da_page_share_ff ), .ld_da_pfu_act_dp_vld (ld_da_pfu_act_dp_vld ), .ld_da_pfu_act_vld (ld_da_pfu_act_vld ), .ld_da_pfu_evict_cnt_vld (ld_da_pfu_evict_cnt_vld ), .ld_da_pfu_pf_inst_vld (ld_da_pfu_pf_inst_vld ), .ld_da_ppfu_va (ld_da_ppfu_va ), .ld_da_ppn_ff (ld_da_ppn_ff ), .lsu_pfu_l1_dist_sel (lsu_pfu_l1_dist_sel ), .lsu_pfu_l2_dist_sel (lsu_pfu_l2_dist_sel ), .lsu_special_clk (lsu_special_clk ), .pad_yy_icg_scan_en (pad_yy_icg_scan_en ), .pfb_no_req_cnt_val (pfb_no_req_cnt_val ), .pfb_timeout_cnt_val (pfb_timeout_cnt_val ), .pfu_biu_pe_req_sel_l1 (pfu_biu_pe_req_sel_l1 ), .pfu_dcache_pref_en (pfu_dcache_pref_en ), .pfu_get_page_sec (pfu_get_page_sec ), .pfu_get_page_share (pfu_get_page_share ), .pfu_get_ppn (pfu_get_ppn ), .pfu_get_ppn_err (pfu_get_ppn_err ), .pfu_get_ppn_vld (pfu_get_ppn_vld ), .pfu_l2_pref_en (pfu_l2_pref_en ), .pfu_mmu_pe_req_sel_l1 (pfu_mmu_pe_req_sel_l1 ), .pfu_pfb_create_pc (pfu_pfb_create_pc ), .pfu_pfb_create_stride (pfu_pfb_create_stride ), .pfu_pfb_create_stride_neg (pfu_pfb_create_stride_neg ), .pfu_pfb_create_strideh_6to0 (pfu_pfb_create_strideh_6to0 ), .pfu_pfb_create_type_ld (pfu_pfb_create_type_ld ), .pfu_pfb_entry_biu_pe_req_grnt_x (pfu_pfb_entry_biu_pe_req_grnt[3] ), .pfu_pfb_entry_biu_pe_req_src_v (pfu_pfb_entry_biu_pe_req_src_3 ), .pfu_pfb_entry_biu_pe_req_x (pfu_pfb_entry_biu_pe_req[3] ), .pfu_pfb_entry_create_dp_vld_x (pfu_pfb_entry_create_dp_vld[3] ), .pfu_pfb_entry_create_gateclk_en_x (pfu_pfb_entry_create_gateclk_en[3] ), .pfu_pfb_entry_create_vld_x (pfu_pfb_entry_create_vld[3] ), .pfu_pfb_entry_evict_x (pfu_pfb_entry_evict[3] ), .pfu_pfb_entry_from_lfb_dcache_hit_x (pfu_pfb_entry_from_lfb_dcache_hit[3] ), .pfu_pfb_entry_from_lfb_dcache_miss_x (pfu_pfb_entry_from_lfb_dcache_miss[3]), .pfu_pfb_entry_hit_pc_x (pfu_pfb_entry_hit_pc[3] ), .pfu_pfb_entry_l1_page_sec_x (pfu_pfb_entry_l1_page_sec[3] ), .pfu_pfb_entry_l1_page_share_x (pfu_pfb_entry_l1_page_share[3] ), .pfu_pfb_entry_l1_pf_addr_v (pfu_pfb_entry_l1_pf_addr_3 ), .pfu_pfb_entry_l1_vpn_v (pfu_pfb_entry_l1_vpn_3 ), .pfu_pfb_entry_l2_page_sec_x (pfu_pfb_entry_l2_page_sec[3] ), .pfu_pfb_entry_l2_page_share_x (pfu_pfb_entry_l2_page_share[3] ), .pfu_pfb_entry_l2_pf_addr_v (pfu_pfb_entry_l2_pf_addr_3 ), .pfu_pfb_entry_l2_vpn_v (pfu_pfb_entry_l2_vpn_3 ), .pfu_pfb_entry_mmu_pe_req_grnt_x (pfu_pfb_entry_mmu_pe_req_grnt[3] ), .pfu_pfb_entry_mmu_pe_req_src_v (pfu_pfb_entry_mmu_pe_req_src_3 ), .pfu_pfb_entry_mmu_pe_req_x (pfu_pfb_entry_mmu_pe_req[3] ), .pfu_pfb_entry_priv_mode_v (pfu_pfb_entry_priv_mode_3 ), .pfu_pfb_entry_vld_x (pfu_pfb_entry_vld[3] ), .pfu_pop_all_part_vld (pfu_pop_all_part_vld ), .st_da_page_sec_ff (st_da_page_sec_ff ), .st_da_page_share_ff (st_da_page_share_ff ), .st_da_pc (st_da_pc ), .st_da_pfu_act_vld (st_da_pfu_act_vld ), .st_da_pfu_evict_cnt_vld (st_da_pfu_evict_cnt_vld ), .st_da_pfu_pf_inst_vld (st_da_pfu_pf_inst_vld ), .st_da_ppfu_va (st_da_ppfu_va ), .st_da_ppn_ff (st_da_ppn_ff ) );
这段代码继续实例化预取缓冲单元(PFU)的预取缓冲条目(PFB),特别是第二个和第三个条目(索引为2和3)。
功能
每个PFB条目负责管理一组特定的预取请求。这包括跟踪预取地址、处理与内存管理单元(MMU)的交互、以及根据页面属性(如安全性和共享性)更新状态。PFB条目为PFU提供了所需的数据,以决定何时以及如何进行数据预取,以优化内存访问。
参数作用
cp0_* 参数与时钟、电源管理和系统配置相关。ld_da_* 和st_da_* 参数来自加载和存储指令,用于更新PFB条目。pfu_* 参数是PFU特定的,涉及预取逻辑的状态和配置。amr_wa_cancel 处理地址监视器(AMR)的取消请求。
代码实现流程
-
实例化PFB条目:
- 每个PFB条目是通过
ct_lsu_pfu_pfb_entry 模块实例化的,接收多个输入信号。
- 每个PFB条目是通过
-
参数和信号传递:
- 加载/存储指令的数据和PFU的控制信号传递给每个PFB条目。
- 根据输入信号和内部逻辑,PFB条目更新其状态。
-
状态和控制信号管理:
- 每个条目根据其接收的数据管理预取地址和页面属性。
- 处理与MMU的交互,如页表项的获取和地址转换。
- 跟踪预取请求的进展和状态,如是否从LFB(Load Forwarding Buffer)命中缓存。
通过这种方式,PFB条目支持PFU高效处理预取请求,有助于减少内存访问延迟,提高系统性能。
// &ConnRule(s/_x$/[4]/); @287 // &ConnRule(s/_v$/_4/); @288 // &Instance("ct_lsu_pfu_pfb_entry","x_ct_lsu_pfu_pfb_entry_4"); @289 ct_lsu_pfu_pfb_entry x_ct_lsu_pfu_pfb_entry_4 ( .amr_wa_cancel (amr_wa_cancel ), .cp0_lsu_icg_en (cp0_lsu_icg_en ), .cp0_lsu_l2_st_pref_en (cp0_lsu_l2_st_pref_en ), .cp0_lsu_pfu_mmu_dis (cp0_lsu_pfu_mmu_dis ), .cp0_yy_clk_en (cp0_yy_clk_en ), .cp0_yy_priv_mode (cp0_yy_priv_mode ), .cpurst_b (cpurst_b ), .ld_da_ldfifo_pc (ld_da_ldfifo_pc ), .ld_da_page_sec_ff (ld_da_page_sec_ff ), .ld_da_page_share_ff (ld_da_page_share_ff ), .ld_da_pfu_act_dp_vld (ld_da_pfu_act_dp_vld ), .ld_da_pfu_act_vld (ld_da_pfu_act_vld ), .ld_da_pfu_evict_cnt_vld (ld_da_pfu_evict_cnt_vld ), .ld_da_pfu_pf_inst_vld (ld_da_pfu_pf_inst_vld ), .ld_da_ppfu_va (ld_da_ppfu_va ), .ld_da_ppn_ff (ld_da_ppn_ff ), .lsu_pfu_l1_dist_sel (lsu_pfu_l1_dist_sel ), .lsu_pfu_l2_dist_sel (lsu_pfu_l2_dist_sel ), .lsu_special_clk (lsu_special_clk ), .pad_yy_icg_scan_en (pad_yy_icg_scan_en ), .pfb_no_req_cnt_val (pfb_no_req_cnt_val ), .pfb_timeout_cnt_val (pfb_timeout_cnt_val ), .pfu_biu_pe_req_sel_l1 (pfu_biu_pe_req_sel_l1 ), .pfu_dcache_pref_en (pfu_dcache_pref_en ), .pfu_get_page_sec (pfu_get_page_sec ), .pfu_get_page_share (pfu_get_page_share ), .pfu_get_ppn (pfu_get_ppn ), .pfu_get_ppn_err (pfu_get_ppn_err ), .pfu_get_ppn_vld (pfu_get_ppn_vld ), .pfu_l2_pref_en (pfu_l2_pref_en ), .pfu_mmu_pe_req_sel_l1 (pfu_mmu_pe_req_sel_l1 ), .pfu_pfb_create_pc (pfu_pfb_create_pc ), .pfu_pfb_create_stride (pfu_pfb_create_stride ), .pfu_pfb_create_stride_neg (pfu_pfb_create_stride_neg ), .pfu_pfb_create_strideh_6to0 (pfu_pfb_create_strideh_6to0 ), .pfu_pfb_create_type_ld (pfu_pfb_create_type_ld ), .pfu_pfb_entry_biu_pe_req_grnt_x (pfu_pfb_entry_biu_pe_req_grnt[4] ), .pfu_pfb_entry_biu_pe_req_src_v (pfu_pfb_entry_biu_pe_req_src_4 ), .pfu_pfb_entry_biu_pe_req_x (pfu_pfb_entry_biu_pe_req[4] ), .pfu_pfb_entry_create_dp_vld_x (pfu_pfb_entry_create_dp_vld[4] ), .pfu_pfb_entry_create_gateclk_en_x (pfu_pfb_entry_create_gateclk_en[4] ), .pfu_pfb_entry_create_vld_x (pfu_pfb_entry_create_vld[4] ), .pfu_pfb_entry_evict_x (pfu_pfb_entry_evict[4] ), .pfu_pfb_entry_from_lfb_dcache_hit_x (pfu_pfb_entry_from_lfb_dcache_hit[4] ), .pfu_pfb_entry_from_lfb_dcache_miss_x (pfu_pfb_entry_from_lfb_dcache_miss[4]), .pfu_pfb_entry_hit_pc_x (pfu_pfb_entry_hit_pc[4] ), .pfu_pfb_entry_l1_page_sec_x (pfu_pfb_entry_l1_page_sec[4] ), .pfu_pfb_entry_l1_page_share_x (pfu_pfb_entry_l1_page_share[4] ), .pfu_pfb_entry_l1_pf_addr_v (pfu_pfb_entry_l1_pf_addr_4 ), .pfu_pfb_entry_l1_vpn_v (pfu_pfb_entry_l1_vpn_4 ), .pfu_pfb_entry_l2_page_sec_x (pfu_pfb_entry_l2_page_sec[4] ), .pfu_pfb_entry_l2_page_share_x (pfu_pfb_entry_l2_page_share[4] ), .pfu_pfb_entry_l2_pf_addr_v (pfu_pfb_entry_l2_pf_addr_4 ), .pfu_pfb_entry_l2_vpn_v (pfu_pfb_entry_l2_vpn_4 ), .pfu_pfb_entry_mmu_pe_req_grnt_x (pfu_pfb_entry_mmu_pe_req_grnt[4] ), .pfu_pfb_entry_mmu_pe_req_src_v (pfu_pfb_entry_mmu_pe_req_src_4 ), .pfu_pfb_entry_mmu_pe_req_x (pfu_pfb_entry_mmu_pe_req[4] ), .pfu_pfb_entry_priv_mode_v (pfu_pfb_entry_priv_mode_4 ), .pfu_pfb_entry_vld_x (pfu_pfb_entry_vld[4] ), .pfu_pop_all_part_vld (pfu_pop_all_part_vld ), .st_da_page_sec_ff (st_da_page_sec_ff ), .st_da_page_share_ff (st_da_page_share_ff ), .st_da_pc (st_da_pc ), .st_da_pfu_act_vld (st_da_pfu_act_vld ), .st_da_pfu_evict_cnt_vld (st_da_pfu_evict_cnt_vld ), .st_da_pfu_pf_inst_vld (st_da_pfu_pf_inst_vld ), .st_da_ppfu_va (st_da_ppfu_va ), .st_da_ppn_ff (st_da_ppn_ff ) ); // &ConnRule(s/_x$/[5]/); @291 // &ConnRule(s/_v$/_5/); @292 // &Instance("ct_lsu_pfu_pfb_entry","x_ct_lsu_pfu_pfb_entry_5"); @293 ct_lsu_pfu_pfb_entry x_ct_lsu_pfu_pfb_entry_5 ( .amr_wa_cancel (amr_wa_cancel ), .cp0_lsu_icg_en (cp0_lsu_icg_en ), .cp0_lsu_l2_st_pref_en (cp0_lsu_l2_st_pref_en ), .cp0_lsu_pfu_mmu_dis (cp0_lsu_pfu_mmu_dis ), .cp0_yy_clk_en (cp0_yy_clk_en ), .cp0_yy_priv_mode (cp0_yy_priv_mode ), .cpurst_b (cpurst_b ), .ld_da_ldfifo_pc (ld_da_ldfifo_pc ), .ld_da_page_sec_ff (ld_da_page_sec_ff ), .ld_da_page_share_ff (ld_da_page_share_ff ), .ld_da_pfu_act_dp_vld (ld_da_pfu_act_dp_vld ), .ld_da_pfu_act_vld (ld_da_pfu_act_vld ), .ld_da_pfu_evict_cnt_vld (ld_da_pfu_evict_cnt_vld ), .ld_da_pfu_pf_inst_vld (ld_da_pfu_pf_inst_vld ), .ld_da_ppfu_va (ld_da_ppfu_va ), .ld_da_ppn_ff (ld_da_ppn_ff ), .lsu_pfu_l1_dist_sel (lsu_pfu_l1_dist_sel ), .lsu_pfu_l2_dist_sel (lsu_pfu_l2_dist_sel ), .lsu_special_clk (lsu_special_clk ), .pad_yy_icg_scan_en (pad_yy_icg_scan_en ), .pfb_no_req_cnt_val (pfb_no_req_cnt_val ), .pfb_timeout_cnt_val (pfb_timeout_cnt_val ), .pfu_biu_pe_req_sel_l1 (pfu_biu_pe_req_sel_l1 ), .pfu_dcache_pref_en (pfu_dcache_pref_en ), .pfu_get_page_sec (pfu_get_page_sec ), .pfu_get_page_share (pfu_get_page_share ), .pfu_get_ppn (pfu_get_ppn ), .pfu_get_ppn_err (pfu_get_ppn_err ), .pfu_get_ppn_vld (pfu_get_ppn_vld ), .pfu_l2_pref_en (pfu_l2_pref_en ), .pfu_mmu_pe_req_sel_l1 (pfu_mmu_pe_req_sel_l1 ), .pfu_pfb_create_pc (pfu_pfb_create_pc ), .pfu_pfb_create_stride (pfu_pfb_create_stride ), .pfu_pfb_create_stride_neg (pfu_pfb_create_stride_neg ), .pfu_pfb_create_strideh_6to0 (pfu_pfb_create_strideh_6to0 ), .pfu_pfb_create_type_ld (pfu_pfb_create_type_ld ), .pfu_pfb_entry_biu_pe_req_grnt_x (pfu_pfb_entry_biu_pe_req_grnt[5] ), .pfu_pfb_entry_biu_pe_req_src_v (pfu_pfb_entry_biu_pe_req_src_5 ), .pfu_pfb_entry_biu_pe_req_x (pfu_pfb_entry_biu_pe_req[5] ), .pfu_pfb_entry_create_dp_vld_x (pfu_pfb_entry_create_dp_vld[5] ), .pfu_pfb_entry_create_gateclk_en_x (pfu_pfb_entry_create_gateclk_en[5] ), .pfu_pfb_entry_create_vld_x (pfu_pfb_entry_create_vld[5] ), .pfu_pfb_entry_evict_x (pfu_pfb_entry_evict[5] ), .pfu_pfb_entry_from_lfb_dcache_hit_x (pfu_pfb_entry_from_lfb_dcache_hit[5] ), .pfu_pfb_entry_from_lfb_dcache_miss_x (pfu_pfb_entry_from_lfb_dcache_miss[5]), .pfu_pfb_entry_hit_pc_x (pfu_pfb_entry_hit_pc[5] ), .pfu_pfb_entry_l1_page_sec_x (pfu_pfb_entry_l1_page_sec[5] ), .pfu_pfb_entry_l1_page_share_x (pfu_pfb_entry_l1_page_share[5] ), .pfu_pfb_entry_l1_pf_addr_v (pfu_pfb_entry_l1_pf_addr_5 ), .pfu_pfb_entry_l1_vpn_v (pfu_pfb_entry_l1_vpn_5 ), .pfu_pfb_entry_l2_page_sec_x (pfu_pfb_entry_l2_page_sec[5] ), .pfu_pfb_entry_l2_page_share_x (pfu_pfb_entry_l2_page_share[5] ), .pfu_pfb_entry_l2_pf_addr_v (pfu_pfb_entry_l2_pf_addr_5 ), .pfu_pfb_entry_l2_vpn_v (pfu_pfb_entry_l2_vpn_5 ), .pfu_pfb_entry_mmu_pe_req_grnt_x (pfu_pfb_entry_mmu_pe_req_grnt[5] ), .pfu_pfb_entry_mmu_pe_req_src_v (pfu_pfb_entry_mmu_pe_req_src_5 ), .pfu_pfb_entry_mmu_pe_req_x (pfu_pfb_entry_mmu_pe_req[5] ), .pfu_pfb_entry_priv_mode_v (pfu_pfb_entry_priv_mode_5 ), .pfu_pfb_entry_vld_x (pfu_pfb_entry_vld[5] ), .pfu_pop_all_part_vld (pfu_pop_all_part_vld ), .st_da_page_sec_ff (st_da_page_sec_ff ), .st_da_page_share_ff (st_da_page_share_ff ), .st_da_pc (st_da_pc ), .st_da_pfu_act_vld (st_da_pfu_act_vld ), .st_da_pfu_evict_cnt_vld (st_da_pfu_evict_cnt_vld ), .st_da_pfu_pf_inst_vld (st_da_pfu_pf_inst_vld ), .st_da_ppfu_va (st_da_ppfu_va ), .st_da_ppn_ff (st_da_ppn_ff ) );
// &ConnRule(s/_x$/[6]/); @295 // &ConnRule(s/_v$/_6/); @296 // &Instance("ct_lsu_pfu_pfb_entry","x_ct_lsu_pfu_pfb_entry_6"); @297 ct_lsu_pfu_pfb_entry x_ct_lsu_pfu_pfb_entry_6 ( .amr_wa_cancel (amr_wa_cancel ), .cp0_lsu_icg_en (cp0_lsu_icg_en ), .cp0_lsu_l2_st_pref_en (cp0_lsu_l2_st_pref_en ), .cp0_lsu_pfu_mmu_dis (cp0_lsu_pfu_mmu_dis ), .cp0_yy_clk_en (cp0_yy_clk_en ), .cp0_yy_priv_mode (cp0_yy_priv_mode ), .cpurst_b (cpurst_b ), .ld_da_ldfifo_pc (ld_da_ldfifo_pc ), .ld_da_page_sec_ff (ld_da_page_sec_ff ), .ld_da_page_share_ff (ld_da_page_share_ff ), .ld_da_pfu_act_dp_vld (ld_da_pfu_act_dp_vld ), .ld_da_pfu_act_vld (ld_da_pfu_act_vld ), .ld_da_pfu_evict_cnt_vld (ld_da_pfu_evict_cnt_vld ), .ld_da_pfu_pf_inst_vld (ld_da_pfu_pf_inst_vld ), .ld_da_ppfu_va (ld_da_ppfu_va ), .ld_da_ppn_ff (ld_da_ppn_ff ), .lsu_pfu_l1_dist_sel (lsu_pfu_l1_dist_sel ), .lsu_pfu_l2_dist_sel (lsu_pfu_l2_dist_sel ), .lsu_special_clk (lsu_special_clk ), .pad_yy_icg_scan_en (pad_yy_icg_scan_en ), .pfb_no_req_cnt_val (pfb_no_req_cnt_val ), .pfb_timeout_cnt_val (pfb_timeout_cnt_val ), .pfu_biu_pe_req_sel_l1 (pfu_biu_pe_req_sel_l1 ), .pfu_dcache_pref_en (pfu_dcache_pref_en ), .pfu_get_page_sec (pfu_get_page_sec ), .pfu_get_page_share (pfu_get_page_share ), .pfu_get_ppn (pfu_get_ppn ), .pfu_get_ppn_err (pfu_get_ppn_err ), .pfu_get_ppn_vld (pfu_get_ppn_vld ), .pfu_l2_pref_en (pfu_l2_pref_en ), .pfu_mmu_pe_req_sel_l1 (pfu_mmu_pe_req_sel_l1 ), .pfu_pfb_create_pc (pfu_pfb_create_pc ), .pfu_pfb_create_stride (pfu_pfb_create_stride ), .pfu_pfb_create_stride_neg (pfu_pfb_create_stride_neg ), .pfu_pfb_create_strideh_6to0 (pfu_pfb_create_strideh_6to0 ), .pfu_pfb_create_type_ld (pfu_pfb_create_type_ld ), .pfu_pfb_entry_biu_pe_req_grnt_x (pfu_pfb_entry_biu_pe_req_grnt[6] ), .pfu_pfb_entry_biu_pe_req_src_v (pfu_pfb_entry_biu_pe_req_src_6 ), .pfu_pfb_entry_biu_pe_req_x (pfu_pfb_entry_biu_pe_req[6] ), .pfu_pfb_entry_create_dp_vld_x (pfu_pfb_entry_create_dp_vld[6] ), .pfu_pfb_entry_create_gateclk_en_x (pfu_pfb_entry_create_gateclk_en[6] ), .pfu_pfb_entry_create_vld_x (pfu_pfb_entry_create_vld[6] ), .pfu_pfb_entry_evict_x (pfu_pfb_entry_evict[6] ), .pfu_pfb_entry_from_lfb_dcache_hit_x (pfu_pfb_entry_from_lfb_dcache_hit[6] ), .pfu_pfb_entry_from_lfb_dcache_miss_x (pfu_pfb_entry_from_lfb_dcache_miss[6]), .pfu_pfb_entry_hit_pc_x (pfu_pfb_entry_hit_pc[6] ), .pfu_pfb_entry_l1_page_sec_x (pfu_pfb_entry_l1_page_sec[6] ), .pfu_pfb_entry_l1_page_share_x (pfu_pfb_entry_l1_page_share[6] ), .pfu_pfb_entry_l1_pf_addr_v (pfu_pfb_entry_l1_pf_addr_6 ), .pfu_pfb_entry_l1_vpn_v (pfu_pfb_entry_l1_vpn_6 ), .pfu_pfb_entry_l2_page_sec_x (pfu_pfb_entry_l2_page_sec[6] ), .pfu_pfb_entry_l2_page_share_x (pfu_pfb_entry_l2_page_share[6] ), .pfu_pfb_entry_l2_pf_addr_v (pfu_pfb_entry_l2_pf_addr_6 ), .pfu_pfb_entry_l2_vpn_v (pfu_pfb_entry_l2_vpn_6 ), .pfu_pfb_entry_mmu_pe_req_grnt_x (pfu_pfb_entry_mmu_pe_req_grnt[6] ), .pfu_pfb_entry_mmu_pe_req_src_v (pfu_pfb_entry_mmu_pe_req_src_6 ), .pfu_pfb_entry_mmu_pe_req_x (pfu_pfb_entry_mmu_pe_req[6] ), .pfu_pfb_entry_priv_mode_v (pfu_pfb_entry_priv_mode_6 ), .pfu_pfb_entry_vld_x (pfu_pfb_entry_vld[6] ), .pfu_pop_all_part_vld (pfu_pop_all_part_vld ), .st_da_page_sec_ff (st_da_page_sec_ff ), .st_da_page_share_ff (st_da_page_share_ff ), .st_da_pc (st_da_pc ), .st_da_pfu_act_vld (st_da_pfu_act_vld ), .st_da_pfu_evict_cnt_vld (st_da_pfu_evict_cnt_vld ), .st_da_pfu_pf_inst_vld (st_da_pfu_pf_inst_vld ), .st_da_ppfu_va (st_da_ppfu_va ), .st_da_ppn_ff (st_da_ppn_ff ) ); // &ConnRule(s/_x$/[7]/); @299 // &ConnRule(s/_v$/_7/); @300 // &Instance("ct_lsu_pfu_pfb_entry","x_ct_lsu_pfu_pfb_entry_7"); @301 ct_lsu_pfu_pfb_entry x_ct_lsu_pfu_pfb_entry_7 ( .amr_wa_cancel (amr_wa_cancel ), .cp0_lsu_icg_en (cp0_lsu_icg_en ), .cp0_lsu_l2_st_pref_en (cp0_lsu_l2_st_pref_en ), .cp0_lsu_pfu_mmu_dis (cp0_lsu_pfu_mmu_dis ), .cp0_yy_clk_en (cp0_yy_clk_en ), .cp0_yy_priv_mode (cp0_yy_priv_mode ), .cpurst_b (cpurst_b ), .ld_da_ldfifo_pc (ld_da_ldfifo_pc ), .ld_da_page_sec_ff (ld_da_page_sec_ff ), .ld_da_page_share_ff (ld_da_page_share_ff ), .ld_da_pfu_act_dp_vld (ld_da_pfu_act_dp_vld ), .ld_da_pfu_act_vld (ld_da_pfu_act_vld ), .ld_da_pfu_evict_cnt_vld (ld_da_pfu_evict_cnt_vld ), .ld_da_pfu_pf_inst_vld (ld_da_pfu_pf_inst_vld ), .ld_da_ppfu_va (ld_da_ppfu_va ), .ld_da_ppn_ff (ld_da_ppn_ff ), .lsu_pfu_l1_dist_sel (lsu_pfu_l1_dist_sel ), .lsu_pfu_l2_dist_sel (lsu_pfu_l2_dist_sel ), .lsu_special_clk (lsu_special_clk ), .pad_yy_icg_scan_en (pad_yy_icg_scan_en ), .pfb_no_req_cnt_val (pfb_no_req_cnt_val ), .pfb_timeout_cnt_val (pfb_timeout_cnt_val ), .pfu_biu_pe_req_sel_l1 (pfu_biu_pe_req_sel_l1 ), .pfu_dcache_pref_en (pfu_dcache_pref_en ), .pfu_get_page_sec (pfu_get_page_sec ), .pfu_get_page_share (pfu_get_page_share ), .pfu_get_ppn (pfu_get_ppn ), .pfu_get_ppn_err (pfu_get_ppn_err ), .pfu_get_ppn_vld (pfu_get_ppn_vld ), .pfu_l2_pref_en (pfu_l2_pref_en ), .pfu_mmu_pe_req_sel_l1 (pfu_mmu_pe_req_sel_l1 ), .pfu_pfb_create_pc (pfu_pfb_create_pc ), .pfu_pfb_create_stride (pfu_pfb_create_stride ), .pfu_pfb_create_stride_neg (pfu_pfb_create_stride_neg ), .pfu_pfb_create_strideh_6to0 (pfu_pfb_create_strideh_6to0 ), .pfu_pfb_create_type_ld (pfu_pfb_create_type_ld ), .pfu_pfb_entry_biu_pe_req_grnt_x (pfu_pfb_entry_biu_pe_req_grnt[7] ), .pfu_pfb_entry_biu_pe_req_src_v (pfu_pfb_entry_biu_pe_req_src_7 ), .pfu_pfb_entry_biu_pe_req_x (pfu_pfb_entry_biu_pe_req[7] ), .pfu_pfb_entry_create_dp_vld_x (pfu_pfb_entry_create_dp_vld[7] ), .pfu_pfb_entry_create_gateclk_en_x (pfu_pfb_entry_create_gateclk_en[7] ), .pfu_pfb_entry_create_vld_x (pfu_pfb_entry_create_vld[7] ), .pfu_pfb_entry_evict_x (pfu_pfb_entry_evict[7] ), .pfu_pfb_entry_from_lfb_dcache_hit_x (pfu_pfb_entry_from_lfb_dcache_hit[7] ), .pfu_pfb_entry_from_lfb_dcache_miss_x (pfu_pfb_entry_from_lfb_dcache_miss[7]), .pfu_pfb_entry_hit_pc_x (pfu_pfb_entry_hit_pc[7] ), .pfu_pfb_entry_l1_page_sec_x (pfu_pfb_entry_l1_page_sec[7] ), .pfu_pfb_entry_l1_page_share_x (pfu_pfb_entry_l1_page_share[7] ), .pfu_pfb_entry_l1_pf_addr_v (pfu_pfb_entry_l1_pf_addr_7 ), .pfu_pfb_entry_l1_vpn_v (pfu_pfb_entry_l1_vpn_7 ), .pfu_pfb_entry_l2_page_sec_x (pfu_pfb_entry_l2_page_sec[7] ), .pfu_pfb_entry_l2_page_share_x (pfu_pfb_entry_l2_page_share[7] ), .pfu_pfb_entry_l2_pf_addr_v (pfu_pfb_entry_l2_pf_addr_7 ), .pfu_pfb_entry_l2_vpn_v (pfu_pfb_entry_l2_vpn_7 ), .pfu_pfb_entry_mmu_pe_req_grnt_x (pfu_pfb_entry_mmu_pe_req_grnt[7] ), .pfu_pfb_entry_mmu_pe_req_src_v (pfu_pfb_entry_mmu_pe_req_src_7 ), .pfu_pfb_entry_mmu_pe_req_x (pfu_pfb_entry_mmu_pe_req[7] ), .pfu_pfb_entry_priv_mode_v (pfu_pfb_entry_priv_mode_7 ), .pfu_pfb_entry_vld_x (pfu_pfb_entry_vld[7] ), .pfu_pop_all_part_vld (pfu_pop_all_part_vld ), .st_da_page_sec_ff (st_da_page_sec_ff ), .st_da_page_share_ff (st_da_page_share_ff ), .st_da_pc (st_da_pc ), .st_da_pfu_act_vld (st_da_pfu_act_vld ), .st_da_pfu_evict_cnt_vld (st_da_pfu_evict_cnt_vld ), .st_da_pfu_pf_inst_vld (st_da_pfu_pf_inst_vld ), .st_da_ppfu_va (st_da_ppfu_va ), .st_da_ppn_ff (st_da_ppn_ff ) );
这段代码展示了预取缓冲单元(PFU)的预取缓冲条目(PFB)第四个和第五个实例的实现。每个PFB条目都是通过
功能
PFB条目负责处理预取逻辑,包括确定预取地址、与内存管理单元(MMU)交互以获取页表项和地址转换、以及根据页面属性(安全性和共享性)来更新状态。这些条目的目的是优化内存访问,减少访问延迟。
参数作用
cp0_* 参数用于控制时钟、电源管理和系统配置。ld_da_* 和st_da_* 参数来源于加载和存储指令,用于更新PFB条目的状态。pfu_* 参数特定于预取逻辑,控制预取的状态和行为。amr_wa_cancel 用于处理地址监视器的取消请求。
代码实现流程
-
实例化PFB条目:
- 通过
ct_lsu_pfu_pfb_entry 模块实例化第四个和第五个PFB条目,传递相关的输入信号。
- 通过
-
参数和信号传递:
- 将加载/存储指令的数据和PFU的控制信号传递给PFB条目。
-
状态更新和控制:
- 根据接收到的信号和内部逻辑,每个PFB条目更新其状态,包括预取地址和页面属性。
- 管理与MMU的交互,例如,获取页表项和进行地址转换。
- 跟踪预取请求的进展和状态,例如,是否从Load Forwarding Buffer(LFB)命中或未命中缓存。
PFB条目的这种管理方式支持PFU有效处理预取请求,减少内存访问延迟,提高整体系统性能。
// &ConnRule(s/_x$/[6]/); @295 // &ConnRule(s/_v$/_6/); @296 // &Instance("ct_lsu_pfu_pfb_entry","x_ct_lsu_pfu_pfb_entry_6"); @297 ct_lsu_pfu_pfb_entry x_ct_lsu_pfu_pfb_entry_6 ( .amr_wa_cancel (amr_wa_cancel ), .cp0_lsu_icg_en (cp0_lsu_icg_en ), .cp0_lsu_l2_st_pref_en (cp0_lsu_l2_st_pref_en ), .cp0_lsu_pfu_mmu_dis (cp0_lsu_pfu_mmu_dis ), .cp0_yy_clk_en (cp0_yy_clk_en ), .cp0_yy_priv_mode (cp0_yy_priv_mode ), .cpurst_b (cpurst_b ), .ld_da_ldfifo_pc (ld_da_ldfifo_pc ), .ld_da_page_sec_ff (ld_da_page_sec_ff ), .ld_da_page_share_ff (ld_da_page_share_ff ), .ld_da_pfu_act_dp_vld (ld_da_pfu_act_dp_vld ), .ld_da_pfu_act_vld (ld_da_pfu_act_vld ), .ld_da_pfu_evict_cnt_vld (ld_da_pfu_evict_cnt_vld ), .ld_da_pfu_pf_inst_vld (ld_da_pfu_pf_inst_vld ), .ld_da_ppfu_va (ld_da_ppfu_va ), .ld_da_ppn_ff (ld_da_ppn_ff ), .lsu_pfu_l1_dist_sel (lsu_pfu_l1_dist_sel ), .lsu_pfu_l2_dist_sel (lsu_pfu_l2_dist_sel ), .lsu_special_clk (lsu_special_clk ), .pad_yy_icg_scan_en (pad_yy_icg_scan_en ), .pfb_no_req_cnt_val (pfb_no_req_cnt_val ), .pfb_timeout_cnt_val (pfb_timeout_cnt_val ), .pfu_biu_pe_req_sel_l1 (pfu_biu_pe_req_sel_l1 ), .pfu_dcache_pref_en (pfu_dcache_pref_en ), .pfu_get_page_sec (pfu_get_page_sec ), .pfu_get_page_share (pfu_get_page_share ), .pfu_get_ppn (pfu_get_ppn ), .pfu_get_ppn_err (pfu_get_ppn_err ), .pfu_get_ppn_vld (pfu_get_ppn_vld ), .pfu_l2_pref_en (pfu_l2_pref_en ), .pfu_mmu_pe_req_sel_l1 (pfu_mmu_pe_req_sel_l1 ), .pfu_pfb_create_pc (pfu_pfb_create_pc ), .pfu_pfb_create_stride (pfu_pfb_create_stride ), .pfu_pfb_create_stride_neg (pfu_pfb_create_stride_neg ), .pfu_pfb_create_strideh_6to0 (pfu_pfb_create_strideh_6to0 ), .pfu_pfb_create_type_ld (pfu_pfb_create_type_ld ), .pfu_pfb_entry_biu_pe_req_grnt_x (pfu_pfb_entry_biu_pe_req_grnt[6] ), .pfu_pfb_entry_biu_pe_req_src_v (pfu_pfb_entry_biu_pe_req_src_6 ), .pfu_pfb_entry_biu_pe_req_x (pfu_pfb_entry_biu_pe_req[6] ), .pfu_pfb_entry_create_dp_vld_x (pfu_pfb_entry_create_dp_vld[6] ), .pfu_pfb_entry_create_gateclk_en_x (pfu_pfb_entry_create_gateclk_en[6] ), .pfu_pfb_entry_create_vld_x (pfu_pfb_entry_create_vld[6] ), .pfu_pfb_entry_evict_x (pfu_pfb_entry_evict[6] ), .pfu_pfb_entry_from_lfb_dcache_hit_x (pfu_pfb_entry_from_lfb_dcache_hit[6] ), .pfu_pfb_entry_from_lfb_dcache_miss_x (pfu_pfb_entry_from_lfb_dcache_miss[6]), .pfu_pfb_entry_hit_pc_x (pfu_pfb_entry_hit_pc[6] ), .pfu_pfb_entry_l1_page_sec_x (pfu_pfb_entry_l1_page_sec[6] ), .pfu_pfb_entry_l1_page_share_x (pfu_pfb_entry_l1_page_share[6] ), .pfu_pfb_entry_l1_pf_addr_v (pfu_pfb_entry_l1_pf_addr_6 ), .pfu_pfb_entry_l1_vpn_v (pfu_pfb_entry_l1_vpn_6 ), .pfu_pfb_entry_l2_page_sec_x (pfu_pfb_entry_l2_page_sec[6] ), .pfu_pfb_entry_l2_page_share_x (pfu_pfb_entry_l2_page_share[6] ), .pfu_pfb_entry_l2_pf_addr_v (pfu_pfb_entry_l2_pf_addr_6 ), .pfu_pfb_entry_l2_vpn_v (pfu_pfb_entry_l2_vpn_6 ), .pfu_pfb_entry_mmu_pe_req_grnt_x (pfu_pfb_entry_mmu_pe_req_grnt[6] ), .pfu_pfb_entry_mmu_pe_req_src_v (pfu_pfb_entry_mmu_pe_req_src_6 ), .pfu_pfb_entry_mmu_pe_req_x (pfu_pfb_entry_mmu_pe_req[6] ), .pfu_pfb_entry_priv_mode_v (pfu_pfb_entry_priv_mode_6 ), .pfu_pfb_entry_vld_x (pfu_pfb_entry_vld[6] ), .pfu_pop_all_part_vld (pfu_pop_all_part_vld ), .st_da_page_sec_ff (st_da_page_sec_ff ), .st_da_page_share_ff (st_da_page_share_ff ), .st_da_pc (st_da_pc ), .st_da_pfu_act_vld (st_da_pfu_act_vld ), .st_da_pfu_evict_cnt_vld (st_da_pfu_evict_cnt_vld ), .st_da_pfu_pf_inst_vld (st_da_pfu_pf_inst_vld ), .st_da_ppfu_va (st_da_ppfu_va ), .st_da_ppn_ff (st_da_ppn_ff ) ); // &ConnRule(s/_x$/[7]/); @299 // &ConnRule(s/_v$/_7/); @300 // &Instance("ct_lsu_pfu_pfb_entry","x_ct_lsu_pfu_pfb_entry_7"); @301 ct_lsu_pfu_pfb_entry x_ct_lsu_pfu_pfb_entry_7 ( .amr_wa_cancel (amr_wa_cancel ), .cp0_lsu_icg_en (cp0_lsu_icg_en ), .cp0_lsu_l2_st_pref_en (cp0_lsu_l2_st_pref_en ), .cp0_lsu_pfu_mmu_dis (cp0_lsu_pfu_mmu_dis ), .cp0_yy_clk_en (cp0_yy_clk_en ), .cp0_yy_priv_mode (cp0_yy_priv_mode ), .cpurst_b (cpurst_b ), .ld_da_ldfifo_pc (ld_da_ldfifo_pc ), .ld_da_page_sec_ff (ld_da_page_sec_ff ), .ld_da_page_share_ff (ld_da_page_share_ff ), .ld_da_pfu_act_dp_vld (ld_da_pfu_act_dp_vld ), .ld_da_pfu_act_vld (ld_da_pfu_act_vld ), .ld_da_pfu_evict_cnt_vld (ld_da_pfu_evict_cnt_vld ), .ld_da_pfu_pf_inst_vld (ld_da_pfu_pf_inst_vld ), .ld_da_ppfu_va (ld_da_ppfu_va ), .ld_da_ppn_ff (ld_da_ppn_ff ), .lsu_pfu_l1_dist_sel (lsu_pfu_l1_dist_sel ), .lsu_pfu_l2_dist_sel (lsu_pfu_l2_dist_sel ), .lsu_special_clk (lsu_special_clk ), .pad_yy_icg_scan_en (pad_yy_icg_scan_en ), .pfb_no_req_cnt_val (pfb_no_req_cnt_val ), .pfb_timeout_cnt_val (pfb_timeout_cnt_val ), .pfu_biu_pe_req_sel_l1 (pfu_biu_pe_req_sel_l1 ), .pfu_dcache_pref_en (pfu_dcache_pref_en ), .pfu_get_page_sec (pfu_get_page_sec ), .pfu_get_page_share (pfu_get_page_share ), .pfu_get_ppn (pfu_get_ppn ), .pfu_get_ppn_err (pfu_get_ppn_err ), .pfu_get_ppn_vld (pfu_get_ppn_vld ), .pfu_l2_pref_en (pfu_l2_pref_en ), .pfu_mmu_pe_req_sel_l1 (pfu_mmu_pe_req_sel_l1 ), .pfu_pfb_create_pc (pfu_pfb_create_pc ), .pfu_pfb_create_stride (pfu_pfb_create_stride ), .pfu_pfb_create_stride_neg (pfu_pfb_create_stride_neg ), .pfu_pfb_create_strideh_6to0 (pfu_pfb_create_strideh_6to0 ), .pfu_pfb_create_type_ld (pfu_pfb_create_type_ld ), .pfu_pfb_entry_biu_pe_req_grnt_x (pfu_pfb_entry_biu_pe_req_grnt[7] ), .pfu_pfb_entry_biu_pe_req_src_v (pfu_pfb_entry_biu_pe_req_src_7 ), .pfu_pfb_entry_biu_pe_req_x (pfu_pfb_entry_biu_pe_req[7] ), .pfu_pfb_entry_create_dp_vld_x (pfu_pfb_entry_create_dp_vld[7] ), .pfu_pfb_entry_create_gateclk_en_x (pfu_pfb_entry_create_gateclk_en[7] ), .pfu_pfb_entry_create_vld_x (pfu_pfb_entry_create_vld[7] ), .pfu_pfb_entry_evict_x (pfu_pfb_entry_evict[7] ), .pfu_pfb_entry_from_lfb_dcache_hit_x (pfu_pfb_entry_from_lfb_dcache_hit[7] ), .pfu_pfb_entry_from_lfb_dcache_miss_x (pfu_pfb_entry_from_lfb_dcache_miss[7]), .pfu_pfb_entry_hit_pc_x (pfu_pfb_entry_hit_pc[7] ), .pfu_pfb_entry_l1_page_sec_x (pfu_pfb_entry_l1_page_sec[7] ), .pfu_pfb_entry_l1_page_share_x (pfu_pfb_entry_l1_page_share[7] ), .pfu_pfb_entry_l1_pf_addr_v (pfu_pfb_entry_l1_pf_addr_7 ), .pfu_pfb_entry_l1_vpn_v (pfu_pfb_entry_l1_vpn_7 ), .pfu_pfb_entry_l2_page_sec_x (pfu_pfb_entry_l2_page_sec[7] ), .pfu_pfb_entry_l2_page_share_x (pfu_pfb_entry_l2_page_share[7] ), .pfu_pfb_entry_l2_pf_addr_v (pfu_pfb_entry_l2_pf_addr_7 ), .pfu_pfb_entry_l2_vpn_v (pfu_pfb_entry_l2_vpn_7 ), .pfu_pfb_entry_mmu_pe_req_grnt_x (pfu_pfb_entry_mmu_pe_req_grnt[7] ), .pfu_pfb_entry_mmu_pe_req_src_v (pfu_pfb_entry_mmu_pe_req_src_7 ), .pfu_pfb_entry_mmu_pe_req_x (pfu_pfb_entry_mmu_pe_req[7] ), .pfu_pfb_entry_priv_mode_v (pfu_pfb_entry_priv_mode_7 ), .pfu_pfb_entry_vld_x (pfu_pfb_entry_vld[7] ), .pfu_pop_all_part_vld (pfu_pop_all_part_vld ), .st_da_page_sec_ff (st_da_page_sec_ff ), .st_da_page_share_ff (st_da_page_share_ff ), .st_da_pc (st_da_pc ), .st_da_pfu_act_vld (st_da_pfu_act_vld ), .st_da_pfu_evict_cnt_vld (st_da_pfu_evict_cnt_vld ), .st_da_pfu_pf_inst_vld (st_da_pfu_pf_inst_vld ), .st_da_ppfu_va (st_da_ppfu_va ), .st_da_ppn_ff (st_da_ppn_ff ) );
这段代码是预取缓冲单元(PFU)的预取缓冲条目(PFB)第六个和第七个实例的实现。PFB条目是PFU中用于管理预取逻辑的关键组件。
功能
- PFB条目用于处理和维护预取请求。它们负责确定预取地址、与内存管理单元(MMU)进行交互以获取页表项和进行地址转换,以及根据页面的安全性和共享性更新状态。
参数作用
cp0_* 参数:控制时钟、电源管理和系统配置。ld_da_* 和st_da_* 参数:从加载和存储指令获取信息,用于更新PFB条目的状态。pfu_* 参数:特定于预取逻辑,控制预取行为。amr_wa_cancel :处理地址监视器的取消请求。pad_yy_icg_scan_en :控制集成时钟门控扫描。
代码实现流程
-
实例化PFB条目:
- 使用
ct_lsu_pfu_pfb_entry 模块实例化第六个和第七个PFB条目,为它们提供必要的输入信号。
- 使用
-
状态更新和控制:
- 每个PFB条目根据接收到的信号和内部逻辑更新其状态,包括预取地址和页面属性。
- 管理与MMU的交互,进行地址转换和获取页表项。
- 跟踪预取请求的进展,包括是否从Load Forwarding Buffer(LFB)命中或未命中缓存。
-
参数传递:
- 将加载/存储指令的数据、PFU的控制信号和MMU的反馈传递给PFB条目,以便它们可以相应地更新状态。
通过这种方式,PFB条目支持PFU有效地处理预取请求,减少内存访问延迟,提升系统性能。
//========================================================== // Generate full/create signal of pfb //========================================================== //------------------pop pointer of sdb---------------------- // &CombBeg; @307 always @( pfu_sdb_entry_ready[1:0]) begin pfu_sdb_pop_ptr[SDB_ENTRY-1:0] = {SDB_ENTRY{1'b0}}; casez(pfu_sdb_entry_ready[SDB_ENTRY-1:0]) 2'b?1:pfu_sdb_pop_ptr[0] = 1'b1; 2'b10:pfu_sdb_pop_ptr[1] = 1'b1; default:pfu_sdb_pop_ptr[SDB_ENTRY-1:0] = {SDB_ENTRY{1'b0}}; endcase // &CombEnd; @314 end //-------------------create info of pfb--------------------- assign pfu_pfb_create_pc[PC_LEN-1:0] = {PC_LEN{pfu_sdb_pop_ptr[0]}} & pfu_sdb_entry_pc_0[PC_LEN-1:0] | {PC_LEN{pfu_sdb_pop_ptr[1]}} & pfu_sdb_entry_pc_1[PC_LEN-1:0]; assign pfu_pfb_create_stride[10:0] = {11{pfu_sdb_pop_ptr[0]}} & pfu_sdb_entry_stride_0[10:0] | {11{pfu_sdb_pop_ptr[1]}} & pfu_sdb_entry_stride_1[10:0]; assign pfu_pfb_create_strideh_6to0[6:0] = {7{pfu_sdb_pop_ptr[0]}} & pfu_sdb_entry_strideh_6to0_0[6:0] | {7{pfu_sdb_pop_ptr[1]}} & pfu_sdb_entry_strideh_6to0_1[6:0]; assign pfu_pfb_create_stride_neg = |(pfu_sdb_pop_ptr[SDB_ENTRY-1:0] & pfu_sdb_entry_stride_neg[SDB_ENTRY-1:0]); assign pfu_pfb_create_type_ld = |(pfu_sdb_pop_ptr[SDB_ENTRY-1:0] & pfu_sdb_entry_type_ld[SDB_ENTRY-1:0]); //---------------------create pointer----------------------- //if it has empty entry, then create signal to empty entry, //else create siganl to evict entry, //else create fail // &CombBeg; @332 always @( pfu_pfb_entry_vld[7:0]) begin pfu_pfb_empty_create_ptr[PFB_ENTRY-1:0] = {PFB_ENTRY{1'b0}}; casez(pfu_pfb_entry_vld[PFB_ENTRY-1:0]) 8'b????_???0:pfu_pfb_empty_create_ptr[0] = 1'b1; 8'b????_??01:pfu_pfb_empty_create_ptr[1] = 1'b1; 8'b????_?011:pfu_pfb_empty_create_ptr[2] = 1'b1; 8'b????_0111:pfu_pfb_empty_create_ptr[3] = 1'b1; 8'b???0_1111:pfu_pfb_empty_create_ptr[4] = 1'b1; 8'b??01_1111:pfu_pfb_empty_create_ptr[5] = 1'b1; 8'b?011_1111:pfu_pfb_empty_create_ptr[6] = 1'b1; 8'b0111_1111:pfu_pfb_empty_create_ptr[7] = 1'b1; default:pfu_pfb_empty_create_ptr[PFB_ENTRY-1:0] = {PFB_ENTRY{1'b0}}; endcase // &CombEnd; @345 end // &CombBeg; @347 always @( pfu_pfb_entry_evict[7:0]) begin pfu_pfb_evict_create_ptr[PFB_ENTRY-1:0] = {PFB_ENTRY{1'b0}}; casez(pfu_pfb_entry_evict[PFB_ENTRY-1:0]) 8'b????_???1:pfu_pfb_evict_create_ptr[0] = 1'b1; 8'b????_??10:pfu_pfb_evict_create_ptr[1] = 1'b1; 8'b????_?100:pfu_pfb_evict_create_ptr[2] = 1'b1; 8'b????_1000:pfu_pfb_evict_create_ptr[3] = 1'b1; 8'b???1_0000:pfu_pfb_evict_create_ptr[4] = 1'b1; 8'b??10_0000:pfu_pfb_evict_create_ptr[5] = 1'b1; 8'b?100_0000:pfu_pfb_evict_create_ptr[6] = 1'b1; 8'b1000_0000:pfu_pfb_evict_create_ptr[7] = 1'b1; default:pfu_pfb_evict_create_ptr[PFB_ENTRY-1:0] = {PFB_ENTRY{1'b0}}; endcase // &CombEnd; @360 end assign pfu_pfb_full = &pfu_pfb_entry_vld[PFB_ENTRY-1:0]; assign pfu_pfb_has_evict = |pfu_pfb_entry_evict[PFB_ENTRY-1:0]; assign pfu_pfb_create_ptr[PFB_ENTRY-1:0] = pfu_pfb_full ? pfu_pfb_evict_create_ptr[PFB_ENTRY-1:0] : pfu_pfb_empty_create_ptr[PFB_ENTRY-1:0];
这段代码描述了预取缓冲条目(PFB)的生成逻辑,包括PFB的填充状态、创建信号、以及如何从预取流水线(SDB)中提取数据来创建PFB条目。
功能
- 处理SDB条目的弹出逻辑:当一个条目在SDB(Stride Detection Buffer)中完成时,它会被弹出并用于创建PFB条目。
- 生成PFB条目的创建信息:包括程序计数器(PC)、步长信息,以及预取类型(加载或存储)。
- 确定PFB条目的创建位置:根据PFB中的空闲或可逐出条目的位置,决定新条目的位置。
参数作用
pfu_sdb_entry_ready :表示SDB条目是否准备好被弹出。pfu_pfb_entry_vld 和pfu_pfb_entry_evict :分别表示PFB条目是否有效和是否可以被逐出。
代码实现流程
- 弹出指针生成:根据SDB条目的就绪状态,生成一个弹出指针
pfu_sdb_pop_ptr 。 - 创建信息生成:使用弹出指针选择相应的SDB条目数据(如PC和步长),用于构建新的PFB条目。
- 创建位置决定:
- 首先检查PFB中是否有空闲位置,如果有,则生成指向这些空闲位置的指针
pfu_pfb_empty_create_ptr 。 - 如果没有空闲位置,则检查是否有可以被逐出的条目,生成指向这些条目的指针
pfu_pfb_evict_create_ptr 。
- 首先检查PFB中是否有空闲位置,如果有,则生成指向这些空闲位置的指针
- 创建指针选择:
- 如果PFB已满,但存在可逐出的条目,则选择
pfu_pfb_evict_create_ptr 。 - 如果PFB未满,选择
pfu_pfb_empty_create_ptr 。
- 如果PFB已满,但存在可逐出的条目,则选择
这个过程确保了PFB可以有效地利用其空间,同时优先考虑在SDB中完成的预取请求,从而提高预取效率。