minor updates

This commit is contained in:
Blaise Tine 2022-10-17 23:20:33 -04:00
parent e7eecf8255
commit 5879b2ded1
15 changed files with 65 additions and 53 deletions

View file

@ -139,10 +139,13 @@ module VX_afu_control #(
assign s_axi_wready = (wstate == WSTATE_DATA);
assign s_axi_bresp = 2'b00; // OKAY
assign s_axi_bvalid = (wstate == WSTATE_RESP);
assign wmask = {{8{s_axi_wstrb[3]}}, {8{s_axi_wstrb[2]}}, {8{s_axi_wstrb[1]}}, {8{s_axi_wstrb[0]}}};
assign aw_hs = s_axi_awvalid && s_axi_awready;
assign wd_hs = s_axi_wvalid && s_axi_wready;
for (genvar i = 0; i < 4; ++i) begin
assign wmask[i] = {8{s_axi_wstrb[i]}};
end
// wstate
always @(posedge clk) begin
if (reset)

View file

@ -41,9 +41,9 @@ module VX_imadd #(
for (genvar i = 0; i < NUM_LANES; ++i) begin
VX_multiplier #(
.WIDTHA (DATA_WIDTH),
.WIDTHB (DATA_WIDTH),
.WIDTHP (PROD_WIDTH),
.A_WIDTH (DATA_WIDTH),
.B_WIDTH (DATA_WIDTH),
.R_WIDTH (PROD_WIDTH),
.SIGNED (SIGNED),
.LATENCY (`LATENCY_IMUL)
) multiplier (

View file

@ -138,13 +138,14 @@ module VX_lsu_unit #(
// data formatting
for (genvar i = 0; i < `NUM_THREADS; ++i) begin
wire [REQ_ASHIFT-1:0] req_align_X1 = {req_align[i][1], 1'b1};
always @(*) begin
mem_req_byteen[i] = {4{lsu_req_if.wb}};
case (`INST_LSU_WSIZE(lsu_req_if.op_type))
0: mem_req_byteen[i][req_align[i]] = 1;
1: begin
mem_req_byteen[i][req_align[i]] = 1;
mem_req_byteen[i][{req_align[i][1], 1'b1}] = 1;
mem_req_byteen[i][req_align_X1] = 1;
end
default : mem_req_byteen[i] = {4{1'b1}};
endcase

View file

@ -91,9 +91,9 @@ module VX_muldiv (
`IGNORE_UNUSED_END
VX_multiplier #(
.WIDTHA (33),
.WIDTHB (33),
.WIDTHP (66),
.A_WIDTH (33),
.B_WIDTH (33),
.R_WIDTH (66),
.SIGNED (1),
.LATENCY (`LATENCY_IMUL)
) multiplier (

View file

@ -10,8 +10,8 @@ module VX_divider #(
parameter D_SIGNED = 0,
parameter LATENCY = 0
) (
input wire clk,
input wire enable,
input wire clk,
input wire enable,
input wire [N_WIDTH-1:0] numer,
input wire [D_WIDTH-1:0] denom,
output wire [Q_WIDTH-1:0] quotient,

View file

@ -2,21 +2,21 @@
`TRACING_OFF
module VX_multiplier #(
parameter WIDTHA = 1,
parameter WIDTHB = 1,
parameter WIDTHP = 1,
parameter A_WIDTH = 1,
parameter B_WIDTH = 1,
parameter R_WIDTH = 1,
parameter SIGNED = 0,
parameter LATENCY = 0
) (
input wire clk,
input wire enable,
input wire [WIDTHA-1:0] dataa,
input wire [WIDTHB-1:0] datab,
output wire [WIDTHP-1:0] result
input wire [A_WIDTH-1:0] dataa,
input wire [B_WIDTH-1:0] datab,
output wire [R_WIDTH-1:0] result
);
`STATIC_ASSERT ((LATENCY <= 3), ("invalid parameter"))
wire [WIDTHP-1:0] result_unqual;
wire [R_WIDTH-1:0] result_unqual;
if (SIGNED != 0) begin
assign result_unqual = $signed(dataa) * $signed(datab);
@ -27,7 +27,7 @@ module VX_multiplier #(
if (LATENCY == 0) begin
assign result = result_unqual;
end else begin
reg [WIDTHP-1:0] result_pipe [LATENCY-1:0];
reg [R_WIDTH-1:0] result_pipe [LATENCY-1:0];
always @(posedge clk) begin
if (enable) begin
result_pipe[0] <= result_unqual;

View file

@ -18,7 +18,8 @@ module VX_raster_csr #(
);
`UNUSED_VAR (reset)
localparam NW_WIDTH = `UP(`NW_BITS);
localparam NW_WIDTH = `UP(`NW_BITS);
localparam NUM_CSRS_BITS = `CLOG2(`CSR_RASTER_COUNT);
raster_csrs_t [`NUM_THREADS-1:0] wdata;
raster_csrs_t [`NUM_THREADS-1:0] rdata;
@ -43,12 +44,12 @@ module VX_raster_csr #(
end
// CSRs write
assign wren = {`NUM_THREADS{write_enable}} & write_tmask;
assign waddr = write_wid;
for (genvar i = 0; i < `NUM_THREADS; ++i) begin
assign wdata[i].pos_mask = {write_data[i].pos_y, write_data[i].pos_x, write_data[i].mask};
assign wren[i] = write_enable && write_tmask[i];
assign wdata[i].pos_mask = {write_data[i].pos_y, write_data[i].pos_x, write_data[i].mask};
assign wdata[i].bcoords = write_data[i].bcoords;
end
@ -56,9 +57,11 @@ module VX_raster_csr #(
assign raddr = raster_csr_if.read_wid;
wire [NUM_CSRS_BITS-1:0] csr_addr = raster_csr_if.read_addr[NUM_CSRS_BITS-1:0];
for (genvar i = 0; i < `NUM_THREADS; ++i) begin
wire [`CSR_RASTER_COUNT-1:0][31:0] read_data = rdata[i];
assign raster_csr_if.read_data[i] = read_data[raster_csr_if.read_addr[`CLOG2(`CSR_RASTER_COUNT)-1:0]];
wire [`CSR_RASTER_COUNT-1:0][31:0] indexable_rdata = rdata[i];
assign raster_csr_if.read_data[i] = indexable_rdata[csr_addr];
end
`UNUSED_VAR (write_uuid)

View file

@ -2,7 +2,7 @@
`include "VX_raster_define.vh"
module VX_raster_edge_function #(
module VX_raster_edge #(
parameter LATENCY = 3
) (
input wire clk,
@ -29,9 +29,9 @@ module VX_raster_edge_function #(
for (genvar i = 0; i < 3; ++i) begin
VX_multiplier #(
.WIDTHA (`RASTER_DATA_BITS),
.WIDTHB (`RASTER_DIM_BITS),
.WIDTHP (PROD_WIDTH),
.A_WIDTH (`RASTER_DATA_BITS),
.B_WIDTH (`RASTER_DIM_BITS),
.R_WIDTH (PROD_WIDTH),
.SIGNED (1),
.LATENCY (`LATENCY_IMUL)
) x_multiplier (
@ -43,9 +43,9 @@ module VX_raster_edge_function #(
);
VX_multiplier #(
.WIDTHA (`RASTER_DATA_BITS),
.WIDTHB (`RASTER_DIM_BITS),
.WIDTHP (PROD_WIDTH),
.A_WIDTH (`RASTER_DATA_BITS),
.B_WIDTH (`RASTER_DIM_BITS),
.R_WIDTH (PROD_WIDTH),
.SIGNED (1),
.LATENCY (`LATENCY_IMUL)
) y_multiplier (

View file

@ -7,8 +7,8 @@ module VX_raster_extents #(
output wire [2:0][`RASTER_DATA_BITS-1:0] extents
);
for (genvar i = 0; i < 3; ++i) begin
assign extents[i] = (~edges[i][0][`RASTER_DATA_BITS-1] ? (edges[i][0] << TILE_LOGSIZE) : `RASTER_DATA_BITS'(0))
+ (~edges[i][1][`RASTER_DATA_BITS-1] ? (edges[i][1] << TILE_LOGSIZE) : `RASTER_DATA_BITS'(0));
assign extents[i] = ({`RASTER_DATA_BITS{~edges[i][0][`RASTER_DATA_BITS-1]}} & (edges[i][0] << TILE_LOGSIZE))
+ ({`RASTER_DATA_BITS{~edges[i][1][`RASTER_DATA_BITS-1]}} & (edges[i][1] << TILE_LOGSIZE));
end
endmodule

