Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion hw/rtl/fpu/VX_fpu_unit.sv
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ module VX_fpu_unit import VX_gpu_pkg::*, VX_fpu_pkg::*; #(
.valid_out (per_block_result_if[block_idx].valid),
.ready_out (per_block_result_if[block_idx].ready)
);
assign per_block_result_if[block_idx].data.wb = 1'b1;
// Avoid writeback to x0, which scoreboard does not reserve.
assign per_block_result_if[block_idx].data.wb =
fpu_rsp_rd != make_reg_num(REG_TYPE_I, RV_REGS_BITS'(0));
end

VX_gather_unit #(
Expand Down
4 changes: 3 additions & 1 deletion tests/kernel/conform/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ int main() {

errors += test_shfl();

errors += test_feq_x0_scoreboard();

if (0 == errors) {
PRINTF("Passed!\n");
} else {
PRINTF("Failed!\n");
}

return errors;
}
}
24 changes: 23 additions & 1 deletion tests/kernel/conform/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@ int __attribute__((noinline)) make_full_tmask(int num_threads) {

///////////////////////////////////////////////////////////////////////////////

void __attribute__((noinline)) do_feq_x0_scoreboard() {
asm volatile(
"fsgnj.s f24, f0, f0\n"
"fsgnj.s f1, f0, f0\n"
"feq.s x0, f24, f1\n"
:
:
: "memory");
}

int test_feq_x0_scoreboard() {
PRINTF("FEQ x0 Scoreboard Test\n");
int num_threads = std::min(vx_num_threads(), 4);
int tmask = make_full_tmask(num_threads);
vx_tmc(tmask);
do_feq_x0_scoreboard();
vx_tmc_one();
return 0;
}

///////////////////////////////////////////////////////////////////////////////

#define GLOBAL_MEM_SZ 8
int global_buffer[GLOBAL_MEM_SZ];

Expand Down Expand Up @@ -401,4 +423,4 @@ int test_shfl() {
do_shfl();
vx_tmc_one(); // back to thread0
return check_error(shfl_buffer, 0, num_threads);
}
}
2 changes: 2 additions & 0 deletions tests/kernel/conform/tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#define PRINTF vx_printf

int test_feq_x0_scoreboard();

int test_global_memory();

int test_local_memory();
Expand Down
Loading