mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 21:39:10 -04:00
minor updates
This commit is contained in:
parent
0048496ba2
commit
40a7d60d76
7 changed files with 112 additions and 116 deletions
|
@ -430,6 +430,23 @@
|
|||
assign src.rsp_tag = dst.rsp_tag; \
|
||||
assign dst.rsp_ready = src.rsp_ready
|
||||
|
||||
`define ASSIGN_VX_GPU_EXE_IF_V(dst, src, src_valid) \
|
||||
assign dst.valid = src_valid; \
|
||||
assign dst.uuid = src.uuid; \
|
||||
assign dst.wid = src.wid; \
|
||||
assign dst.tmask = src.tmask; \
|
||||
assign dst.PC = src.PC; \
|
||||
assign dst.next_PC = src.next_PC; \
|
||||
assign dst.op_type = src.op_type; \
|
||||
assign dst.op_mod = src.op_mod; \
|
||||
assign dst.tid = src.tid; \
|
||||
assign dst.rs1_data = src.rs1_data; \
|
||||
assign dst.rs2_data = src.rs2_data; \
|
||||
assign dst.rs3_data = src.rs3_data; \
|
||||
assign dst.rd = src.rd; \
|
||||
assign dst.wb = src.wb; \
|
||||
assign src.ready = dst.ready
|
||||
|
||||
`define REDUCE_ADD(dst, src, field, width, count) \
|
||||
wire [count-1:0][width-1:0] __reduce_add_i_``src``field; \
|
||||
wire [width-1:0] __reduce_add_o_``dst``field; \
|
||||
|
|
|
@ -88,7 +88,6 @@ module VX_socket #(
|
|||
VX_raster_arb #(
|
||||
.NUM_INPUTS (1),
|
||||
.NUM_LANES (`NUM_THREADS),
|
||||
.NUM_INPUTS (1),
|
||||
.NUM_OUTPUTS (`SOCKET_SIZE),
|
||||
.ARBITER ("R"),
|
||||
.BUFFERED ((`SOCKET_SIZE > 1) ? 2 : 0)
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
`include "VX_define.vh"
|
||||
`include "VX_gpu_types.vh"
|
||||
|
||||
`IGNORE_WARNINGS_BEGIN
|
||||
import VX_gpu_types::*;
|
||||
`IGNORE_WARNINGS_END
|
||||
|
||||
module VX_gpu_unit #(
|
||||
parameter CORE_ID = 0
|
||||
|
@ -67,26 +62,11 @@ module VX_gpu_unit #(
|
|||
wire csr_ready = ~csr_pending;
|
||||
assign gpu_req_valid = gpu_exe_if.valid && csr_ready;
|
||||
|
||||
`UNUSED_VAR (gpu_exe_if.op_mod)
|
||||
`UNUSED_VAR (gpu_exe_if.rs3_data)
|
||||
|
||||
// Warp control block
|
||||
|
||||
VX_gpu_exe_if wctl_exe_if();
|
||||
VX_commit_if wctl_commit_if();
|
||||
|
||||
assign wctl_exe_if.valid = gpu_req_valid && `INST_GPU_IS_WCTL(gpu_exe_if.op_type);
|
||||
assign wctl_exe_if.op_type = gpu_exe_if.op_type;
|
||||
assign wctl_exe_if.uuid = gpu_exe_if.uuid;
|
||||
assign wctl_exe_if.wid = gpu_exe_if.wid;
|
||||
assign wctl_exe_if.tmask = gpu_exe_if.tmask;
|
||||
assign wctl_exe_if.tid = gpu_exe_if.tid;
|
||||
assign wctl_exe_if.PC = gpu_exe_if.PC;
|
||||
assign wctl_exe_if.next_PC = gpu_exe_if.next_PC;
|
||||
assign wctl_exe_if.rd = gpu_exe_if.rd;
|
||||
assign wctl_exe_if.wb = gpu_exe_if.wb;
|
||||
assign wctl_exe_if.rs1_data = gpu_exe_if.rs1_data;
|
||||
assign wctl_exe_if.rs2_data = gpu_exe_if.rs2_data;
|
||||
|
||||
`ASSIGN_VX_GPU_EXE_IF_V(wctl_exe_if, gpu_exe_if, gpu_req_valid && `INST_GPU_IS_WCTL(gpu_exe_if.op_type));
|
||||
|
||||
VX_wctl_unit #(
|
||||
.OUTPUT_REG (RSP_ARB_SIZE > 1)
|
||||
|
@ -104,22 +84,10 @@ module VX_gpu_unit #(
|
|||
|
||||
`ifdef EXT_TEX_ENABLE
|
||||
|
||||
VX_tex_exe_if tex_exe_if();
|
||||
VX_commit_if tex_commit_if();
|
||||
VX_gpu_exe_if tex_exe_if();
|
||||
VX_commit_if tex_commit_if();
|
||||
|
||||
assign tex_exe_if.valid = gpu_req_valid && (gpu_exe_if.op_type == `INST_GPU_TEX);
|
||||
assign tex_exe_if.uuid = gpu_exe_if.uuid;
|
||||
assign tex_exe_if.wid = gpu_exe_if.wid;
|
||||
assign tex_exe_if.tmask = gpu_exe_if.tmask;
|
||||
assign tex_exe_if.PC = gpu_exe_if.PC;
|
||||
assign tex_exe_if.rd = gpu_exe_if.rd;
|
||||
assign tex_exe_if.stage = gpu_exe_if.op_mod[`VX_TEX_STAGE_BITS-1:0];
|
||||
|
||||
for (genvar i = 0; i < `NUM_THREADS; ++i) begin
|
||||
assign tex_exe_if.coords[0][i] = gpu_exe_if.rs1_data[i][31:0];
|
||||
assign tex_exe_if.coords[1][i] = gpu_exe_if.rs2_data[i][31:0];
|
||||
assign tex_exe_if.lod[i] = gpu_exe_if.rs3_data[i][0 +: `VX_TEX_LOD_BITS];
|
||||
end
|
||||
`ASSIGN_VX_GPU_EXE_IF_V(tex_exe_if, gpu_exe_if, gpu_req_valid && (gpu_exe_if.op_type == `INST_GPU_TEX));
|
||||
|
||||
`RESET_RELAY (tex_reset, reset);
|
||||
|
||||
|
@ -128,8 +96,8 @@ module VX_gpu_unit #(
|
|||
) tex_agent (
|
||||
.clk (clk),
|
||||
.reset (tex_reset),
|
||||
.gpu_exe_if (tex_exe_if),
|
||||
.tex_csr_if (tex_csr_if),
|
||||
.tex_exe_if (tex_exe_if),
|
||||
.tex_bus_if (tex_bus_if),
|
||||
.commit_if (tex_commit_if)
|
||||
);
|
||||
|
@ -142,15 +110,10 @@ module VX_gpu_unit #(
|
|||
|
||||
`ifdef EXT_RASTER_ENABLE
|
||||
|
||||
VX_raster_exe_if raster_exe_if();
|
||||
VX_commit_if raster_commit_if();
|
||||
VX_gpu_exe_if raster_exe_if();
|
||||
VX_commit_if raster_commit_if();
|
||||
|
||||
assign raster_exe_if.valid = gpu_req_valid && (gpu_exe_if.op_type == `INST_GPU_RASTER);
|
||||
assign raster_exe_if.uuid = gpu_exe_if.uuid;
|
||||
assign raster_exe_if.wid = gpu_exe_if.wid;
|
||||
assign raster_exe_if.tmask = gpu_exe_if.tmask;
|
||||
assign raster_exe_if.PC = gpu_exe_if.PC;
|
||||
assign raster_exe_if.rd = gpu_exe_if.rd;
|
||||
`ASSIGN_VX_GPU_EXE_IF_V(raster_exe_if, gpu_exe_if, gpu_req_valid && (gpu_exe_if.op_type == `INST_GPU_RASTER));
|
||||
|
||||
`RESET_RELAY (raster_reset, reset);
|
||||
|
||||
|
@ -159,9 +122,9 @@ module VX_gpu_unit #(
|
|||
) raster_agent (
|
||||
.clk (clk),
|
||||
.reset (raster_reset),
|
||||
.gpu_exe_if (raster_exe_if),
|
||||
.raster_csr_if (raster_csr_if),
|
||||
.raster_bus_if (raster_bus_if),
|
||||
.raster_exe_if (raster_exe_if),
|
||||
.raster_bus_if (raster_bus_if),
|
||||
.commit_if (raster_commit_if)
|
||||
);
|
||||
|
||||
|
@ -173,22 +136,10 @@ module VX_gpu_unit #(
|
|||
|
||||
`ifdef EXT_ROP_ENABLE
|
||||
|
||||
VX_rop_exe_if rop_exe_if();
|
||||
VX_commit_if rop_commit_if();
|
||||
VX_gpu_exe_if rop_exe_if();
|
||||
VX_commit_if rop_commit_if();
|
||||
|
||||
assign rop_exe_if.valid = gpu_req_valid && (gpu_exe_if.op_type == `INST_GPU_ROP);
|
||||
assign rop_exe_if.uuid = gpu_exe_if.uuid;
|
||||
assign rop_exe_if.wid = gpu_exe_if.wid;
|
||||
assign rop_exe_if.tmask = gpu_exe_if.tmask;
|
||||
assign rop_exe_if.PC = gpu_exe_if.PC;
|
||||
|
||||
for (genvar i = 0; i < `NUM_THREADS; ++i) begin
|
||||
assign rop_exe_if.face[i] = gpu_exe_if.rs1_data[i][0];
|
||||
assign rop_exe_if.pos_x[i] = gpu_exe_if.rs1_data[i][1 +: `VX_ROP_DIM_BITS];
|
||||
assign rop_exe_if.pos_y[i] = gpu_exe_if.rs1_data[i][16 +: `VX_ROP_DIM_BITS];
|
||||
assign rop_exe_if.color[i] = gpu_exe_if.rs2_data[i][31:0];
|
||||
assign rop_exe_if.depth[i] = gpu_exe_if.rs3_data[i][`VX_ROP_DEPTH_BITS-1:0];
|
||||
end
|
||||
`ASSIGN_VX_GPU_EXE_IF_V(rop_exe_if, gpu_exe_if, gpu_req_valid && (gpu_exe_if.op_type == `INST_GPU_ROP));
|
||||
|
||||
`RESET_RELAY (rop_reset, reset);
|
||||
|
||||
|
@ -197,8 +148,8 @@ module VX_gpu_unit #(
|
|||
) rop_agent (
|
||||
.clk (clk),
|
||||
.reset (rop_reset),
|
||||
.gpu_exe_if (rop_exe_if),
|
||||
.rop_csr_if (rop_csr_if),
|
||||
.rop_exe_if (rop_exe_if),
|
||||
.rop_bus_if (rop_bus_if),
|
||||
.commit_if (rop_commit_if)
|
||||
);
|
||||
|
@ -272,7 +223,7 @@ module VX_gpu_unit #(
|
|||
`endif
|
||||
|
||||
// can accept new request?
|
||||
|
||||
|
||||
always @(*) begin
|
||||
case (gpu_exe_if.op_type)
|
||||
`ifdef EXT_TEX_ENABLE
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
`include "VX_define.vh"
|
||||
`include "VX_gpu_types.vh"
|
||||
|
||||
`IGNORE_WARNINGS_BEGIN
|
||||
import VX_gpu_types::*;
|
||||
`IGNORE_WARNINGS_END
|
||||
|
||||
module VX_wctl_unit #(
|
||||
parameter OUTPUT_REG = 0
|
||||
|
|
|
@ -7,11 +7,11 @@ module VX_raster_agent #(
|
|||
input wire reset,
|
||||
|
||||
// Inputs
|
||||
VX_raster_exe_if.slave raster_exe_if,
|
||||
VX_raster_bus_if.slave raster_bus_if,
|
||||
|
||||
// Outputs
|
||||
VX_gpu_exe_if.slave gpu_exe_if,
|
||||
VX_gpu_csr_if.slave raster_csr_if,
|
||||
VX_raster_bus_if.slave raster_bus_if,
|
||||
|
||||
// Outputs
|
||||
VX_commit_if.master commit_if
|
||||
);
|
||||
`UNUSED_PARAM (CORE_ID)
|
||||
|
@ -23,7 +23,7 @@ module VX_raster_agent #(
|
|||
|
||||
// CSRs access
|
||||
|
||||
wire csr_write_enable = raster_bus_if.req_valid && raster_exe_if.valid && raster_rsp_ready;
|
||||
wire csr_write_enable = raster_bus_if.req_valid && gpu_exe_if.valid && raster_rsp_ready;
|
||||
|
||||
VX_raster_csr #(
|
||||
.CORE_ID (CORE_ID)
|
||||
|
@ -32,22 +32,22 @@ module VX_raster_agent #(
|
|||
.reset (reset),
|
||||
// inputs
|
||||
.write_enable (csr_write_enable),
|
||||
.write_uuid (raster_exe_if.uuid),
|
||||
.write_wid (raster_exe_if.wid),
|
||||
.write_tmask (raster_exe_if.tmask),
|
||||
.write_uuid (gpu_exe_if.uuid),
|
||||
.write_wid (gpu_exe_if.wid),
|
||||
.write_tmask (gpu_exe_if.tmask),
|
||||
.write_data (raster_bus_if.req_stamps),
|
||||
// outputs
|
||||
.raster_csr_if (raster_csr_if)
|
||||
);
|
||||
|
||||
// it is possible to have ready = f(valid) when using arbiters,
|
||||
// because of that we need to decouple raster_exe_if and commit_if handshake with a pipe register
|
||||
// because of that we need to decouple gpu_exe_if and commit_if handshake with a pipe register
|
||||
|
||||
assign raster_exe_if.ready = raster_bus_if.req_valid && raster_rsp_ready;
|
||||
assign gpu_exe_if.ready = raster_bus_if.req_valid && raster_rsp_ready;
|
||||
|
||||
assign raster_bus_if.req_ready = raster_exe_if.valid && raster_rsp_ready;
|
||||
assign raster_bus_if.req_ready = gpu_exe_if.valid && raster_rsp_ready;
|
||||
|
||||
assign raster_rsp_valid = raster_exe_if.valid && raster_bus_if.req_valid;
|
||||
assign raster_rsp_valid = gpu_exe_if.valid && raster_bus_if.req_valid;
|
||||
|
||||
wire [`NUM_THREADS-1:0][31:0] response_data, commit_data;
|
||||
|
||||
|
@ -62,7 +62,7 @@ module VX_raster_agent #(
|
|||
.reset (reset),
|
||||
.valid_in (raster_rsp_valid),
|
||||
.ready_in (raster_rsp_ready),
|
||||
.data_in ({raster_exe_if.uuid, raster_exe_if.wid, raster_exe_if.tmask, raster_exe_if.PC, raster_exe_if.rd, response_data}),
|
||||
.data_in ({gpu_exe_if.uuid, gpu_exe_if.wid, gpu_exe_if.tmask, gpu_exe_if.PC, gpu_exe_if.rd, response_data}),
|
||||
.data_out ({commit_if.uuid, commit_if.wid, commit_if.tmask, commit_if.PC, commit_if.rd, commit_data}),
|
||||
.valid_out (commit_if.valid),
|
||||
.ready_out (commit_if.ready)
|
||||
|
@ -77,16 +77,16 @@ module VX_raster_agent #(
|
|||
|
||||
`ifdef DBG_TRACE_RASTER
|
||||
always @(posedge clk) begin
|
||||
if (raster_exe_if.valid && raster_exe_if.ready) begin
|
||||
if (gpu_exe_if.valid && gpu_exe_if.ready) begin
|
||||
for (integer i = 0; i < `NUM_THREADS; ++i) begin
|
||||
`TRACE(1, ("%d: core%0d-raster-stamp[%0d]: wid=%0d, PC=0x%0h, tmask=%b, done=%b, x=%0d, y=%0d, mask=%0d, pid=%0d, bcoords={{0x%0h, 0x%0h, 0x%0h}, {0x%0h, 0x%0h, 0x%0h}, {0x%0h, 0x%0h, 0x%0h}, {0x%0h, 0x%0h, 0x%0h}} (#%0d)\n",
|
||||
$time, CORE_ID, i, raster_exe_if.wid, raster_exe_if.PC, raster_exe_if.tmask,
|
||||
$time, CORE_ID, i, gpu_exe_if.wid, gpu_exe_if.PC, gpu_exe_if.tmask,
|
||||
raster_bus_if.req_done,
|
||||
raster_bus_if.req_stamps[i].pos_x, raster_bus_if.req_stamps[i].pos_y, raster_bus_if.req_stamps[i].mask, raster_bus_if.req_stamps[i].pid,
|
||||
raster_bus_if.req_stamps[i].bcoords[0][0], raster_bus_if.req_stamps[i].bcoords[1][0], raster_bus_if.req_stamps[i].bcoords[2][0],
|
||||
raster_bus_if.req_stamps[i].bcoords[0][1], raster_bus_if.req_stamps[i].bcoords[1][1], raster_bus_if.req_stamps[i].bcoords[2][1],
|
||||
raster_bus_if.req_stamps[i].bcoords[0][2], raster_bus_if.req_stamps[i].bcoords[1][2], raster_bus_if.req_stamps[i].bcoords[2][2],
|
||||
raster_bus_if.req_stamps[i].bcoords[0][3], raster_bus_if.req_stamps[i].bcoords[1][3], raster_bus_if.req_stamps[i].bcoords[2][3], raster_exe_if.uuid));
|
||||
raster_bus_if.req_stamps[i].bcoords[0][3], raster_bus_if.req_stamps[i].bcoords[1][3], raster_bus_if.req_stamps[i].bcoords[2][3], gpu_exe_if.uuid));
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,18 +7,32 @@ module VX_rop_agent #(
|
|||
input wire reset,
|
||||
|
||||
// Inputs
|
||||
VX_rop_exe_if.slave rop_exe_if,
|
||||
VX_gpu_csr_if.slave rop_csr_if,
|
||||
VX_gpu_exe_if.slave gpu_exe_if,
|
||||
VX_gpu_csr_if.slave rop_csr_if,
|
||||
|
||||
// Outputs
|
||||
VX_rop_bus_if.master rop_bus_if,
|
||||
VX_commit_if.master commit_if
|
||||
VX_rop_bus_if.master rop_bus_if,
|
||||
VX_commit_if.master commit_if
|
||||
);
|
||||
`UNUSED_PARAM (CORE_ID)
|
||||
|
||||
localparam UUID_WIDTH = `UP(`UUID_BITS);
|
||||
localparam NW_WIDTH = `UP(`NW_BITS);
|
||||
|
||||
wire [`NUM_THREADS-1:0][`VX_ROP_DIM_BITS-1:0] gpu_exe_pos_x;
|
||||
wire [`NUM_THREADS-1:0][`VX_ROP_DIM_BITS-1:0] gpu_exe_pos_y;
|
||||
wire [`NUM_THREADS-1:0] gpu_exe_face;
|
||||
wire [`NUM_THREADS-1:0][31:0] gpu_exe_color;
|
||||
wire [`NUM_THREADS-1:0][`VX_ROP_DEPTH_BITS-1:0] gpu_exe_depth;
|
||||
|
||||
for (genvar i = 0; i < `NUM_THREADS; ++i) begin
|
||||
assign gpu_exe_face[i] = gpu_exe_if.rs1_data[i][0];
|
||||
assign gpu_exe_pos_x[i] = gpu_exe_if.rs1_data[i][1 +: `VX_ROP_DIM_BITS];
|
||||
assign gpu_exe_pos_y[i] = gpu_exe_if.rs1_data[i][16 +: `VX_ROP_DIM_BITS];
|
||||
assign gpu_exe_color[i] = gpu_exe_if.rs2_data[i][31:0];
|
||||
assign gpu_exe_depth[i] = gpu_exe_if.rs3_data[i][`VX_ROP_DEPTH_BITS-1:0];
|
||||
end
|
||||
|
||||
// CSRs access
|
||||
|
||||
rop_csrs_t rop_csrs;
|
||||
|
@ -42,7 +56,7 @@ module VX_rop_agent #(
|
|||
wire rop_rsp_valid, rop_rsp_ready;
|
||||
|
||||
// it is possible to have ready = f(valid) when using arbiters,
|
||||
// because of that we need to decouple rop_exe_if and commit_if handshake with a pipe register
|
||||
// because of that we need to decouple gpu_exe_if and commit_if handshake with a pipe register
|
||||
|
||||
VX_skid_buffer #(
|
||||
.DATAW (UUID_WIDTH + `NUM_THREADS * (1 + 2 * `VX_ROP_DIM_BITS + 32 + `VX_ROP_DEPTH_BITS + 1)),
|
||||
|
@ -52,15 +66,15 @@ module VX_rop_agent #(
|
|||
.reset (reset),
|
||||
.valid_in (rop_req_valid),
|
||||
.ready_in (rop_req_ready),
|
||||
.data_in ({rop_exe_if.uuid, rop_exe_if.tmask, rop_exe_if.pos_x, rop_exe_if.pos_y, rop_exe_if.color, rop_exe_if.depth, rop_exe_if.face}),
|
||||
.data_in ({gpu_exe_if.uuid, gpu_exe_if.tmask, gpu_exe_pos_x, gpu_exe_pos_y, gpu_exe_color, gpu_exe_depth, gpu_exe_face}),
|
||||
.data_out ({rop_bus_if.req_uuid, rop_bus_if.req_mask, rop_bus_if.req_pos_x, rop_bus_if.req_pos_y, rop_bus_if.req_color, rop_bus_if.req_depth, rop_bus_if.req_face}),
|
||||
.valid_out (rop_bus_if.req_valid),
|
||||
.ready_out (rop_bus_if.req_ready)
|
||||
);
|
||||
|
||||
assign rop_req_valid = rop_exe_if.valid && rop_rsp_ready;
|
||||
assign rop_exe_if.ready = rop_req_ready && rop_rsp_ready;
|
||||
assign rop_rsp_valid = rop_exe_if.valid && rop_req_ready;
|
||||
assign rop_req_valid = gpu_exe_if.valid && rop_rsp_ready;
|
||||
assign gpu_exe_if.ready = rop_req_ready && rop_rsp_ready;
|
||||
assign rop_rsp_valid = gpu_exe_if.valid && rop_req_ready;
|
||||
|
||||
VX_skid_buffer #(
|
||||
.DATAW (UUID_WIDTH + NW_WIDTH + `NUM_THREADS + `XLEN)
|
||||
|
@ -69,7 +83,7 @@ module VX_rop_agent #(
|
|||
.reset (reset),
|
||||
.valid_in (rop_rsp_valid),
|
||||
.ready_in (rop_rsp_ready),
|
||||
.data_in ({rop_exe_if.uuid, rop_exe_if.wid, rop_exe_if.tmask, rop_exe_if.PC}),
|
||||
.data_in ({gpu_exe_if.uuid, gpu_exe_if.wid, gpu_exe_if.tmask, gpu_exe_if.PC}),
|
||||
.data_out ({commit_if.uuid, commit_if.wid, commit_if.tmask, commit_if.PC}),
|
||||
.valid_out (commit_if.valid),
|
||||
.ready_out (commit_if.ready)
|
||||
|
@ -82,18 +96,18 @@ module VX_rop_agent #(
|
|||
|
||||
`ifdef DBG_TRACE_ROP
|
||||
always @(posedge clk) begin
|
||||
if (rop_exe_if.valid && rop_exe_if.ready) begin
|
||||
`TRACE(1, ("%d: core%0d-rop-req: wid=%0d, PC=0x%0h, tmask=%b, x=", $time, CORE_ID, rop_exe_if.wid, rop_exe_if.PC, rop_exe_if.tmask));
|
||||
`TRACE_ARRAY1D(1, rop_exe_if.pos_x, `NUM_THREADS);
|
||||
if (gpu_exe_if.valid && gpu_exe_if.ready) begin
|
||||
`TRACE(1, ("%d: core%0d-rop-req: wid=%0d, PC=0x%0h, tmask=%b, x=", $time, CORE_ID, gpu_exe_if.wid, gpu_exe_if.PC, gpu_exe_if.tmask));
|
||||
`TRACE_ARRAY1D(1, gpu_exe_if.pos_x, `NUM_THREADS);
|
||||
`TRACE(1, (", y="));
|
||||
`TRACE_ARRAY1D(1, rop_exe_if.pos_y, `NUM_THREADS);
|
||||
`TRACE_ARRAY1D(1, gpu_exe_if.pos_y, `NUM_THREADS);
|
||||
`TRACE(1, (", face="));
|
||||
`TRACE_ARRAY1D(1, rop_exe_if.face, `NUM_THREADS);
|
||||
`TRACE_ARRAY1D(1, gpu_exe_if.face, `NUM_THREADS);
|
||||
`TRACE(1, (", color="));
|
||||
`TRACE_ARRAY1D(1, rop_exe_if.color, `NUM_THREADS);
|
||||
`TRACE_ARRAY1D(1, gpu_exe_if.color, `NUM_THREADS);
|
||||
`TRACE(1, (", depth="));
|
||||
`TRACE_ARRAY1D(1, rop_exe_if.depth, `NUM_THREADS);
|
||||
`TRACE(1, (", face=%b (#%0d)\n", rop_exe_if.face, rop_exe_if.uuid));
|
||||
`TRACE_ARRAY1D(1, gpu_exe_if.depth, `NUM_THREADS);
|
||||
`TRACE(1, (", face=%b (#%0d)\n", gpu_exe_if.face, gpu_exe_if.uuid));
|
||||
end
|
||||
end
|
||||
`endif
|
||||
|
|
|
@ -7,9 +7,9 @@ module VX_tex_agent #(
|
|||
input wire reset,
|
||||
|
||||
// Inputs
|
||||
VX_gpu_exe_if.slave gpu_exe_if,
|
||||
VX_gpu_csr_if.slave tex_csr_if,
|
||||
VX_tex_exe_if.slave tex_exe_if,
|
||||
|
||||
|
||||
// Outputs
|
||||
VX_tex_bus_if.master tex_bus_if,
|
||||
VX_commit_if.master commit_if
|
||||
|
@ -41,17 +41,27 @@ module VX_tex_agent #(
|
|||
|
||||
// Store request info
|
||||
|
||||
wire [1:0][`NUM_THREADS-1:0][31:0] gpu_exe_coords;
|
||||
wire [`NUM_THREADS-1:0][`VX_TEX_LOD_BITS-1:0] gpu_exe_lod;
|
||||
wire [`VX_TEX_STAGE_BITS-1:0] gpu_exe_stage;
|
||||
|
||||
wire [UUID_WIDTH-1:0] rsp_uuid;
|
||||
wire [NW_WIDTH-1:0] rsp_wid;
|
||||
wire [`NUM_THREADS-1:0] rsp_tmask;
|
||||
wire [`XLEN-1:0] rsp_PC;
|
||||
wire [`NR_BITS-1:0] rsp_rd;
|
||||
|
||||
wire [REQ_QUEUE_BITS-1:0] mdata_waddr, mdata_raddr;
|
||||
|
||||
wire [REQ_QUEUE_BITS-1:0] mdata_waddr, mdata_raddr;
|
||||
wire mdata_full;
|
||||
|
||||
wire mdata_push = tex_exe_if.valid && tex_exe_if.ready;
|
||||
assign gpu_exe_stage = gpu_exe_if.op_mod[`VX_TEX_STAGE_BITS-1:0];
|
||||
for (genvar i = 0; i < `NUM_THREADS; ++i) begin
|
||||
assign gpu_exe_coords[0][i] = gpu_exe_if.rs1_data[i][31:0];
|
||||
assign gpu_exe_coords[1][i] = gpu_exe_if.rs2_data[i][31:0];
|
||||
assign gpu_exe_lod[i] = gpu_exe_if.rs3_data[i][0 +: `VX_TEX_LOD_BITS];
|
||||
end
|
||||
|
||||
wire mdata_push = gpu_exe_if.valid && gpu_exe_if.ready;
|
||||
wire mdata_pop = tex_bus_if.rsp_valid && tex_bus_if.rsp_ready;
|
||||
|
||||
VX_index_buffer #(
|
||||
|
@ -64,7 +74,7 @@ module VX_tex_agent #(
|
|||
.write_addr (mdata_waddr),
|
||||
.read_addr (mdata_raddr),
|
||||
.release_addr (mdata_raddr),
|
||||
.write_data ({tex_exe_if.wid, tex_exe_if.tmask, tex_exe_if.PC, tex_exe_if.rd}),
|
||||
.write_data ({gpu_exe_if.wid, gpu_exe_if.tmask, gpu_exe_if.PC, gpu_exe_if.rd}),
|
||||
.read_data ({rsp_wid, rsp_tmask, rsp_PC, rsp_rd}),
|
||||
.release_slot (mdata_pop),
|
||||
.full (mdata_full),
|
||||
|
@ -74,10 +84,10 @@ module VX_tex_agent #(
|
|||
// submit texture request
|
||||
|
||||
wire valid_in, ready_in;
|
||||
assign valid_in = tex_exe_if.valid && ~mdata_full;
|
||||
assign tex_exe_if.ready = ready_in && ~mdata_full;
|
||||
assign valid_in = gpu_exe_if.valid && ~mdata_full;
|
||||
assign gpu_exe_if.ready = ready_in && ~mdata_full;
|
||||
|
||||
wire [`TEX_REQ_TAG_WIDTH-1:0] req_tag = {tex_exe_if.uuid, mdata_waddr};
|
||||
wire [`TEX_REQ_TAG_WIDTH-1:0] req_tag = {gpu_exe_if.uuid, mdata_waddr};
|
||||
|
||||
VX_skid_buffer #(
|
||||
.DATAW (`NUM_THREADS * (1 + 2 * 32 + `VX_TEX_LOD_BITS) + `VX_TEX_STAGE_BITS + `TEX_REQ_TAG_WIDTH),
|
||||
|
@ -87,7 +97,7 @@ module VX_tex_agent #(
|
|||
.reset (reset),
|
||||
.valid_in (valid_in),
|
||||
.ready_in (ready_in),
|
||||
.data_in ({tex_exe_if.tmask, tex_exe_if.coords, tex_exe_if.lod, tex_exe_if.stage, req_tag}),
|
||||
.data_in ({gpu_exe_if.tmask, gpu_exe_coords, gpu_exe_lod, gpu_exe_stage, req_tag}),
|
||||
.data_out ({tex_bus_if.req_mask, tex_bus_if.req_coords, tex_bus_if.req_lod, tex_bus_if.req_stage, tex_bus_if.req_tag}),
|
||||
.valid_out (tex_bus_if.req_valid),
|
||||
.ready_out (tex_bus_if.req_ready)
|
||||
|
@ -122,14 +132,14 @@ module VX_tex_agent #(
|
|||
|
||||
`ifdef DBG_TRACE_TEX
|
||||
always @(posedge clk) begin
|
||||
if (tex_exe_if.valid && tex_exe_if.ready) begin
|
||||
`TRACE(1, ("%d: core%0d-tex-req: wid=%0d, PC=0x%0h, tmask=%b, u=", $time, CORE_ID, tex_exe_if.wid, tex_exe_if.PC, tex_exe_if.tmask));
|
||||
`TRACE_ARRAY1D(1, tex_exe_if.coords[0], `NUM_THREADS);
|
||||
if (gpu_exe_if.valid && gpu_exe_if.ready) begin
|
||||
`TRACE(1, ("%d: core%0d-tex-req: wid=%0d, PC=0x%0h, tmask=%b, u=", $time, CORE_ID, gpu_exe_if.wid, gpu_exe_if.PC, gpu_exe_if.tmask));
|
||||
`TRACE_ARRAY1D(1, gpu_exe_if.coords[0], `NUM_THREADS);
|
||||
`TRACE(1, (", v="));
|
||||
`TRACE_ARRAY1D(1, tex_exe_if.coords[1], `NUM_THREADS);
|
||||
`TRACE_ARRAY1D(1, gpu_exe_if.coords[1], `NUM_THREADS);
|
||||
`TRACE(1, (", lod="));
|
||||
`TRACE_ARRAY1D(1, tex_exe_if.lod, `NUM_THREADS);
|
||||
`TRACE(1, (", stage=%0d, tag=0x%0h (#%0d)\n", tex_exe_if.stage, req_tag, tex_exe_if.uuid));
|
||||
`TRACE_ARRAY1D(1, gpu_exe_if.lod, `NUM_THREADS);
|
||||
`TRACE(1, (", stage=%0d, tag=0x%0h (#%0d)\n", gpu_exe_if.stage, req_tag, gpu_exe_if.uuid));
|
||||
end
|
||||
if (commit_if.valid && commit_if.ready) begin
|
||||
`TRACE(1, ("%d: core%0d-tex-rsp: wid=%0d, PC=0x%0h, tmask=%b, rd=%0d, texels=", $time, CORE_ID, commit_if.wid, commit_if.PC, commit_if.tmask, commit_if.rd));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue