503 lines
32 KiB
Systemverilog
503 lines
32 KiB
Systemverilog
// Generated by CIRCT firtool-1.61.0
|
|
// Standard header to adapt well known macros for register randomization.
|
|
`ifndef RANDOMIZE
|
|
`ifdef RANDOMIZE_MEM_INIT
|
|
`define RANDOMIZE
|
|
`endif // RANDOMIZE_MEM_INIT
|
|
`endif // not def RANDOMIZE
|
|
`ifndef RANDOMIZE
|
|
`ifdef RANDOMIZE_REG_INIT
|
|
`define RANDOMIZE
|
|
`endif // RANDOMIZE_REG_INIT
|
|
`endif // not def RANDOMIZE
|
|
|
|
// RANDOM may be set to an expression that produces a 32-bit random unsigned value.
|
|
`ifndef RANDOM
|
|
`define RANDOM $random
|
|
`endif // not def RANDOM
|
|
|
|
// Users can define INIT_RANDOM as general code that gets injected into the
|
|
// initializer block for modules with registers.
|
|
`ifndef INIT_RANDOM
|
|
`define INIT_RANDOM
|
|
`endif // not def INIT_RANDOM
|
|
|
|
// If using random initialization, you can also define RANDOMIZE_DELAY to
|
|
// customize the delay used, otherwise 0.002 is used.
|
|
`ifndef RANDOMIZE_DELAY
|
|
`define RANDOMIZE_DELAY 0.002
|
|
`endif // not def RANDOMIZE_DELAY
|
|
|
|
// Define INIT_RANDOM_PROLOG_ for use in our modules below.
|
|
`ifndef INIT_RANDOM_PROLOG_
|
|
`ifdef RANDOMIZE
|
|
`ifdef VERILATOR
|
|
`define INIT_RANDOM_PROLOG_ `INIT_RANDOM
|
|
`else // VERILATOR
|
|
`define INIT_RANDOM_PROLOG_ `INIT_RANDOM #`RANDOMIZE_DELAY begin end
|
|
`endif // VERILATOR
|
|
`else // RANDOMIZE
|
|
`define INIT_RANDOM_PROLOG_
|
|
`endif // RANDOMIZE
|
|
`endif // not def INIT_RANDOM_PROLOG_
|
|
|
|
// Include register initializers in init blocks unless synthesis is set
|
|
`ifndef SYNTHESIS
|
|
`ifndef ENABLE_INITIAL_REG_
|
|
`define ENABLE_INITIAL_REG_
|
|
`endif // not def ENABLE_INITIAL_REG_
|
|
`endif // not def SYNTHESIS
|
|
|
|
// Include rmemory initializers in init blocks unless synthesis is set
|
|
`ifndef SYNTHESIS
|
|
`ifndef ENABLE_INITIAL_MEM_
|
|
`define ENABLE_INITIAL_MEM_
|
|
`endif // not def ENABLE_INITIAL_MEM_
|
|
`endif // not def SYNTHESIS
|
|
|
|
module ITTageTable( // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
input clock,
|
|
input reset,
|
|
input io_req_valid, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input [38:0] io_req_bits_pc, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input [3:0] io_req_bits_folded_hist_hist_12_folded_hist, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
output io_resp_valid, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
output [1:0] io_resp_bits_ctr, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
output [1:0] io_resp_bits_u, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
output [38:0] io_resp_bits_target, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input [38:0] io_update_pc, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input [3:0] io_update_folded_hist_hist_12_folded_hist, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input io_update_valid, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input io_update_correct, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input io_update_alloc, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input [1:0] io_update_oldCtr, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input io_update_uValid, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input io_update_u, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input io_update_reset_u, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input [38:0] io_update_target, // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
input [38:0] io_update_old_target // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
);
|
|
|
|
wire _resp_invalid_by_write_WIRE; // src/main/scala/chisel3/util/Mux.scala:30:73
|
|
wire _wrbypass_io_hit; // src/main/scala/xiangshan/frontend/ITTAGE.scala:271:24
|
|
wire [1:0] _wrbypass_io_hit_data_0_bits; // src/main/scala/xiangshan/frontend/ITTAGE.scala:271:24
|
|
wire [8:0] _table_banks_1_io_r_resp_data_0_tag; // src/main/scala/xiangshan/frontend/ITTAGE.scala:220:11
|
|
wire [1:0] _table_banks_1_io_r_resp_data_0_ctr; // src/main/scala/xiangshan/frontend/ITTAGE.scala:220:11
|
|
wire [38:0] _table_banks_1_io_r_resp_data_0_target; // src/main/scala/xiangshan/frontend/ITTAGE.scala:220:11
|
|
wire [8:0] _table_banks_0_io_r_resp_data_0_tag; // src/main/scala/xiangshan/frontend/ITTAGE.scala:220:11
|
|
wire [1:0] _table_banks_0_io_r_resp_data_0_ctr; // src/main/scala/xiangshan/frontend/ITTAGE.scala:220:11
|
|
wire [38:0] _table_banks_0_io_r_resp_data_0_target; // src/main/scala/xiangshan/frontend/ITTAGE.scala:220:11
|
|
wire _us_io_rdata_0; // src/main/scala/xiangshan/frontend/ITTAGE.scala:217:18
|
|
reg [255:0] validArray; // src/main/scala/xiangshan/frontend/ITTAGE.scala:200:27
|
|
wire [3:0] _GEN = io_req_bits_pc[4:1] ^ io_req_bits_folded_hist_hist_12_folded_hist; // src/main/scala/xiangshan/frontend/ITTAGE.scala:181:31, :207:43
|
|
wire [7:0] s0_idx = {io_req_bits_pc[8:5], _GEN}; // src/main/scala/xiangshan/frontend/ITTAGE.scala:181:{31,40}
|
|
reg [7:0] s1_idx; // src/main/scala/xiangshan/frontend/ITTAGE.scala:213:36
|
|
reg [8:0] s1_tag; // src/main/scala/xiangshan/frontend/ITTAGE.scala:213:68
|
|
reg s1_bank_req_1h_0; // src/main/scala/xiangshan/frontend/ITTAGE.scala:215:33
|
|
reg s1_bank_req_1h_1; // src/main/scala/xiangshan/frontend/ITTAGE.scala:215:33
|
|
wire [6:0] _table_banks_1_io_r_req_bits_setIdx_T = {io_req_bits_pc[8:5], _GEN[3:1]}; // src/main/scala/xiangshan/frontend/ITTAGE.scala:161:37, :181:{31,40}
|
|
wire [255:0] _s1_req_rhit_T = validArray >> s1_idx; // src/main/scala/xiangshan/frontend/ITTAGE.scala:200:27, :213:36, :232:31
|
|
reg s1_bank_has_write_on_this_req_0; // src/main/scala/xiangshan/frontend/ITTAGE.scala:240:48
|
|
reg s1_bank_has_write_on_this_req_1; // src/main/scala/xiangshan/frontend/ITTAGE.scala:240:48
|
|
wire [3:0] _GEN_0 = io_update_pc[4:1] ^ io_update_folded_hist_hist_12_folded_hist; // src/main/scala/xiangshan/frontend/ITTAGE.scala:181:31, :207:43
|
|
wire [7:0] update_idx = {io_update_pc[8:5], _GEN_0}; // src/main/scala/xiangshan/frontend/ITTAGE.scala:181:{31,40}
|
|
wire [8:0] update_wdata_tag =
|
|
{io_update_pc[17:14],
|
|
{io_update_pc[13], io_update_pc[12:9] ^ io_update_folded_hist_hist_12_folded_hist}
|
|
^ {io_update_folded_hist_hist_12_folded_hist, 1'h0}}; // src/main/scala/xiangshan/frontend/ITTAGE.scala:160:86, :182:{32,52,61,75,82}, :207:43
|
|
wire [6:0] update_idx_in_bank = {io_update_pc[8:5], _GEN_0[3:1]}; // src/main/scala/xiangshan/frontend/ITTAGE.scala:161:37, :181:{31,40}
|
|
assign _resp_invalid_by_write_WIRE =
|
|
s1_bank_req_1h_0 & s1_bank_has_write_on_this_req_0 | s1_bank_req_1h_1
|
|
& s1_bank_has_write_on_this_req_1; // src/main/scala/chisel3/util/Mux.scala:30:73, src/main/scala/xiangshan/frontend/ITTAGE.scala:215:33, :240:48
|
|
wire _s1_bank_has_write_on_this_req_WIRE_0 = io_update_valid & ~(_GEN_0[0]); // src/main/scala/xiangshan/frontend/ITTAGE.scala:160:{66,86}, :181:{31,40}, :255:33
|
|
wire _s1_bank_has_write_on_this_req_WIRE_1 = io_update_valid & _GEN_0[0]; // src/main/scala/xiangshan/frontend/ITTAGE.scala:160:66, :181:{31,40}, :255:33
|
|
wire [1:0] old_ctr =
|
|
_wrbypass_io_hit ? _wrbypass_io_hit_data_0_bits : io_update_oldCtr; // src/main/scala/xiangshan/frontend/ITTAGE.scala:271:24, :277:20
|
|
wire update_wdata_ctr_oldSatNotTaken = old_ctr == 2'h0; // src/main/scala/chisel3/util/Mux.scala:30:73, src/main/scala/xiangshan/frontend/BPU.scala:95:30, src/main/scala/xiangshan/frontend/ITTAGE.scala:277:20
|
|
wire [1:0] update_wdata_ctr =
|
|
io_update_alloc
|
|
? 2'h2
|
|
: (&old_ctr) & io_update_correct
|
|
? 2'h3
|
|
: update_wdata_ctr_oldSatNotTaken & ~io_update_correct
|
|
? 2'h0
|
|
: io_update_correct ? 2'(old_ctr + 2'h1) : 2'(old_ctr - 2'h1); // src/main/scala/chisel3/util/Mux.scala:30:73, src/main/scala/xiangshan/frontend/BPU.scala:94:27, :95:30, :96:{8,21}, :97:{10,26,29}, :98:{12,24,35}, src/main/scala/xiangshan/frontend/ITTAGE.scala:277:20, :278:28
|
|
wire [38:0] update_wdata_target =
|
|
io_update_alloc | update_wdata_ctr_oldSatNotTaken
|
|
? io_update_target
|
|
: io_update_old_target; // src/main/scala/xiangshan/frontend/BPU.scala:95:30, src/main/scala/xiangshan/frontend/ITTAGE.scala:281:{29,46}
|
|
wire [255:0] _validArray_T =
|
|
{io_update_valid & (&update_idx) | validArray[255],
|
|
io_update_valid & update_idx == 8'hFE | validArray[254],
|
|
io_update_valid & update_idx == 8'hFD | validArray[253],
|
|
io_update_valid & update_idx == 8'hFC | validArray[252],
|
|
io_update_valid & update_idx == 8'hFB | validArray[251],
|
|
io_update_valid & update_idx == 8'hFA | validArray[250],
|
|
io_update_valid & update_idx == 8'hF9 | validArray[249],
|
|
io_update_valid & update_idx == 8'hF8 | validArray[248],
|
|
io_update_valid & update_idx == 8'hF7 | validArray[247],
|
|
io_update_valid & update_idx == 8'hF6 | validArray[246],
|
|
io_update_valid & update_idx == 8'hF5 | validArray[245],
|
|
io_update_valid & update_idx == 8'hF4 | validArray[244],
|
|
io_update_valid & update_idx == 8'hF3 | validArray[243],
|
|
io_update_valid & update_idx == 8'hF2 | validArray[242],
|
|
io_update_valid & update_idx == 8'hF1 | validArray[241],
|
|
io_update_valid & update_idx == 8'hF0 | validArray[240],
|
|
io_update_valid & update_idx == 8'hEF | validArray[239],
|
|
io_update_valid & update_idx == 8'hEE | validArray[238],
|
|
io_update_valid & update_idx == 8'hED | validArray[237],
|
|
io_update_valid & update_idx == 8'hEC | validArray[236],
|
|
io_update_valid & update_idx == 8'hEB | validArray[235],
|
|
io_update_valid & update_idx == 8'hEA | validArray[234],
|
|
io_update_valid & update_idx == 8'hE9 | validArray[233],
|
|
io_update_valid & update_idx == 8'hE8 | validArray[232],
|
|
io_update_valid & update_idx == 8'hE7 | validArray[231],
|
|
io_update_valid & update_idx == 8'hE6 | validArray[230],
|
|
io_update_valid & update_idx == 8'hE5 | validArray[229],
|
|
io_update_valid & update_idx == 8'hE4 | validArray[228],
|
|
io_update_valid & update_idx == 8'hE3 | validArray[227],
|
|
io_update_valid & update_idx == 8'hE2 | validArray[226],
|
|
io_update_valid & update_idx == 8'hE1 | validArray[225],
|
|
io_update_valid & update_idx == 8'hE0 | validArray[224],
|
|
io_update_valid & update_idx == 8'hDF | validArray[223],
|
|
io_update_valid & update_idx == 8'hDE | validArray[222],
|
|
io_update_valid & update_idx == 8'hDD | validArray[221],
|
|
io_update_valid & update_idx == 8'hDC | validArray[220],
|
|
io_update_valid & update_idx == 8'hDB | validArray[219],
|
|
io_update_valid & update_idx == 8'hDA | validArray[218],
|
|
io_update_valid & update_idx == 8'hD9 | validArray[217],
|
|
io_update_valid & update_idx == 8'hD8 | validArray[216],
|
|
io_update_valid & update_idx == 8'hD7 | validArray[215],
|
|
io_update_valid & update_idx == 8'hD6 | validArray[214],
|
|
io_update_valid & update_idx == 8'hD5 | validArray[213],
|
|
io_update_valid & update_idx == 8'hD4 | validArray[212],
|
|
io_update_valid & update_idx == 8'hD3 | validArray[211],
|
|
io_update_valid & update_idx == 8'hD2 | validArray[210],
|
|
io_update_valid & update_idx == 8'hD1 | validArray[209],
|
|
io_update_valid & update_idx == 8'hD0 | validArray[208],
|
|
io_update_valid & update_idx == 8'hCF | validArray[207],
|
|
io_update_valid & update_idx == 8'hCE | validArray[206],
|
|
io_update_valid & update_idx == 8'hCD | validArray[205],
|
|
io_update_valid & update_idx == 8'hCC | validArray[204],
|
|
io_update_valid & update_idx == 8'hCB | validArray[203],
|
|
io_update_valid & update_idx == 8'hCA | validArray[202],
|
|
io_update_valid & update_idx == 8'hC9 | validArray[201],
|
|
io_update_valid & update_idx == 8'hC8 | validArray[200],
|
|
io_update_valid & update_idx == 8'hC7 | validArray[199],
|
|
io_update_valid & update_idx == 8'hC6 | validArray[198],
|
|
io_update_valid & update_idx == 8'hC5 | validArray[197],
|
|
io_update_valid & update_idx == 8'hC4 | validArray[196],
|
|
io_update_valid & update_idx == 8'hC3 | validArray[195],
|
|
io_update_valid & update_idx == 8'hC2 | validArray[194],
|
|
io_update_valid & update_idx == 8'hC1 | validArray[193],
|
|
io_update_valid & update_idx == 8'hC0 | validArray[192],
|
|
io_update_valid & update_idx == 8'hBF | validArray[191],
|
|
io_update_valid & update_idx == 8'hBE | validArray[190],
|
|
io_update_valid & update_idx == 8'hBD | validArray[189],
|
|
io_update_valid & update_idx == 8'hBC | validArray[188],
|
|
io_update_valid & update_idx == 8'hBB | validArray[187],
|
|
io_update_valid & update_idx == 8'hBA | validArray[186],
|
|
io_update_valid & update_idx == 8'hB9 | validArray[185],
|
|
io_update_valid & update_idx == 8'hB8 | validArray[184],
|
|
io_update_valid & update_idx == 8'hB7 | validArray[183],
|
|
io_update_valid & update_idx == 8'hB6 | validArray[182],
|
|
io_update_valid & update_idx == 8'hB5 | validArray[181],
|
|
io_update_valid & update_idx == 8'hB4 | validArray[180],
|
|
io_update_valid & update_idx == 8'hB3 | validArray[179],
|
|
io_update_valid & update_idx == 8'hB2 | validArray[178],
|
|
io_update_valid & update_idx == 8'hB1 | validArray[177],
|
|
io_update_valid & update_idx == 8'hB0 | validArray[176],
|
|
io_update_valid & update_idx == 8'hAF | validArray[175],
|
|
io_update_valid & update_idx == 8'hAE | validArray[174],
|
|
io_update_valid & update_idx == 8'hAD | validArray[173],
|
|
io_update_valid & update_idx == 8'hAC | validArray[172],
|
|
io_update_valid & update_idx == 8'hAB | validArray[171],
|
|
io_update_valid & update_idx == 8'hAA | validArray[170],
|
|
io_update_valid & update_idx == 8'hA9 | validArray[169],
|
|
io_update_valid & update_idx == 8'hA8 | validArray[168],
|
|
io_update_valid & update_idx == 8'hA7 | validArray[167],
|
|
io_update_valid & update_idx == 8'hA6 | validArray[166],
|
|
io_update_valid & update_idx == 8'hA5 | validArray[165],
|
|
io_update_valid & update_idx == 8'hA4 | validArray[164],
|
|
io_update_valid & update_idx == 8'hA3 | validArray[163],
|
|
io_update_valid & update_idx == 8'hA2 | validArray[162],
|
|
io_update_valid & update_idx == 8'hA1 | validArray[161],
|
|
io_update_valid & update_idx == 8'hA0 | validArray[160],
|
|
io_update_valid & update_idx == 8'h9F | validArray[159],
|
|
io_update_valid & update_idx == 8'h9E | validArray[158],
|
|
io_update_valid & update_idx == 8'h9D | validArray[157],
|
|
io_update_valid & update_idx == 8'h9C | validArray[156],
|
|
io_update_valid & update_idx == 8'h9B | validArray[155],
|
|
io_update_valid & update_idx == 8'h9A | validArray[154],
|
|
io_update_valid & update_idx == 8'h99 | validArray[153],
|
|
io_update_valid & update_idx == 8'h98 | validArray[152],
|
|
io_update_valid & update_idx == 8'h97 | validArray[151],
|
|
io_update_valid & update_idx == 8'h96 | validArray[150],
|
|
io_update_valid & update_idx == 8'h95 | validArray[149],
|
|
io_update_valid & update_idx == 8'h94 | validArray[148],
|
|
io_update_valid & update_idx == 8'h93 | validArray[147],
|
|
io_update_valid & update_idx == 8'h92 | validArray[146],
|
|
io_update_valid & update_idx == 8'h91 | validArray[145],
|
|
io_update_valid & update_idx == 8'h90 | validArray[144],
|
|
io_update_valid & update_idx == 8'h8F | validArray[143],
|
|
io_update_valid & update_idx == 8'h8E | validArray[142],
|
|
io_update_valid & update_idx == 8'h8D | validArray[141],
|
|
io_update_valid & update_idx == 8'h8C | validArray[140],
|
|
io_update_valid & update_idx == 8'h8B | validArray[139],
|
|
io_update_valid & update_idx == 8'h8A | validArray[138],
|
|
io_update_valid & update_idx == 8'h89 | validArray[137],
|
|
io_update_valid & update_idx == 8'h88 | validArray[136],
|
|
io_update_valid & update_idx == 8'h87 | validArray[135],
|
|
io_update_valid & update_idx == 8'h86 | validArray[134],
|
|
io_update_valid & update_idx == 8'h85 | validArray[133],
|
|
io_update_valid & update_idx == 8'h84 | validArray[132],
|
|
io_update_valid & update_idx == 8'h83 | validArray[131],
|
|
io_update_valid & update_idx == 8'h82 | validArray[130],
|
|
io_update_valid & update_idx == 8'h81 | validArray[129],
|
|
io_update_valid & update_idx == 8'h80 | validArray[128],
|
|
io_update_valid & update_idx == 8'h7F | validArray[127],
|
|
io_update_valid & update_idx == 8'h7E | validArray[126],
|
|
io_update_valid & update_idx == 8'h7D | validArray[125],
|
|
io_update_valid & update_idx == 8'h7C | validArray[124],
|
|
io_update_valid & update_idx == 8'h7B | validArray[123],
|
|
io_update_valid & update_idx == 8'h7A | validArray[122],
|
|
io_update_valid & update_idx == 8'h79 | validArray[121],
|
|
io_update_valid & update_idx == 8'h78 | validArray[120],
|
|
io_update_valid & update_idx == 8'h77 | validArray[119],
|
|
io_update_valid & update_idx == 8'h76 | validArray[118],
|
|
io_update_valid & update_idx == 8'h75 | validArray[117],
|
|
io_update_valid & update_idx == 8'h74 | validArray[116],
|
|
io_update_valid & update_idx == 8'h73 | validArray[115],
|
|
io_update_valid & update_idx == 8'h72 | validArray[114],
|
|
io_update_valid & update_idx == 8'h71 | validArray[113],
|
|
io_update_valid & update_idx == 8'h70 | validArray[112],
|
|
io_update_valid & update_idx == 8'h6F | validArray[111],
|
|
io_update_valid & update_idx == 8'h6E | validArray[110],
|
|
io_update_valid & update_idx == 8'h6D | validArray[109],
|
|
io_update_valid & update_idx == 8'h6C | validArray[108],
|
|
io_update_valid & update_idx == 8'h6B | validArray[107],
|
|
io_update_valid & update_idx == 8'h6A | validArray[106],
|
|
io_update_valid & update_idx == 8'h69 | validArray[105],
|
|
io_update_valid & update_idx == 8'h68 | validArray[104],
|
|
io_update_valid & update_idx == 8'h67 | validArray[103],
|
|
io_update_valid & update_idx == 8'h66 | validArray[102],
|
|
io_update_valid & update_idx == 8'h65 | validArray[101],
|
|
io_update_valid & update_idx == 8'h64 | validArray[100],
|
|
io_update_valid & update_idx == 8'h63 | validArray[99],
|
|
io_update_valid & update_idx == 8'h62 | validArray[98],
|
|
io_update_valid & update_idx == 8'h61 | validArray[97],
|
|
io_update_valid & update_idx == 8'h60 | validArray[96],
|
|
io_update_valid & update_idx == 8'h5F | validArray[95],
|
|
io_update_valid & update_idx == 8'h5E | validArray[94],
|
|
io_update_valid & update_idx == 8'h5D | validArray[93],
|
|
io_update_valid & update_idx == 8'h5C | validArray[92],
|
|
io_update_valid & update_idx == 8'h5B | validArray[91],
|
|
io_update_valid & update_idx == 8'h5A | validArray[90],
|
|
io_update_valid & update_idx == 8'h59 | validArray[89],
|
|
io_update_valid & update_idx == 8'h58 | validArray[88],
|
|
io_update_valid & update_idx == 8'h57 | validArray[87],
|
|
io_update_valid & update_idx == 8'h56 | validArray[86],
|
|
io_update_valid & update_idx == 8'h55 | validArray[85],
|
|
io_update_valid & update_idx == 8'h54 | validArray[84],
|
|
io_update_valid & update_idx == 8'h53 | validArray[83],
|
|
io_update_valid & update_idx == 8'h52 | validArray[82],
|
|
io_update_valid & update_idx == 8'h51 | validArray[81],
|
|
io_update_valid & update_idx == 8'h50 | validArray[80],
|
|
io_update_valid & update_idx == 8'h4F | validArray[79],
|
|
io_update_valid & update_idx == 8'h4E | validArray[78],
|
|
io_update_valid & update_idx == 8'h4D | validArray[77],
|
|
io_update_valid & update_idx == 8'h4C | validArray[76],
|
|
io_update_valid & update_idx == 8'h4B | validArray[75],
|
|
io_update_valid & update_idx == 8'h4A | validArray[74],
|
|
io_update_valid & update_idx == 8'h49 | validArray[73],
|
|
io_update_valid & update_idx == 8'h48 | validArray[72],
|
|
io_update_valid & update_idx == 8'h47 | validArray[71],
|
|
io_update_valid & update_idx == 8'h46 | validArray[70],
|
|
io_update_valid & update_idx == 8'h45 | validArray[69],
|
|
io_update_valid & update_idx == 8'h44 | validArray[68],
|
|
io_update_valid & update_idx == 8'h43 | validArray[67],
|
|
io_update_valid & update_idx == 8'h42 | validArray[66],
|
|
io_update_valid & update_idx == 8'h41 | validArray[65],
|
|
io_update_valid & update_idx == 8'h40 | validArray[64],
|
|
io_update_valid & update_idx == 8'h3F | validArray[63],
|
|
io_update_valid & update_idx == 8'h3E | validArray[62],
|
|
io_update_valid & update_idx == 8'h3D | validArray[61],
|
|
io_update_valid & update_idx == 8'h3C | validArray[60],
|
|
io_update_valid & update_idx == 8'h3B | validArray[59],
|
|
io_update_valid & update_idx == 8'h3A | validArray[58],
|
|
io_update_valid & update_idx == 8'h39 | validArray[57],
|
|
io_update_valid & update_idx == 8'h38 | validArray[56],
|
|
io_update_valid & update_idx == 8'h37 | validArray[55],
|
|
io_update_valid & update_idx == 8'h36 | validArray[54],
|
|
io_update_valid & update_idx == 8'h35 | validArray[53],
|
|
io_update_valid & update_idx == 8'h34 | validArray[52],
|
|
io_update_valid & update_idx == 8'h33 | validArray[51],
|
|
io_update_valid & update_idx == 8'h32 | validArray[50],
|
|
io_update_valid & update_idx == 8'h31 | validArray[49],
|
|
io_update_valid & update_idx == 8'h30 | validArray[48],
|
|
io_update_valid & update_idx == 8'h2F | validArray[47],
|
|
io_update_valid & update_idx == 8'h2E | validArray[46],
|
|
io_update_valid & update_idx == 8'h2D | validArray[45],
|
|
io_update_valid & update_idx == 8'h2C | validArray[44],
|
|
io_update_valid & update_idx == 8'h2B | validArray[43],
|
|
io_update_valid & update_idx == 8'h2A | validArray[42],
|
|
io_update_valid & update_idx == 8'h29 | validArray[41],
|
|
io_update_valid & update_idx == 8'h28 | validArray[40],
|
|
io_update_valid & update_idx == 8'h27 | validArray[39],
|
|
io_update_valid & update_idx == 8'h26 | validArray[38],
|
|
io_update_valid & update_idx == 8'h25 | validArray[37],
|
|
io_update_valid & update_idx == 8'h24 | validArray[36],
|
|
io_update_valid & update_idx == 8'h23 | validArray[35],
|
|
io_update_valid & update_idx == 8'h22 | validArray[34],
|
|
io_update_valid & update_idx == 8'h21 | validArray[33],
|
|
io_update_valid & update_idx == 8'h20 | validArray[32],
|
|
io_update_valid & update_idx == 8'h1F | validArray[31],
|
|
io_update_valid & update_idx == 8'h1E | validArray[30],
|
|
io_update_valid & update_idx == 8'h1D | validArray[29],
|
|
io_update_valid & update_idx == 8'h1C | validArray[28],
|
|
io_update_valid & update_idx == 8'h1B | validArray[27],
|
|
io_update_valid & update_idx == 8'h1A | validArray[26],
|
|
io_update_valid & update_idx == 8'h19 | validArray[25],
|
|
io_update_valid & update_idx == 8'h18 | validArray[24],
|
|
io_update_valid & update_idx == 8'h17 | validArray[23],
|
|
io_update_valid & update_idx == 8'h16 | validArray[22],
|
|
io_update_valid & update_idx == 8'h15 | validArray[21],
|
|
io_update_valid & update_idx == 8'h14 | validArray[20],
|
|
io_update_valid & update_idx == 8'h13 | validArray[19],
|
|
io_update_valid & update_idx == 8'h12 | validArray[18],
|
|
io_update_valid & update_idx == 8'h11 | validArray[17],
|
|
io_update_valid & update_idx == 8'h10 | validArray[16],
|
|
io_update_valid & update_idx == 8'hF | validArray[15],
|
|
io_update_valid & update_idx == 8'hE | validArray[14],
|
|
io_update_valid & update_idx == 8'hD | validArray[13],
|
|
io_update_valid & update_idx == 8'hC | validArray[12],
|
|
io_update_valid & update_idx == 8'hB | validArray[11],
|
|
io_update_valid & update_idx == 8'hA | validArray[10],
|
|
io_update_valid & update_idx == 8'h9 | validArray[9],
|
|
io_update_valid & update_idx == 8'h8 | validArray[8],
|
|
io_update_valid & update_idx == 8'h7 | validArray[7],
|
|
io_update_valid & update_idx == 8'h6 | validArray[6],
|
|
io_update_valid & update_idx == 8'h5 | validArray[5],
|
|
io_update_valid & update_idx == 8'h4 | validArray[4],
|
|
io_update_valid & update_idx == 8'h3 | validArray[3],
|
|
io_update_valid & update_idx == 8'h2 | validArray[2],
|
|
io_update_valid & update_idx == 8'h1 | validArray[1],
|
|
io_update_valid & update_idx == 8'h0 | validArray[0]}; // src/main/scala/xiangshan/frontend/ITTAGE.scala:181:40, :200:27, :283:{30,42}, :284:26, :285:31, :286:33
|
|
always @(posedge clock or posedge reset) begin
|
|
if (reset)
|
|
validArray <= 256'h0; // src/main/scala/xiangshan/frontend/ITTAGE.scala:200:27
|
|
else if (io_update_valid) // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
validArray <= _validArray_T; // src/main/scala/xiangshan/frontend/ITTAGE.scala:200:27, :286:33
|
|
end // always @(posedge, posedge)
|
|
always @(posedge clock) begin
|
|
if (io_req_valid) begin // src/main/scala/xiangshan/frontend/ITTAGE.scala:145:14
|
|
s1_idx <= s0_idx; // src/main/scala/xiangshan/frontend/ITTAGE.scala:181:40, :213:36
|
|
s1_tag <=
|
|
{io_req_bits_pc[17:14],
|
|
{io_req_bits_pc[13],
|
|
io_req_bits_pc[12:9] ^ io_req_bits_folded_hist_hist_12_folded_hist}
|
|
^ {io_req_bits_folded_hist_hist_12_folded_hist, 1'h0}}; // src/main/scala/xiangshan/frontend/ITTAGE.scala:160:86, :182:{32,52,61,75,82}, :207:43, :213:68
|
|
s1_bank_req_1h_0 <= ~(_GEN[0]); // src/main/scala/xiangshan/frontend/ITTAGE.scala:160:{66,86}, :181:{31,40}, :215:33
|
|
s1_bank_req_1h_1 <= _GEN[0]; // src/main/scala/xiangshan/frontend/ITTAGE.scala:160:66, :181:{31,40}, :215:33
|
|
s1_bank_has_write_on_this_req_0 <= _s1_bank_has_write_on_this_req_WIRE_0; // src/main/scala/xiangshan/frontend/ITTAGE.scala:240:48, :255:33
|
|
s1_bank_has_write_on_this_req_1 <= _s1_bank_has_write_on_this_req_WIRE_1; // src/main/scala/xiangshan/frontend/ITTAGE.scala:240:48, :255:33
|
|
end
|
|
end // always @(posedge)
|
|
`ifdef ENABLE_INITIAL_REG_ // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
`ifdef FIRRTL_BEFORE_INITIAL // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
`FIRRTL_BEFORE_INITIAL // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
`endif // FIRRTL_BEFORE_INITIAL
|
|
logic [31:0] _RANDOM[0:8]; // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
initial begin // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
`ifdef INIT_RANDOM_PROLOG_ // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
`INIT_RANDOM_PROLOG_ // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
`endif // INIT_RANDOM_PROLOG_
|
|
`ifdef RANDOMIZE_REG_INIT // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
for (logic [3:0] i = 4'h0; i < 4'h9; i += 4'h1) begin
|
|
_RANDOM[i] = `RANDOM; // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
end // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
validArray =
|
|
{_RANDOM[4'h0],
|
|
_RANDOM[4'h1],
|
|
_RANDOM[4'h2],
|
|
_RANDOM[4'h3],
|
|
_RANDOM[4'h4],
|
|
_RANDOM[4'h5],
|
|
_RANDOM[4'h6],
|
|
_RANDOM[4'h7]}; // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :200:27
|
|
s1_idx = _RANDOM[4'h8][7:0]; // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :213:36
|
|
s1_tag = _RANDOM[4'h8][16:8]; // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :213:{36,68}
|
|
s1_bank_req_1h_0 = _RANDOM[4'h8][17]; // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :213:36, :215:33
|
|
s1_bank_req_1h_1 = _RANDOM[4'h8][18]; // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :213:36, :215:33
|
|
s1_bank_has_write_on_this_req_0 = _RANDOM[4'h8][19]; // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :213:36, :240:48
|
|
s1_bank_has_write_on_this_req_1 = _RANDOM[4'h8][20]; // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :213:36, :240:48
|
|
`endif // RANDOMIZE_REG_INIT
|
|
if (reset) // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
validArray = 256'h0; // src/main/scala/xiangshan/frontend/ITTAGE.scala:200:27
|
|
end // initial
|
|
`ifdef FIRRTL_AFTER_INITIAL // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
`FIRRTL_AFTER_INITIAL // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7
|
|
`endif // FIRRTL_AFTER_INITIAL
|
|
`endif // ENABLE_INITIAL_REG_
|
|
Folded1WDataModuleTemplate us ( // src/main/scala/xiangshan/frontend/ITTAGE.scala:217:18
|
|
.clock (clock),
|
|
.reset (reset),
|
|
.io_raddr_0 (s0_idx), // src/main/scala/xiangshan/frontend/ITTAGE.scala:181:40
|
|
.io_rdata_0 (_us_io_rdata_0),
|
|
.io_wen (io_update_uValid),
|
|
.io_waddr (update_idx), // src/main/scala/xiangshan/frontend/ITTAGE.scala:181:40
|
|
.io_wdata (io_update_u),
|
|
.io_resetEn (io_update_reset_u)
|
|
);
|
|
FoldedSRAMTemplate_21 table_banks_0 ( // src/main/scala/xiangshan/frontend/ITTAGE.scala:220:11
|
|
.clock (clock),
|
|
.reset (reset),
|
|
.io_r_req_valid (io_req_valid & ~(_GEN[0])), // src/main/scala/xiangshan/frontend/ITTAGE.scala:160:{66,86}, :181:{31,40}, :223:50
|
|
.io_r_req_bits_setIdx (_table_banks_1_io_r_req_bits_setIdx_T), // src/main/scala/xiangshan/frontend/ITTAGE.scala:161:37, :181:40
|
|
.io_r_resp_data_0_tag (_table_banks_0_io_r_resp_data_0_tag),
|
|
.io_r_resp_data_0_ctr (_table_banks_0_io_r_resp_data_0_ctr),
|
|
.io_r_resp_data_0_target (_table_banks_0_io_r_resp_data_0_target),
|
|
.io_w_req_valid (_s1_bank_has_write_on_this_req_WIRE_0), // src/main/scala/xiangshan/frontend/ITTAGE.scala:255:33
|
|
.io_w_req_bits_setIdx (update_idx_in_bank), // src/main/scala/xiangshan/frontend/ITTAGE.scala:161:37, :181:40
|
|
.io_w_req_bits_data_0_tag (update_wdata_tag), // src/main/scala/xiangshan/frontend/ITTAGE.scala:182:82
|
|
.io_w_req_bits_data_0_ctr (update_wdata_ctr), // src/main/scala/xiangshan/frontend/ITTAGE.scala:278:28
|
|
.io_w_req_bits_data_0_target (update_wdata_target) // src/main/scala/xiangshan/frontend/ITTAGE.scala:281:29
|
|
);
|
|
FoldedSRAMTemplate_21 table_banks_1 ( // src/main/scala/xiangshan/frontend/ITTAGE.scala:220:11
|
|
.clock (clock),
|
|
.reset (reset),
|
|
.io_r_req_valid (io_req_valid & _GEN[0]), // src/main/scala/xiangshan/frontend/ITTAGE.scala:160:66, :181:{31,40}, :223:50
|
|
.io_r_req_bits_setIdx (_table_banks_1_io_r_req_bits_setIdx_T), // src/main/scala/xiangshan/frontend/ITTAGE.scala:161:37, :181:40
|
|
.io_r_resp_data_0_tag (_table_banks_1_io_r_resp_data_0_tag),
|
|
.io_r_resp_data_0_ctr (_table_banks_1_io_r_resp_data_0_ctr),
|
|
.io_r_resp_data_0_target (_table_banks_1_io_r_resp_data_0_target),
|
|
.io_w_req_valid (_s1_bank_has_write_on_this_req_WIRE_1), // src/main/scala/xiangshan/frontend/ITTAGE.scala:255:33
|
|
.io_w_req_bits_setIdx (update_idx_in_bank), // src/main/scala/xiangshan/frontend/ITTAGE.scala:161:37, :181:40
|
|
.io_w_req_bits_data_0_tag (update_wdata_tag), // src/main/scala/xiangshan/frontend/ITTAGE.scala:182:82
|
|
.io_w_req_bits_data_0_ctr (update_wdata_ctr), // src/main/scala/xiangshan/frontend/ITTAGE.scala:278:28
|
|
.io_w_req_bits_data_0_target (update_wdata_target) // src/main/scala/xiangshan/frontend/ITTAGE.scala:281:29
|
|
);
|
|
WrBypass_41 wrbypass ( // src/main/scala/xiangshan/frontend/ITTAGE.scala:271:24
|
|
.clock (clock),
|
|
.reset (reset),
|
|
.io_wen (io_update_valid),
|
|
.io_write_idx (update_idx), // src/main/scala/xiangshan/frontend/ITTAGE.scala:181:40
|
|
.io_write_data_0 (update_wdata_ctr), // src/main/scala/xiangshan/frontend/ITTAGE.scala:278:28
|
|
.io_hit (_wrbypass_io_hit),
|
|
.io_hit_data_0_bits (_wrbypass_io_hit_data_0_bits)
|
|
);
|
|
assign io_resp_valid =
|
|
_s1_req_rhit_T[0]
|
|
& ((s1_bank_req_1h_0 ? _table_banks_0_io_r_resp_data_0_tag : 9'h0)
|
|
| (s1_bank_req_1h_1 ? _table_banks_1_io_r_resp_data_0_tag : 9'h0)) == s1_tag
|
|
& ~_resp_invalid_by_write_WIRE; // src/main/scala/chisel3/util/Mux.scala:30:73, src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :213:68, :215:33, :220:11, :232:{31,61}, :235:{50,53}
|
|
assign io_resp_bits_ctr =
|
|
(s1_bank_req_1h_0 ? _table_banks_0_io_r_resp_data_0_ctr : 2'h0)
|
|
| (s1_bank_req_1h_1 ? _table_banks_1_io_r_resp_data_0_ctr : 2'h0); // src/main/scala/chisel3/util/Mux.scala:30:73, src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :215:33, :220:11
|
|
assign io_resp_bits_u = {1'h0, _us_io_rdata_0}; // src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :160:86, :217:18, :237:18
|
|
assign io_resp_bits_target =
|
|
(s1_bank_req_1h_0 ? _table_banks_0_io_r_resp_data_0_target : 39'h0)
|
|
| (s1_bank_req_1h_1 ? _table_banks_1_io_r_resp_data_0_target : 39'h0); // src/main/scala/chisel3/util/Mux.scala:30:73, src/main/scala/xiangshan/frontend/ITTAGE.scala:140:7, :215:33, :220:11
|
|
endmodule
|
|
|