View file

@ -296,9 +296,9 @@ module VX_raster_mem #(
wire [`RASTER_DATA_BITS-1:0] prim_mem_offset;
VX_multiplier #(
.WIDTHA (`RASTER_DATA_BITS),
.WIDTHB (`RASTER_STRIDE_BITS),
.WIDTHP (`RASTER_DATA_BITS),
.A_WIDTH (`RASTER_DATA_BITS),
.B_WIDTH (`RASTER_STRIDE_BITS),
.R_WIDTH (`RASTER_DATA_BITS),
.SIGNED (0),
.LATENCY (`LATENCY_IMUL)
) multiplier (

View file

@ -110,9 +110,9 @@ module VX_raster_unit #(
.extents (mem_extents)
);
VX_raster_edge_function #(
VX_raster_edge #(
.LATENCY (EDGE_FUNC_LATENCY)
) raster_edge_function (
) raster_edge (
.clk (clk),
.reset (reset),
.enable (~edge_func_stall),

View file

@ -2,9 +2,9 @@
`define MULT8(clk, en, dst, src1, src2) \
VX_multiplier #( \
.WIDTHA (8), \
.WIDTHB (8), \
.WIDTHP (16), \
.A_WIDTH (8), \
.B_WIDTH (8), \
.R_WIDTH (16), \
.LATENCY (`LATENCY_IMUL) \
) __``dst ( \
.clk (clk), \

View file

@ -75,9 +75,9 @@ module VX_rop_mem #(
wire [31:0] m_y_pitch, baddr_s;
VX_multiplier #(
.WIDTHA (`ROP_DIM_BITS),
.WIDTHB (`ROP_PITCH_BITS),
.WIDTHP (32),
.A_WIDTH (`ROP_DIM_BITS),
.B_WIDTH (`ROP_PITCH_BITS),
.R_WIDTH (32),
.LATENCY (`LATENCY_IMUL)
) multiplier (
.clk (clk),
@ -114,9 +114,9 @@ module VX_rop_mem #(
wire [31:0] m_y_pitch, baddr_s;
VX_multiplier #(
.WIDTHA (`ROP_DIM_BITS),
.WIDTHB (`ROP_PITCH_BITS),
.WIDTHP (32),
.A_WIDTH (`ROP_DIM_BITS),
.B_WIDTH (`ROP_PITCH_BITS),
.R_WIDTH (32),
.LATENCY (`LATENCY_IMUL)
) multiplier (
.clk (clk),

View file

@ -45,7 +45,10 @@ RTL_INCLUDE = -I$(RTL_DIR) -I$(RTL_DIR)/libs -I$(RTL_DIR)/interfaces -I$(RTL_DIR
RTL_INCLUDE += $(FPU_INCLUDE) $(TEX_INCLUDE) $(RASTER_INCLUDE) $(ROP_INCLUDE)
#CONFIGS += -DEXT_GFX_ENABLE
CONFIGS += -DNUM_WARPS=2 -DNUM_THREADS=2 -DEXT_F_DISABLE
#CONFIGS += -DNUM_WARPS=2 -DNUM_THREADS=2 -DEXT_F_DISABLE -DL1_DISABLE
#CONFIGS += -DNUM_WARPS=2 -DNUM_THREADS=2 -DEXT_F_DISABLE
#CONFIGS += -DNUM_WARPS=2 -DNUM_THREADS=2
#CONFIGS += -DNUM_CORES=4
CONFIGS += -DSYNTHESIS -DVIVADO
@ -69,7 +72,7 @@ JOBS := $(shell expr $(NCPUS) - 1)
VPP_FLAGS += --link --target $(TARGET) --platform $(PLATFORM) --save-temps --no_ip_cache
VPP_FLAGS += --vivado.synth.jobs $(JOBS) --vivado.impl.jobs $(JOBS)
VPP_FLAGS += --connectivity.sp vortex_afu_1.m_axi_mem:HBM[0:15]
VPP_FLAGS += --report estimate
VPP_FLAGS += --report 2
VPP_FLAGS += --config ../vitis.ini
# Enable perf counters
@ -121,8 +124,10 @@ emconfig: $(BIN_DIR)/emconfig.json
$(BIN_DIR)/emconfig.json:
mkdir -p $(BIN_DIR); cd $(BUILD_DIR); emconfigutil --platform $(PLATFORM) --od ../$(BIN_DIR)
chipscope:
hw_server:
debug_hw --xvc_pcie /dev/xfpga/xvc_pub.u2305.0 --hw_server &
chipscope:
debug_hw --vivado --host localhost --ltx_file $(BUILD_DIR)/_x/link/vivado/vpl/prj/prj.runs/impl_1/debug_nets.ltx &
clean:

View file

@ -114,10 +114,10 @@ static int get_bank_info(uint64_t dev_addr, uint32_t* pIdx, uint32_t* pOff) {
return 0;
}
static void wait_for_enter(const std::string &msg) {
/*static void wait_for_enter(const std::string &msg) {
std::cout << msg << std::endl;
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
}*/
///////////////////////////////////////////////////////////////////////////////
@ -621,7 +621,7 @@ extern int vx_start(vx_device_h hdevice) {
auto device = (vx_device*)hdevice;
wait_for_enter("\nPress ENTER to continue after setting up ILA trigger...");
//wait_for_enter("\nPress ENTER to continue after setting up ILA trigger...");
#ifdef CPP_API