384 lines
13 KiB
Systemverilog
384 lines
13 KiB
Systemverilog
// Generated by CIRCT firtool-1.151.0
|
|
module DTLB(
|
|
input [33:0] io_req_bits_vaddr,
|
|
input [1:0] io_req_bits_size,
|
|
input [4:0] io_req_bits_cmd,
|
|
input [1:0] io_req_bits_prv,
|
|
output [31:0] io_resp_paddr,
|
|
output io_resp_pf_ld,
|
|
io_resp_pf_st,
|
|
io_resp_ae_ld,
|
|
io_resp_ae_st,
|
|
io_resp_ma_ld,
|
|
io_resp_ma_st,
|
|
io_resp_cacheable,
|
|
input io_ptw_status_debug,
|
|
io_ptw_pmp_0_cfg_l,
|
|
input [1:0] io_ptw_pmp_0_cfg_a,
|
|
input io_ptw_pmp_0_cfg_w,
|
|
io_ptw_pmp_0_cfg_r,
|
|
input [29:0] io_ptw_pmp_0_addr,
|
|
input [31:0] io_ptw_pmp_0_mask,
|
|
input io_ptw_pmp_1_cfg_l,
|
|
input [1:0] io_ptw_pmp_1_cfg_a,
|
|
input io_ptw_pmp_1_cfg_w,
|
|
io_ptw_pmp_1_cfg_r,
|
|
input [29:0] io_ptw_pmp_1_addr,
|
|
input [31:0] io_ptw_pmp_1_mask,
|
|
input io_ptw_pmp_2_cfg_l,
|
|
input [1:0] io_ptw_pmp_2_cfg_a,
|
|
input io_ptw_pmp_2_cfg_w,
|
|
io_ptw_pmp_2_cfg_r,
|
|
input [29:0] io_ptw_pmp_2_addr,
|
|
input [31:0] io_ptw_pmp_2_mask,
|
|
input io_ptw_pmp_3_cfg_l,
|
|
input [1:0] io_ptw_pmp_3_cfg_a,
|
|
input io_ptw_pmp_3_cfg_w,
|
|
io_ptw_pmp_3_cfg_r,
|
|
input [29:0] io_ptw_pmp_3_addr,
|
|
input [31:0] io_ptw_pmp_3_mask,
|
|
input io_ptw_pmp_4_cfg_l,
|
|
input [1:0] io_ptw_pmp_4_cfg_a,
|
|
input io_ptw_pmp_4_cfg_w,
|
|
io_ptw_pmp_4_cfg_r,
|
|
input [29:0] io_ptw_pmp_4_addr,
|
|
input [31:0] io_ptw_pmp_4_mask,
|
|
input io_ptw_pmp_5_cfg_l,
|
|
input [1:0] io_ptw_pmp_5_cfg_a,
|
|
input io_ptw_pmp_5_cfg_w,
|
|
io_ptw_pmp_5_cfg_r,
|
|
input [29:0] io_ptw_pmp_5_addr,
|
|
input [31:0] io_ptw_pmp_5_mask,
|
|
input io_ptw_pmp_6_cfg_l,
|
|
input [1:0] io_ptw_pmp_6_cfg_a,
|
|
input io_ptw_pmp_6_cfg_w,
|
|
io_ptw_pmp_6_cfg_r,
|
|
input [29:0] io_ptw_pmp_6_addr,
|
|
input [31:0] io_ptw_pmp_6_mask,
|
|
input io_ptw_pmp_7_cfg_l,
|
|
input [1:0] io_ptw_pmp_7_cfg_a,
|
|
input io_ptw_pmp_7_cfg_w,
|
|
io_ptw_pmp_7_cfg_r,
|
|
input [29:0] io_ptw_pmp_7_addr,
|
|
input [31:0] io_ptw_pmp_7_mask
|
|
);
|
|
|
|
wire _pma_io_resp_r;
|
|
wire _pma_io_resp_w;
|
|
wire _pma_io_resp_pp;
|
|
wire _pma_io_resp_al;
|
|
wire _pma_io_resp_aa;
|
|
wire _pma_io_resp_eff;
|
|
wire _pmp_io_r;
|
|
wire _pmp_io_w;
|
|
wire deny_access_to_debug = ~io_ptw_status_debug & io_req_bits_vaddr[33:12] == 22'h0;
|
|
wire misaligned = |(io_req_bits_vaddr[3:0] & (4'h1 << io_req_bits_size) - 4'h1);
|
|
wire _cmd_read_T_2 = io_req_bits_cmd == 5'h6;
|
|
wire _cmd_write_T_3 = io_req_bits_cmd == 5'h7;
|
|
wire _cmd_write_T_5 = io_req_bits_cmd == 5'h4;
|
|
wire _cmd_write_T_6 = io_req_bits_cmd == 5'h9;
|
|
wire _cmd_write_T_7 = io_req_bits_cmd == 5'hA;
|
|
wire _cmd_write_T_8 = io_req_bits_cmd == 5'hB;
|
|
wire _cmd_write_T_12 = io_req_bits_cmd == 5'h8;
|
|
wire _cmd_write_T_13 = io_req_bits_cmd == 5'hC;
|
|
wire _cmd_write_T_14 = io_req_bits_cmd == 5'hD;
|
|
wire _cmd_write_T_15 = io_req_bits_cmd == 5'hE;
|
|
wire _cmd_write_T_16 = io_req_bits_cmd == 5'hF;
|
|
wire cmd_put_partial = io_req_bits_cmd == 5'h11;
|
|
wire cmd_read =
|
|
io_req_bits_cmd == 5'h0 | io_req_bits_cmd == 5'h10 | _cmd_read_T_2 | _cmd_write_T_3
|
|
| _cmd_write_T_5 | _cmd_write_T_6 | _cmd_write_T_7 | _cmd_write_T_8 | _cmd_write_T_12
|
|
| _cmd_write_T_13 | _cmd_write_T_14 | _cmd_write_T_15 | _cmd_write_T_16;
|
|
wire cmd_write =
|
|
io_req_bits_cmd == 5'h1 | cmd_put_partial | _cmd_write_T_3 | _cmd_write_T_5
|
|
| _cmd_write_T_6 | _cmd_write_T_7 | _cmd_write_T_8 | _cmd_write_T_12 | _cmd_write_T_13
|
|
| _cmd_write_T_14 | _cmd_write_T_15 | _cmd_write_T_16;
|
|
wire ae_array = misaligned & _pma_io_resp_eff | _cmd_read_T_2 | _cmd_write_T_3;
|
|
PMPChecker_s3 pmp (
|
|
.io_prv (io_req_bits_prv),
|
|
.io_pmp_0_cfg_l (io_ptw_pmp_0_cfg_l),
|
|
.io_pmp_0_cfg_a (io_ptw_pmp_0_cfg_a),
|
|
.io_pmp_0_cfg_w (io_ptw_pmp_0_cfg_w),
|
|
.io_pmp_0_cfg_r (io_ptw_pmp_0_cfg_r),
|
|
.io_pmp_0_addr (io_ptw_pmp_0_addr),
|
|
.io_pmp_0_mask (io_ptw_pmp_0_mask),
|
|
.io_pmp_1_cfg_l (io_ptw_pmp_1_cfg_l),
|
|
.io_pmp_1_cfg_a (io_ptw_pmp_1_cfg_a),
|
|
.io_pmp_1_cfg_w (io_ptw_pmp_1_cfg_w),
|
|
.io_pmp_1_cfg_r (io_ptw_pmp_1_cfg_r),
|
|
.io_pmp_1_addr (io_ptw_pmp_1_addr),
|
|
.io_pmp_1_mask (io_ptw_pmp_1_mask),
|
|
.io_pmp_2_cfg_l (io_ptw_pmp_2_cfg_l),
|
|
.io_pmp_2_cfg_a (io_ptw_pmp_2_cfg_a),
|
|
.io_pmp_2_cfg_w (io_ptw_pmp_2_cfg_w),
|
|
.io_pmp_2_cfg_r (io_ptw_pmp_2_cfg_r),
|
|
.io_pmp_2_addr (io_ptw_pmp_2_addr),
|
|
.io_pmp_2_mask (io_ptw_pmp_2_mask),
|
|
.io_pmp_3_cfg_l (io_ptw_pmp_3_cfg_l),
|
|
.io_pmp_3_cfg_a (io_ptw_pmp_3_cfg_a),
|
|
.io_pmp_3_cfg_w (io_ptw_pmp_3_cfg_w),
|
|
.io_pmp_3_cfg_r (io_ptw_pmp_3_cfg_r),
|
|
.io_pmp_3_addr (io_ptw_pmp_3_addr),
|
|
.io_pmp_3_mask (io_ptw_pmp_3_mask),
|
|
.io_pmp_4_cfg_l (io_ptw_pmp_4_cfg_l),
|
|
.io_pmp_4_cfg_a (io_ptw_pmp_4_cfg_a),
|
|
.io_pmp_4_cfg_w (io_ptw_pmp_4_cfg_w),
|
|
.io_pmp_4_cfg_r (io_ptw_pmp_4_cfg_r),
|
|
.io_pmp_4_addr (io_ptw_pmp_4_addr),
|
|
.io_pmp_4_mask (io_ptw_pmp_4_mask),
|
|
.io_pmp_5_cfg_l (io_ptw_pmp_5_cfg_l),
|
|
.io_pmp_5_cfg_a (io_ptw_pmp_5_cfg_a),
|
|
.io_pmp_5_cfg_w (io_ptw_pmp_5_cfg_w),
|
|
.io_pmp_5_cfg_r (io_ptw_pmp_5_cfg_r),
|
|
.io_pmp_5_addr (io_ptw_pmp_5_addr),
|
|
.io_pmp_5_mask (io_ptw_pmp_5_mask),
|
|
.io_pmp_6_cfg_l (io_ptw_pmp_6_cfg_l),
|
|
.io_pmp_6_cfg_a (io_ptw_pmp_6_cfg_a),
|
|
.io_pmp_6_cfg_w (io_ptw_pmp_6_cfg_w),
|
|
.io_pmp_6_cfg_r (io_ptw_pmp_6_cfg_r),
|
|
.io_pmp_6_addr (io_ptw_pmp_6_addr),
|
|
.io_pmp_6_mask (io_ptw_pmp_6_mask),
|
|
.io_pmp_7_cfg_l (io_ptw_pmp_7_cfg_l),
|
|
.io_pmp_7_cfg_a (io_ptw_pmp_7_cfg_a),
|
|
.io_pmp_7_cfg_w (io_ptw_pmp_7_cfg_w),
|
|
.io_pmp_7_cfg_r (io_ptw_pmp_7_cfg_r),
|
|
.io_pmp_7_addr (io_ptw_pmp_7_addr),
|
|
.io_pmp_7_mask (io_ptw_pmp_7_mask),
|
|
.io_addr (io_req_bits_vaddr[31:0]),
|
|
.io_size (io_req_bits_size),
|
|
.io_r (_pmp_io_r),
|
|
.io_w (_pmp_io_w)
|
|
);
|
|
PMAChecker pma (
|
|
.io_paddr (io_req_bits_vaddr),
|
|
.io_resp_r (_pma_io_resp_r),
|
|
.io_resp_w (_pma_io_resp_w),
|
|
.io_resp_pp (_pma_io_resp_pp),
|
|
.io_resp_al (_pma_io_resp_al),
|
|
.io_resp_aa (_pma_io_resp_aa),
|
|
.io_resp_x (/* unused */),
|
|
.io_resp_eff (_pma_io_resp_eff)
|
|
);
|
|
OptimizationBarrier_TLBEntryData entries_barrier (
|
|
.io_x_u (1'h0),
|
|
.io_x_ae_ptw (1'h0),
|
|
.io_x_ae_final (1'h0),
|
|
.io_x_pf (1'h0),
|
|
.io_x_gf (1'h0),
|
|
.io_x_sw (1'h0),
|
|
.io_x_sx (1'h0),
|
|
.io_x_sr (1'h0),
|
|
.io_x_pw (1'h0),
|
|
.io_x_px (1'h0),
|
|
.io_x_pr (1'h0),
|
|
.io_x_ppp (1'h0),
|
|
.io_x_pal (1'h0),
|
|
.io_x_paa (1'h0),
|
|
.io_x_eff (1'h0),
|
|
.io_x_c (1'h0),
|
|
.io_y_u (/* unused */),
|
|
.io_y_ae_ptw (/* unused */),
|
|
.io_y_ae_final (/* unused */),
|
|
.io_y_pf (/* unused */),
|
|
.io_y_gf (/* unused */),
|
|
.io_y_sw (/* unused */),
|
|
.io_y_sx (/* unused */),
|
|
.io_y_sr (/* unused */),
|
|
.io_y_pw (/* unused */),
|
|
.io_y_px (/* unused */),
|
|
.io_y_pr (/* unused */),
|
|
.io_y_ppp (/* unused */),
|
|
.io_y_pal (/* unused */),
|
|
.io_y_paa (/* unused */),
|
|
.io_y_eff (/* unused */),
|
|
.io_y_c (/* unused */)
|
|
);
|
|
OptimizationBarrier_TLBEntryData entries_barrier_1 (
|
|
.io_x_u (1'h0),
|
|
.io_x_ae_ptw (1'h0),
|
|
.io_x_ae_final (1'h0),
|
|
.io_x_pf (1'h0),
|
|
.io_x_gf (1'h0),
|
|
.io_x_sw (1'h0),
|
|
.io_x_sx (1'h0),
|
|
.io_x_sr (1'h0),
|
|
.io_x_pw (1'h0),
|
|
.io_x_px (1'h0),
|
|
.io_x_pr (1'h0),
|
|
.io_x_ppp (1'h0),
|
|
.io_x_pal (1'h0),
|
|
.io_x_paa (1'h0),
|
|
.io_x_eff (1'h0),
|
|
.io_x_c (1'h0),
|
|
.io_y_u (/* unused */),
|
|
.io_y_ae_ptw (/* unused */),
|
|
.io_y_ae_final (/* unused */),
|
|
.io_y_pf (/* unused */),
|
|
.io_y_gf (/* unused */),
|
|
.io_y_sw (/* unused */),
|
|
.io_y_sx (/* unused */),
|
|
.io_y_sr (/* unused */),
|
|
.io_y_pw (/* unused */),
|
|
.io_y_px (/* unused */),
|
|
.io_y_pr (/* unused */),
|
|
.io_y_ppp (/* unused */),
|
|
.io_y_pal (/* unused */),
|
|
.io_y_paa (/* unused */),
|
|
.io_y_eff (/* unused */),
|
|
.io_y_c (/* unused */)
|
|
);
|
|
OptimizationBarrier_TLBEntryData entries_barrier_2 (
|
|
.io_x_u (1'h0),
|
|
.io_x_ae_ptw (1'h0),
|
|
.io_x_ae_final (1'h0),
|
|
.io_x_pf (1'h0),
|
|
.io_x_gf (1'h0),
|
|
.io_x_sw (1'h0),
|
|
.io_x_sx (1'h0),
|
|
.io_x_sr (1'h0),
|
|
.io_x_pw (1'h0),
|
|
.io_x_px (1'h0),
|
|
.io_x_pr (1'h0),
|
|
.io_x_ppp (1'h0),
|
|
.io_x_pal (1'h0),
|
|
.io_x_paa (1'h0),
|
|
.io_x_eff (1'h0),
|
|
.io_x_c (1'h0),
|
|
.io_y_u (/* unused */),
|
|
.io_y_ae_ptw (/* unused */),
|
|
.io_y_ae_final (/* unused */),
|
|
.io_y_pf (/* unused */),
|
|
.io_y_gf (/* unused */),
|
|
.io_y_sw (/* unused */),
|
|
.io_y_sx (/* unused */),
|
|
.io_y_sr (/* unused */),
|
|
.io_y_pw (/* unused */),
|
|
.io_y_px (/* unused */),
|
|
.io_y_pr (/* unused */),
|
|
.io_y_ppp (/* unused */),
|
|
.io_y_pal (/* unused */),
|
|
.io_y_paa (/* unused */),
|
|
.io_y_eff (/* unused */),
|
|
.io_y_c (/* unused */)
|
|
);
|
|
OptimizationBarrier_TLBEntryData entries_barrier_3 (
|
|
.io_x_u (1'h0),
|
|
.io_x_ae_ptw (1'h0),
|
|
.io_x_ae_final (1'h0),
|
|
.io_x_pf (1'h0),
|
|
.io_x_gf (1'h0),
|
|
.io_x_sw (1'h0),
|
|
.io_x_sx (1'h0),
|
|
.io_x_sr (1'h0),
|
|
.io_x_pw (1'h0),
|
|
.io_x_px (1'h0),
|
|
.io_x_pr (1'h0),
|
|
.io_x_ppp (1'h0),
|
|
.io_x_pal (1'h0),
|
|
.io_x_paa (1'h0),
|
|
.io_x_eff (1'h0),
|
|
.io_x_c (1'h0),
|
|
.io_y_u (/* unused */),
|
|
.io_y_ae_ptw (/* unused */),
|
|
.io_y_ae_final (/* unused */),
|
|
.io_y_pf (/* unused */),
|
|
.io_y_gf (/* unused */),
|
|
.io_y_sw (/* unused */),
|
|
.io_y_sx (/* unused */),
|
|
.io_y_sr (/* unused */),
|
|
.io_y_pw (/* unused */),
|
|
.io_y_px (/* unused */),
|
|
.io_y_pr (/* unused */),
|
|
.io_y_ppp (/* unused */),
|
|
.io_y_pal (/* unused */),
|
|
.io_y_paa (/* unused */),
|
|
.io_y_eff (/* unused */),
|
|
.io_y_c (/* unused */)
|
|
);
|
|
OptimizationBarrier_TLBEntryData entries_barrier_4 (
|
|
.io_x_u (1'h0),
|
|
.io_x_ae_ptw (1'h0),
|
|
.io_x_ae_final (1'h0),
|
|
.io_x_pf (1'h0),
|
|
.io_x_gf (1'h0),
|
|
.io_x_sw (1'h0),
|
|
.io_x_sx (1'h0),
|
|
.io_x_sr (1'h0),
|
|
.io_x_pw (1'h0),
|
|
.io_x_px (1'h0),
|
|
.io_x_pr (1'h0),
|
|
.io_x_ppp (1'h0),
|
|
.io_x_pal (1'h0),
|
|
.io_x_paa (1'h0),
|
|
.io_x_eff (1'h0),
|
|
.io_x_c (1'h0),
|
|
.io_y_u (/* unused */),
|
|
.io_y_ae_ptw (/* unused */),
|
|
.io_y_ae_final (/* unused */),
|
|
.io_y_pf (/* unused */),
|
|
.io_y_gf (/* unused */),
|
|
.io_y_sw (/* unused */),
|
|
.io_y_sx (/* unused */),
|
|
.io_y_sr (/* unused */),
|
|
.io_y_pw (/* unused */),
|
|
.io_y_px (/* unused */),
|
|
.io_y_pr (/* unused */),
|
|
.io_y_ppp (/* unused */),
|
|
.io_y_pal (/* unused */),
|
|
.io_y_paa (/* unused */),
|
|
.io_y_eff (/* unused */),
|
|
.io_y_c (/* unused */)
|
|
);
|
|
OptimizationBarrier_TLBEntryData entries_barrier_5 (
|
|
.io_x_u (1'h0),
|
|
.io_x_ae_ptw (1'h0),
|
|
.io_x_ae_final (1'h0),
|
|
.io_x_pf (1'h0),
|
|
.io_x_gf (1'h0),
|
|
.io_x_sw (1'h0),
|
|
.io_x_sx (1'h0),
|
|
.io_x_sr (1'h0),
|
|
.io_x_pw (1'h0),
|
|
.io_x_px (1'h0),
|
|
.io_x_pr (1'h0),
|
|
.io_x_ppp (1'h0),
|
|
.io_x_pal (1'h0),
|
|
.io_x_paa (1'h0),
|
|
.io_x_eff (1'h0),
|
|
.io_x_c (1'h0),
|
|
.io_y_u (/* unused */),
|
|
.io_y_ae_ptw (/* unused */),
|
|
.io_y_ae_final (/* unused */),
|
|
.io_y_pf (/* unused */),
|
|
.io_y_gf (/* unused */),
|
|
.io_y_sw (/* unused */),
|
|
.io_y_sx (/* unused */),
|
|
.io_y_sr (/* unused */),
|
|
.io_y_pw (/* unused */),
|
|
.io_y_px (/* unused */),
|
|
.io_y_pr (/* unused */),
|
|
.io_y_ppp (/* unused */),
|
|
.io_y_pal (/* unused */),
|
|
.io_y_paa (/* unused */),
|
|
.io_y_eff (/* unused */),
|
|
.io_y_c (/* unused */)
|
|
);
|
|
assign io_resp_paddr = io_req_bits_vaddr[31:0];
|
|
assign io_resp_pf_ld = 1'h0;
|
|
assign io_resp_pf_st = 1'h0;
|
|
assign io_resp_ae_ld =
|
|
cmd_read & (ae_array | ~(_pma_io_resp_r & ~deny_access_to_debug & _pmp_io_r));
|
|
assign io_resp_ae_st =
|
|
(cmd_write | io_req_bits_cmd == 5'h5 | io_req_bits_cmd == 5'h17)
|
|
& (ae_array | ~(_pma_io_resp_w & ~deny_access_to_debug & _pmp_io_w)) | cmd_put_partial
|
|
& ~_pma_io_resp_pp
|
|
| (_cmd_write_T_5 | _cmd_write_T_6 | _cmd_write_T_7 | _cmd_write_T_8)
|
|
& ~_pma_io_resp_al
|
|
| (_cmd_write_T_12 | _cmd_write_T_13 | _cmd_write_T_14 | _cmd_write_T_15
|
|
| _cmd_write_T_16) & ~_pma_io_resp_aa;
|
|
assign io_resp_ma_ld = misaligned & cmd_read;
|
|
assign io_resp_ma_st = misaligned & cmd_write;
|
|
assign io_resp_cacheable = 1'h0;
|
|
endmodule
|
|
|