Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
fpnew: Fix tool issues with reduced simulation visibility (#412)
Browse files Browse the repository at this point in the history
* fpnew fix modelsim issue with reduced visibility

* fpnew: add patch

* fpnew: add patch_dir
  • Loading branch information
lucabertaccini authored May 12, 2022
1 parent 86ed94a commit 1520bbb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 62c12c42d1d9865c21ba5492d51ebd79641a43db Mon Sep 17 00:00:00 2001
From: Luca Bertaccini <[email protected]>
Date: Thu, 12 May 2022 18:41:10 +0200
Subject: [PATCH] fpnew fix modelsim issue with reduced visibility

---
src/fpnew_opgroup_multifmt_slice.sv | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/fpnew_opgroup_multifmt_slice.sv b/src/fpnew_opgroup_multifmt_slice.sv
index 2f31f50..2245b39 100644
--- a/src/fpnew_opgroup_multifmt_slice.sv
+++ b/src/fpnew_opgroup_multifmt_slice.sv
@@ -342,7 +342,7 @@ module fpnew_opgroup_multifmt_slice #(
assign lane_out_valid[lane] = out_valid & ((lane == 0) | result_is_vector);

// Properly NaN-box or sign-extend the slice result if not in use
- assign local_result = lane_out_valid[lane] ? op_result : '{default: lane_ext_bit[0]};
+ assign local_result = lane_out_valid[lane] ? op_result : {(LANE_WIDTH){lane_ext_bit[0]}};
assign lane_status[lane] = lane_out_valid[lane] ? op_status : '0;

// Otherwise generate constant sign-extension
@@ -352,7 +352,7 @@ module fpnew_opgroup_multifmt_slice #(
assign lane_aux[lane] = 1'b0; // unused lane
assign lane_tags[lane] = 1'b0; // unused lane
assign lane_ext_bit[lane] = 1'b1; // NaN-box unused lane
- assign local_result = '{default: lane_ext_bit[0]}; // sign-extend/nan box
+ assign local_result = {(LANE_WIDTH){lane_ext_bit[0]}}; // sign-extend/nan box
assign lane_status[lane] = '0;
assign lane_busy[lane] = 1'b0;
end
--
2.16.5

2 changes: 2 additions & 0 deletions hw/vendor/pulp_platform_fpnew.vendor.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
rev: "feature/expanding_dotp",
},

patch_dir: "patches/pulp_platform_fpnew",

exclude_from_upstream: [
"src/common_cells",
"src/fpu_div_sqrt_mvp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ module fpnew_opgroup_multifmt_slice #(
assign lane_out_valid[lane] = out_valid & ((lane == 0) | result_is_vector);

// Properly NaN-box or sign-extend the slice result if not in use
assign local_result = lane_out_valid[lane] ? op_result : '{default: lane_ext_bit[0]};
assign local_result = lane_out_valid[lane] ? op_result : {(LANE_WIDTH){lane_ext_bit[0]}};
assign lane_status[lane] = lane_out_valid[lane] ? op_status : '0;

// Otherwise generate constant sign-extension
Expand All @@ -352,7 +352,7 @@ module fpnew_opgroup_multifmt_slice #(
assign lane_aux[lane] = 1'b0; // unused lane
assign lane_tags[lane] = 1'b0; // unused lane
assign lane_ext_bit[lane] = 1'b1; // NaN-box unused lane
assign local_result = '{default: lane_ext_bit[0]}; // sign-extend/nan box
assign local_result = {(LANE_WIDTH){lane_ext_bit[0]}}; // sign-extend/nan box
assign lane_status[lane] = '0;
assign lane_busy[lane] = 1'b0;
end
Expand Down

0 comments on commit 1520bbb

Please sign in to comment.