macros to namespace refactoring

This commit is contained in:
tinebp 2025-05-15 06:33:36 -07:00
parent e37f8d6fb1
commit 055b104ec4
2 changed files with 975 additions and 555 deletions

View file

@ -18,251 +18,230 @@
`include "VX_config.vh" `include "VX_config.vh"
`include "VX_types.vh" `include "VX_types.vh"
/////////////////////////////////////////////////////////////////////////////// `ifdef ICACHE_ENABLE
`define L1_ENABLE
`define NW_BITS `CLOG2(`NUM_WARPS)
`define NC_WIDTH `UP(`NC_BITS)
`define NT_BITS `CLOG2(`NUM_THREADS)
`define NW_WIDTH `UP(`NW_BITS)
`define NC_BITS `CLOG2(`NUM_CORES)
`define NT_WIDTH `UP(`NT_BITS)
`define NB_BITS `CLOG2(`NUM_BARRIERS)
`define NB_WIDTH `UP(`NB_BITS)
`define NUM_IREGS 32
`define NRI_BITS `CLOG2(`NUM_IREGS)
`ifdef EXT_F_ENABLE
`define NUM_REGS (2 * `NUM_IREGS)
`else
`define NUM_REGS `NUM_IREGS
`endif `endif
`define NR_BITS `CLOG2(`NUM_REGS) `ifdef DCACHE_ENABLE
`define L1_ENABLE
`define DV_STACK_SIZE `UP(`NUM_THREADS-1) `endif
`define DV_STACK_SIZEW `UP(`CLOG2(`DV_STACK_SIZE))
`define PERF_CTR_BITS 44
`ifndef NDEBUG `ifndef NDEBUG
`define UUID_ENABLE `define UUID_ENABLE
`define UUID_WIDTH 44
`else `else
`ifdef SCOPE `ifdef SCOPE
`define UUID_ENABLE `define UUID_ENABLE
`define UUID_WIDTH 44
`else
`define UUID_WIDTH 1
`endif `endif
`endif `endif
`define PC_BITS (`XLEN-1)
`define OFFSET_BITS 12
`define IMM_BITS `XLEN
`define NUM_SOCKETS `UP(`NUM_CORES / `SOCKET_SIZE)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
`define EX_ALU 0 `define ITF_TO_AOS(prefix, itf, count, dataw) \
`define EX_LSU 1 wire [(count)-1:0] prefix``_valid; \
`define EX_SFU 2 wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
`define EX_FPU (`EX_SFU + `EXT_F_ENABLED) wire [(count)-1:0] prefix``_ready; \
/* verilator lint_off GENUNNAMED */ \
for (genvar i = 0; i < (count); ++i) begin \
assign prefix``_valid[i] = itf[i].valid; \
assign prefix``_data[i] = itf[i].data; \
assign itf[i].ready = prefix``_ready[i]; \
end \
/* verilator lint_on GENUNNAMED */
`define NUM_EX_UNITS (3 + `EXT_F_ENABLED) `define AOS_TO_ITF(prefix, itf, count, dataw) \
`define EX_BITS `CLOG2(`NUM_EX_UNITS) wire [(count)-1:0] prefix``_valid; \
`define EX_WIDTH `UP(`EX_BITS) wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
wire [(count)-1:0] prefix``_ready; \
/* verilator lint_off GENUNNAMED */ \
for (genvar i = 0; i < (count); ++i) begin \
assign itf[i].valid = prefix``_valid[i]; \
assign itf[i].data = prefix``_data[i]; \
assign prefix``_ready[i] = itf[i].ready; \
end \
/* verilator lint_on GENUNNAMED */
`define SFU_CSRS 0 `define ITF_TO_AOS_V(prefix, itf, count, dataw) \
`define SFU_WCTL 1 wire [(count)-1:0] prefix``_valid; \
wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
/* verilator lint_off GENUNNAMED */ \
for (genvar i = 0; i < (count); ++i) begin \
assign prefix``_valid[i] = itf[i].valid; \
assign prefix``_data[i] = itf[i].data; \
end \
/* verilator lint_on GENUNNAMED */
`define NUM_SFU_UNITS (2) `define AOS_TO_ITF_V(prefix, itf, count, dataw) \
`define SFU_BITS `CLOG2(`NUM_SFU_UNITS) wire [(count)-1:0] prefix``_valid; \
`define SFU_WIDTH `UP(`SFU_BITS) wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
/* verilator lint_off GENUNNAMED */ \
for (genvar i = 0; i < (count); ++i) begin \
assign itf[i].valid = prefix``_valid[i]; \
assign itf[i].data = prefix``_data[i]; \
end \
/* verilator lint_on GENUNNAMED */
/////////////////////////////////////////////////////////////////////////////// `define ITF_TO_AOS_REQ(prefix, itf, count, dataw) \
wire [(count)-1:0] prefix``_valid; \
wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
wire [(count)-1:0] prefix``_ready; \
/* verilator lint_off GENUNNAMED */ \
for (genvar i = 0; i < (count); ++i) begin \
assign prefix``_valid[i] = itf[i].req_valid; \
assign prefix``_data[i] = itf[i].req_data; \
assign itf[i].req_ready = prefix``_ready[i]; \
end \
/* verilator lint_on GENUNNAMED */
`define INST_LUI 7'b0110111 `define AOS_TO_ITF_REQ(prefix, itf, count, dataw) \
`define INST_AUIPC 7'b0010111 wire [(count)-1:0] prefix``_valid; \
`define INST_JAL 7'b1101111 wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
`define INST_JALR 7'b1100111 wire [(count)-1:0] prefix``_ready; \
`define INST_B 7'b1100011 // branch instructions /* verilator lint_off GENUNNAMED */ \
`define INST_L 7'b0000011 // load instructions for (genvar i = 0; i < (count); ++i) begin \
`define INST_S 7'b0100011 // store instructions assign itf[i].req_valid = prefix``_valid[i]; \
`define INST_I 7'b0010011 // immediate instructions assign itf[i].req_data = prefix``_data[i]; \
`define INST_R 7'b0110011 // register instructions assign prefix``_ready[i] = itf[i].req_ready; \
`define INST_FENCE 7'b0001111 // Fence instructions end \
`define INST_SYS 7'b1110011 // system instructions /* verilator lint_on GENUNNAMED */
// RV64I instruction specific opcodes (for any W instruction) `define ITF_TO_AOS_REQ_V(prefix, itf, count, dataw) \
`define INST_I_W 7'b0011011 // W type immediate instructions wire [(count)-1:0] prefix``_valid; \
`define INST_R_W 7'b0111011 // W type register instructions wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
/* verilator lint_off GENUNNAMED */ \
for (genvar i = 0; i < (count); ++i) begin \
assign prefix``_valid[i] = itf[i].req_valid; \
assign prefix``_data[i] = itf[i].req_data; \
end \
/* verilator lint_on GENUNNAMED */
`define INST_FL 7'b0000111 // float load instruction `define AOS_TO_ITF_REQ_V(prefix, itf, count, dataw) \
`define INST_FS 7'b0100111 // float store instruction wire [(count)-1:0] prefix``_valid; \
`define INST_FMADD 7'b1000011 wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
`define INST_FMSUB 7'b1000111 /* verilator lint_off GENUNNAMED */ \
`define INST_FNMSUB 7'b1001011 for (genvar i = 0; i < (count); ++i) begin \
`define INST_FNMADD 7'b1001111 assign itf[i].req_valid = prefix``_valid[i]; \
`define INST_FCI 7'b1010011 // float common instructions assign itf[i].req_data = prefix``_data[i]; \
end \
/* verilator lint_on GENUNNAMED */
// Custom extension opcodes `define ITF_TO_AOS_RSP(prefix, itf, count, dataw) \
`define INST_EXT1 7'b0001011 // 0x0B wire [(count)-1:0] prefix``_valid; \
`define INST_EXT2 7'b0101011 // 0x2B wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
`define INST_EXT3 7'b1011011 // 0x5B wire [(count)-1:0] prefix``_ready; \
`define INST_EXT4 7'b1111011 // 0x7B /* verilator lint_off GENUNNAMED */ \
for (genvar i = 0; i < (count); ++i) begin \
assign prefix``_valid[i] = itf[i].rsp_valid; \
assign prefix``_data[i] = itf[i].rsp_data; \
assign itf[i].rsp_ready = prefix``_ready[i]; \
end \
/* verilator lint_on GENUNNAMED */
// Opcode extensions `define AOS_TO_ITF_RSP(prefix, itf, count, dataw) \
`define INST_R_F7_MUL 7'b0000001 wire [(count)-1:0] prefix``_valid; \
`define INST_R_F7_ZICOND 7'b0000111 wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
wire [(count)-1:0] prefix``_vready; \
/* verilator lint_off GENUNNAMED */ \
for (genvar i = 0; i < (count); ++i) begin \
assign itf[i].rsp_valid = prefix``_valid[i]; \
assign itf[i].rsp_data = prefix``_data[i]; \
assign prefix``_ready[i] = itf[i].rsp_ready; \
end \
/* verilator lint_off GENUNNAMED */
/////////////////////////////////////////////////////////////////////////////// `define ITF_TO_AOS_RSP_V(prefix, itf, count, dataw) \
wire [(count)-1:0] prefix``_valid; \
wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
/* verilator lint_off GENUNNAMED */ \
for (genvar i = 0; i < (count); ++i) begin \
assign prefix``_valid[i] = itf[i].rsp_valid; \
assign prefix``_data[i] = itf[i].rsp_data; \
end \
/* verilator lint_off GENUNNAMED */
`define INST_FRM_RNE 3'b000 // round to nearest even `define AOS_TO_ITF_RSP_V(prefix, itf, count, dataw) \
`define INST_FRM_RTZ 3'b001 // round to zero wire [(count)-1:0] prefix``_valid; \
`define INST_FRM_RDN 3'b010 // round to -inf wire [(count)-1:0][(dataw)-1:0] prefix``_data; \
`define INST_FRM_RUP 3'b011 // round to +inf /* verilator lint_off GENUNNAMED */ \
`define INST_FRM_RMM 3'b100 // round to nearest max magnitude for (genvar i = 0; i < (count); ++i) begin \
`define INST_FRM_DYN 3'b111 // dynamic mode assign itf[i].rsp_valid = prefix``_valid[i]; \
`define INST_FRM_BITS 3 assign itf[i].rsp_data = prefix``_data[i]; \
end \
/* verilator lint_off GENUNNAMED */
/////////////////////////////////////////////////////////////////////////////// `define REDUCE(__op, __out, __in, __n, __outw) \
/* verilator lint_off GENUNNAMED */ \
if (__n > 1) begin \
reg [(__outw)-1:0] result; \
always @(*) begin \
result = (__outw)'(__in[0]); \
for (integer __i = 1; __i < __n; __i++) begin \
result = result __op (__outw)'(__in[__i]); \
end \
end \
assign __out = result; \
end else begin \
assign __out = (__outw)'(__in[0]); \
end \
/* verilator lint_off GENUNNAMED */
`define INST_OP_BITS 4 `define REDUCE_TREE(__op, __out, __in, __n, __outw, __inw) \
`define INST_ARGS_BITS $bits(op_args_t) VX_reduce_tree #( \
`define INST_FMT_BITS 2 .DTAW_IN(__inw), \
.DATAW_OUT(__outw), \
.N(__n), \
.OP("__op") \
) reduce`__LINE__ ( \
.data_in(__in), \
.data_out(__out) \
)
/////////////////////////////////////////////////////////////////////////////// `define POP_COUNT_EX(out, in, model) \
VX_popcount #( \
.N ($bits(in)), \
.MODEL (model) \
) __pop_count_ex`__LINE__ ( \
.data_in (in), \
.data_out (out) \
)
`define INST_ALU_ADD 4'b0000 `define POP_COUNT(out, in) `POP_COUNT_EX(out, in, 1)
//`define INST_ALU_UNUSED 4'b0001
`define INST_ALU_LUI 4'b0010
`define INST_ALU_AUIPC 4'b0011
`define INST_ALU_SLTU 4'b0100
`define INST_ALU_SLT 4'b0101
//`define INST_ALU_UNUSED 4'b0110
`define INST_ALU_SUB 4'b0111
`define INST_ALU_SRL 4'b1000
`define INST_ALU_SRA 4'b1001
`define INST_ALU_CZEQ 4'b1010
`define INST_ALU_CZNE 4'b1011
`define INST_ALU_AND 4'b1100
`define INST_ALU_OR 4'b1101
`define INST_ALU_XOR 4'b1110
`define INST_ALU_SLL 4'b1111
`define CONCAT(out, left_in, right_in, L, R) \
/* verilator lint_off GENUNNAMED */ \
if ((L) != 0 && (R) == 0) begin \
assign out = left_in; \
end else if ((L) == 0 && (R) != 0) begin \
assign out = right_in; \
end else if ((L) != 0 && (R) != 0) begin \
assign out = {left_in, right_in}; \
end \
/* verilator lint_off GENUNNAMED */
`define ALU_TYPE_BITS 2 `define BUFFER_EX(dst, src, ena, resetw, latency) \
`define ALU_TYPE_ARITH 0 VX_pipe_register #( \
`define ALU_TYPE_BRANCH 1 .DATAW ($bits(dst)), \
`define ALU_TYPE_MULDIV 2 .RESETW (resetw), \
`define ALU_TYPE_OTHER 3 .DEPTH (latency) \
) __buffer_ex`__LINE__ ( \
.clk (clk), \
.reset (reset), \
.enable (ena), \
.data_in (src), \
.data_out (dst) \
)
`define INST_ALU_BITS 4 `define BUFFER(dst, src) `BUFFER_EX(dst, src, 1'b1, $bits(dst), 1)
`define INST_ALU_CLASS(op) op[3:2]
`define INST_ALU_SIGNED(op) op[0]
`define INST_ALU_IS_SUB(op) op[1]
`define INST_ALU_IS_CZERO(op) (op[3:1] == 3'b101)
`define INST_BR_EQ 4'b0000 `define NEG_EDGE(dst, src) \
`define INST_BR_NE 4'b0010 VX_edge_trigger #( \
`define INST_BR_LTU 4'b0100 .POS (0), \
`define INST_BR_GEU 4'b0110 .INIT (0) \
`define INST_BR_LT 4'b0101 ) __neg_edge`__LINE__ ( \
`define INST_BR_GE 4'b0111 .clk (clk), \
`define INST_BR_JAL 4'b1000 .reset (1'b0), \
`define INST_BR_JALR 4'b1001 .data_in (src), \
`define INST_BR_ECALL 4'b1010 .data_out (dst) \
`define INST_BR_EBREAK 4'b1011 )
`define INST_BR_URET 4'b1100
`define INST_BR_SRET 4'b1101
`define INST_BR_MRET 4'b1110
`define INST_BR_OTHER 4'b1111
`define INST_BR_BITS 4
`define INST_BR_CLASS(op) {1'b0, ~op[3]}
`define INST_BR_IS_NEG(op) op[1]
`define INST_BR_IS_LESS(op) op[2]
`define INST_BR_IS_STATIC(op) op[3]
`define INST_M_MUL 3'b000
`define INST_M_MULHU 3'b001
`define INST_M_MULH 3'b010
`define INST_M_MULHSU 3'b011
`define INST_M_DIV 3'b100
`define INST_M_DIVU 3'b101
`define INST_M_REM 3'b110
`define INST_M_REMU 3'b111
`define INST_M_BITS 3
`define INST_M_SIGNED(op) (~op[0])
`define INST_M_IS_MULX(op) (~op[2])
`define INST_M_IS_MULH(op) (op[1:0] != 0)
`define INST_M_SIGNED_A(op) (op[1:0] != 1)
`define INST_M_IS_REM(op) op[1]
`define INST_FMT_B 3'b000
`define INST_FMT_H 3'b001
`define INST_FMT_W 3'b010
`define INST_FMT_D 3'b011
`define INST_FMT_BU 3'b100
`define INST_FMT_HU 3'b101
`define INST_FMT_WU 3'b110
`define INST_LSU_LB 4'b0000
`define INST_LSU_LH 4'b0001
`define INST_LSU_LW 4'b0010
`define INST_LSU_LD 4'b0011 // new for RV64I LD
`define INST_LSU_LBU 4'b0100
`define INST_LSU_LHU 4'b0101
`define INST_LSU_LWU 4'b0110 // new for RV64I LWU
`define INST_LSU_SB 4'b1000
`define INST_LSU_SH 4'b1001
`define INST_LSU_SW 4'b1010
`define INST_LSU_SD 4'b1011 // new for RV64I SD
`define INST_LSU_FENCE 4'b1111
`define INST_LSU_BITS 4
`define INST_LSU_FMT(op) op[2:0]
`define INST_LSU_WSIZE(op) op[1:0]
`define INST_LSU_IS_FENCE(op) (op[3:2] == 3)
`define INST_FENCE_BITS 1
`define INST_FENCE_D 1'h0
`define INST_FENCE_I 1'h1
`define INST_FPU_ADD 4'b0000 // SUB=fmt[1]
`define INST_FPU_MUL 4'b0001
`define INST_FPU_MADD 4'b0010 // SUB=fmt[1]
`define INST_FPU_NMADD 4'b0011 // SUB=fmt[1]
`define INST_FPU_DIV 4'b0100
`define INST_FPU_SQRT 4'b0101
`define INST_FPU_F2I 4'b1000 // fmt[0]: F32=0, F64=1, fmt[1]: I32=0, I64=1
`define INST_FPU_F2U 4'b1001 // fmt[0]: F32=0, F64=1, fmt[1]: I32=0, I64=1
`define INST_FPU_I2F 4'b1010 // fmt[0]: F32=0, F64=1, fmt[1]: I32=0, I64=1
`define INST_FPU_U2F 4'b1011 // fmt[0]: F32=0, F64=1, fmt[1]: I32=0, I64=1
`define INST_FPU_CMP 4'b1100 // frm: LE=0, LT=1, EQ=2
`define INST_FPU_F2F 4'b1101 // fmt[0]: F32=0, F64=1
`define INST_FPU_MISC 4'b1110 // frm: SGNJ=0, SGNJN=1, SGNJX=2, CLASS=3, MVXW=4, MVWX=5, FMIN=6, FMAX=7
`define INST_FPU_BITS 4
`define INST_FPU_IS_CLASS(op, frm) (op == `INST_FPU_MISC && frm == 3)
`define INST_FPU_IS_MVXW(op, frm) (op == `INST_FPU_MISC && frm == 4)
`define INST_SFU_TMC 4'h0
`define INST_SFU_WSPAWN 4'h1
`define INST_SFU_SPLIT 4'h2
`define INST_SFU_JOIN 4'h3
`define INST_SFU_BAR 4'h4
`define INST_SFU_PRED 4'h5
`define INST_SFU_CSRRW 4'h6
`define INST_SFU_CSRRS 4'h7
`define INST_SFU_CSRRC 4'h8
`define INST_SFU_BITS 4
`define INST_SFU_CSR(f3) (4'h6 + 4'(f3) - 4'h1)
`define INST_SFU_IS_WCTL(op) (op <= 5)
`define INST_SFU_IS_CSR(op) (op >= 6 && op <= 8)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -296,71 +275,10 @@
`define CACHE_CLUSTER_NC_MEM_TAG_WIDTH(mshr_size, num_banks, num_reqs, mem_ports, line_size, word_size, tag_width, num_inputs, num_caches, uuid_width) \ `define CACHE_CLUSTER_NC_MEM_TAG_WIDTH(mshr_size, num_banks, num_reqs, mem_ports, line_size, word_size, tag_width, num_inputs, num_caches, uuid_width) \
`CACHE_CLUSTER_MEM_ARB_TAG(`CACHE_NC_MEM_TAG_WIDTH(mshr_size, num_banks, num_reqs, mem_ports, line_size, word_size, `CACHE_CLUSTER_CORE_ARB_TAG(tag_width, num_inputs, num_caches), uuid_width), num_caches) `CACHE_CLUSTER_MEM_ARB_TAG(`CACHE_NC_MEM_TAG_WIDTH(mshr_size, num_banks, num_reqs, mem_ports, line_size, word_size, `CACHE_CLUSTER_CORE_ARB_TAG(tag_width, num_inputs, num_caches), uuid_width), num_caches)
///////////////////////////////////////////////////////////////////////////////
`ifdef ICACHE_ENABLE
`define L1_ENABLE
`endif
`ifdef DCACHE_ENABLE
`define L1_ENABLE
`endif
`define MEM_REQ_FLAG_FLUSH 0
`define MEM_REQ_FLAG_IO 1
`define MEM_REQ_FLAG_LOCAL 2 // shoud be last since optional
`define MEM_REQ_FLAGS_WIDTH (`MEM_REQ_FLAG_LOCAL + `LMEM_ENABLED)
`define VX_MEM_PORTS `L3_MEM_PORTS
`define VX_MEM_BYTEEN_WIDTH `L3_LINE_SIZE
`define VX_MEM_ADDR_WIDTH (`MEM_ADDR_WIDTH - `CLOG2(`L3_LINE_SIZE))
`define VX_MEM_DATA_WIDTH (`L3_LINE_SIZE * 8)
`define VX_MEM_TAG_WIDTH L3_MEM_TAG_WIDTH
`define VX_DCR_ADDR_WIDTH `VX_DCR_ADDR_BITS
`define VX_DCR_DATA_WIDTH 32
`define TO_FULL_ADDR(x) {x, (`MEM_ADDR_WIDTH-$bits(x))'(0)} `define TO_FULL_ADDR(x) {x, (`MEM_ADDR_WIDTH-$bits(x))'(0)}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
`define NEG_EDGE(dst, src) \
VX_edge_trigger #( \
.POS (0), \
.INIT (0) \
) __neg_edge`__LINE__ ( \
.clk (clk), \
.reset (1'b0), \
.data_in (src), \
.data_out (dst) \
)
`define BUFFER_EX(dst, src, ena, resetw, latency) \
VX_pipe_register #( \
.DATAW ($bits(dst)), \
.RESETW (resetw), \
.DEPTH (latency) \
) __buffer_ex`__LINE__ ( \
.clk (clk), \
.reset (reset), \
.enable (ena), \
.data_in (src), \
.data_out (dst) \
)
`define BUFFER(dst, src) `BUFFER_EX(dst, src, 1'b1, $bits(dst), 1)
`define POP_COUNT_EX(out, in, model) \
VX_popcount #( \
.N ($bits(in)), \
.MODEL (model) \
) __pop_count_ex`__LINE__ ( \
.data_in (in), \
.data_out (out) \
)
`define POP_COUNT(out, in) `POP_COUNT_EX(out, in, 1)
`define ASSIGN_VX_IF(dst, src) \ `define ASSIGN_VX_IF(dst, src) \
assign dst.valid = src.valid; \ assign dst.valid = src.valid; \
assign dst.data = src.data; \ assign dst.data = src.data; \
@ -389,13 +307,13 @@
assign dst.rsp_ready = src.rsp_ready assign dst.rsp_ready = src.rsp_ready
`define ASSIGN_VX_MEM_BUS_IF_EX(dst, src, TD, TS, UUID) \ `define ASSIGN_VX_MEM_BUS_IF_EX(dst, src, TD, TS, UUID) \
/* verilator lint_off GENUNNAMED */ \
assign dst.req_valid = src.req_valid; \ assign dst.req_valid = src.req_valid; \
assign dst.req_data.rw = src.req_data.rw; \ assign dst.req_data.rw = src.req_data.rw; \
assign dst.req_data.addr = src.req_data.addr; \ assign dst.req_data.addr = src.req_data.addr; \
assign dst.req_data.data = src.req_data.data; \ assign dst.req_data.data = src.req_data.data; \
assign dst.req_data.byteen = src.req_data.byteen; \ assign dst.req_data.byteen = src.req_data.byteen; \
assign dst.req_data.flags = src.req_data.flags; \ assign dst.req_data.flags = src.req_data.flags; \
/* verilator lint_off GENUNNAMED */ \
if (TD != TS) begin \ if (TD != TS) begin \
if (UUID != 0) begin \ if (UUID != 0) begin \
if (TD > TS) begin \ if (TD > TS) begin \
@ -413,11 +331,9 @@
end else begin \ end else begin \
assign dst.req_data.tag = src.req_data.tag; \ assign dst.req_data.tag = src.req_data.tag; \
end \ end \
/* verilator lint_on GENUNNAMED */ \
assign src.req_ready = dst.req_ready; \ assign src.req_ready = dst.req_ready; \
assign src.rsp_valid = dst.rsp_valid; \ assign src.rsp_valid = dst.rsp_valid; \
assign src.rsp_data.data = dst.rsp_data.data; \ assign src.rsp_data.data = dst.rsp_data.data; \
/* verilator lint_off GENUNNAMED */ \
if (TD != TS) begin \ if (TD != TS) begin \
if (UUID != 0) begin \ if (UUID != 0) begin \
if (TD > TS) begin \ if (TD > TS) begin \
@ -435,8 +351,8 @@
end else begin \ end else begin \
assign src.rsp_data.tag = dst.rsp_data.tag; \ assign src.rsp_data.tag = dst.rsp_data.tag; \
end \ end \
/* verilator lint_on GENUNNAMED */ \ assign dst.rsp_ready = src.rsp_ready \
assign dst.rsp_ready = src.rsp_ready /* verilator lint_off GENUNNAMED */
`define INIT_VX_MEM_BUS_IF(itf) \ `define INIT_VX_MEM_BUS_IF(itf) \
assign itf.req_valid = 0; \ assign itf.req_valid = 0; \
@ -454,12 +370,11 @@
assign itf.rsp_data = '0; \ assign itf.rsp_data = '0; \
`UNUSED_VAR (itf.rsp_ready) `UNUSED_VAR (itf.rsp_ready)
`define BUFFER_DCR_BUS_IF(dst, src, ena, latency) \ `define BUFFER_DCR_BUS_IF(dst, src, ena, latency) \
/* verilator lint_off GENUNNAMED */ \ /* verilator lint_off GENUNNAMED */ \
if (latency != 0) begin \ if (latency != 0) begin \
VX_pipe_register #( \ VX_pipe_register #( \
.DATAW (1 + `VX_DCR_ADDR_WIDTH + `VX_DCR_DATA_WIDTH), \ .DATAW (1 + VX_DCR_ADDR_WIDTH + VX_DCR_DATA_WIDTH), \
.DEPTH (latency) \ .DEPTH (latency) \
) pipe_reg ( \ ) pipe_reg ( \
.clk (clk), \ .clk (clk), \
@ -471,14 +386,14 @@
end else begin \ end else begin \
assign {dst.write_valid, dst.write_addr, dst.write_data} = {src.write_valid && ena, src.write_addr, src.write_data}; \ assign {dst.write_valid, dst.write_addr, dst.write_data} = {src.write_valid && ena, src.write_addr, src.write_data}; \
end \ end \
/* verilator lint_on GENUNNAMED */ /* verilator lint_off GENUNNAMED */
`define PERF_COUNTER_ADD(dst, src, field, width, count, reg_enable) \ `define PERF_COUNTER_ADD(dst, src, field, width, count, reg_enable) \
/* verilator lint_off GENUNNAMED */ \ /* verilator lint_off GENUNNAMED */ \
if (count > 1) begin \ if ((count) > 1) begin \
wire [count-1:0][width-1:0] __reduce_add_i_field; \ wire [(count)-1:0][(width)-1:0] __reduce_add_i_field; \
wire [width-1:0] __reduce_add_o_field; \ wire [(width)-1:0] __reduce_add_o_field; \
for (genvar __i = 0; __i < count; ++__i) begin \ for (genvar __i = 0; __i < (count); ++__i) begin \
assign __reduce_add_i_field[__i] = src[__i].``field; \ assign __reduce_add_i_field[__i] = src[__i].``field; \
end \ end \
VX_reduce_tree #(.DATAW_IN(width), .N(count), .OP("+")) __reduce_add_field ( \ VX_reduce_tree #(.DATAW_IN(width), .N(count), .OP("+")) __reduce_add_field ( \
@ -486,7 +401,7 @@
__reduce_add_o_field \ __reduce_add_o_field \
); \ ); \
if (reg_enable) begin \ if (reg_enable) begin \
reg [width-1:0] __reduce_add_r_field; \ reg [(width)-1:0] __reduce_add_r_field; \
always @(posedge clk) begin \ always @(posedge clk) begin \
if (reset) begin \ if (reset) begin \
__reduce_add_r_field <= '0; \ __reduce_add_r_field <= '0; \
@ -501,19 +416,19 @@
end else begin \ end else begin \
assign dst.``field = src[0].``field; \ assign dst.``field = src[0].``field; \
end \ end \
/* verilator lint_on GENUNNAMED */ /* verilator lint_off GENUNNAMED */
`define ASSIGN_BLOCKED_WID(dst, src, block_idx, block_size) \ `define ASSIGN_BLOCKED_WID(dst, src, block_idx, block_size) \
/* verilator lint_off GENUNNAMED */ \ /* verilator lint_off GENUNNAMED */ \
if (block_size != 1) begin \ if (block_size != 1) begin \
if (block_size != `NUM_WARPS) begin \ if (block_size != `NUM_WARPS) begin \
assign dst = {src[`NW_WIDTH-1:`CLOG2(block_size)], `CLOG2(block_size)'(block_idx)}; \ assign dst = {src[NW_WIDTH-1:`CLOG2(block_size)], `CLOG2(block_size)'(block_idx)}; \
end else begin \ end else begin \
assign dst = `NW_WIDTH'(block_idx); \ assign dst = NW_WIDTH'(block_idx); \
end \ end \
end else begin \ end else begin \
assign dst = src; \ assign dst = src; \
end \ end \
/* verilator lint_on GENUNNAMED */ /* verilator lint_off GENUNNAMED */
`endif // VX_DEFINE_VH `endif // VX_DEFINE_VH

File diff suppressed because it is too large Load diff