Skip to content
Merged
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
12 changes: 6 additions & 6 deletions hw/rtl/fpu/VX_fpu_unit.sv
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ module VX_fpu_unit import VX_gpu_pkg::*, VX_fpu_pkg::*; #(

fpu_header_t fpu_hdr, fpu_hdr_wb, fpu_hdr_store;

// FPU always writes back, so header.wb is always 1 at dispatch.
// Carry the decoded wb through the tag store: FPU compares may target
// integer x0 (e.g. feq.s x0, ...), which decode does not reserve in the
// scoreboard, so forcing wb=1 on readback would trip the invalid
// writeback assertion.
always_comb begin
fpu_hdr_store = per_block_execute_if[block_idx].data.header;
fpu_hdr_store.wb = 1'b0;
fpu_hdr_store = per_block_execute_if[block_idx].data.header;
end

// Force wb=1 on the readback path.
always_comb begin
fpu_hdr_wb = fpu_hdr;
fpu_hdr_wb.wb = 1'b1;
fpu_hdr_wb = fpu_hdr;
end

wire [TAG_WIDTH-1:0] fpu_req_tag, fpu_rsp_tag;
Expand Down
2 changes: 2 additions & 0 deletions tests/kernel/conform/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ int main() {

errors += test_jalr();

errors += test_feq_x0_scoreboard();

if (0 == errors) {
PRINTF("Passed!\n");
} else {
Expand Down
22 changes: 22 additions & 0 deletions tests/kernel/conform/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,25 @@ int test_jalr() {
}
return 0;
}

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

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;
}
2 changes: 2 additions & 0 deletions tests/kernel/conform/tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ int test_qshfl();

int test_jalr();

int test_feq_x0_scoreboard();

#endif
Loading