-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed todo's related to mul_en/div_en i EX stage #902
Merged
Silabs-ArjanB
merged 7 commits into
openhwgroup:master
from
silabs-oysteink:silabs-oysteink-div-mul-todo
Aug 25, 2023
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
10115bd
Removed halt_ex and kill_ex from mul_en_gated and div_en_gated in the…
silabs-oysteink d08568d
Updates after review.
silabs-oysteink 3a9f78b
Comment update.
silabs-oysteink 4287cc3
Update cv32e40x_ex_stage.sv
Silabs-ArjanB 14e25f7
Revert to original case statement and factoring in !valid/kill/halt a…
silabs-oysteink 6e0214e
Merge branch 'silabs-oysteink-div-mul-todo' of github.com:silabs-oyst…
silabs-oysteink ec7f6e7
Review fixes.
silabs-oysteink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,9 @@ module cv32e40x_mult import cv32e40x_pkg::*; | |
|
||
output logic [31:0] result_o, | ||
|
||
input logic halt_i, | ||
input logic kill_i, | ||
|
||
output logic ready_o, | ||
output logic valid_o, | ||
input logic ready_i | ||
|
@@ -114,8 +117,9 @@ module cv32e40x_mult import cv32e40x_pkg::*; | |
valid_o = 1'b0; | ||
mulh_acc_next = mulh_acc; | ||
|
||
// Case statement assumes valid_i = 1; the valid_i = 0 scenario | ||
// is handled after the case statement. | ||
// Case statement assumes valid_i = 1, halt_i = 0 and kill_i = 0. | ||
// the valid_i = 0 / halt_i = 1 / kill_i = 1 scenarios | ||
// are handled after the case statement. | ||
case (mulh_state) | ||
MUL_ALBL: begin | ||
if (operator_i == MUL_H) begin | ||
|
@@ -129,7 +133,7 @@ module cv32e40x_mult import cv32e40x_pkg::*; | |
valid_o = 1'b1; | ||
|
||
if (ready_i) begin | ||
ready_o = 1'b1; | ||
ready_o = 1'b1; | ||
end | ||
end | ||
end | ||
|
@@ -164,11 +168,24 @@ module cv32e40x_mult import cv32e40x_pkg::*; | |
endcase | ||
|
||
// Allow kill at any time | ||
if (!valid_i) begin | ||
if (!valid_i || kill_i) begin | ||
mulh_state_next = MUL_ALBL; | ||
ready_o = 1'b1; | ||
valid_o = 1'b0; | ||
mulh_acc_next = '0; | ||
valid_o = 1'b0; | ||
ready_o = 1'b1; | ||
mulh_acc_next = '0; | ||
mulh_shift = 1'b0; | ||
mulh_a = mulh_al; | ||
mulh_b = mulh_bl; | ||
end else begin | ||
if (halt_i) begin | ||
mulh_state_next = mulh_state; | ||
valid_o = 1'b0; | ||
ready_o = 1'b0; | ||
mulh_acc_next = mulh_acc; | ||
mulh_shift = 1'b0; | ||
mulh_a = mulh_al; | ||
mulh_b = mulh_bl; | ||
end | ||
end | ||
end // always_comb | ||
|
||
|
@@ -177,8 +194,11 @@ module cv32e40x_mult import cv32e40x_pkg::*; | |
mulh_acc <= '0; | ||
mulh_state <= MUL_ALBL; | ||
end else begin | ||
mulh_acc <= mulh_acc_next; | ||
mulh_state <= mulh_state_next; | ||
// Update flops on valid input or when killed. No updates while halted. | ||
if ((valid_i && !halt_i) || kill_i) begin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Above mulh_state_next is changed also for !valid, but here that scenario is not handled There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed, SEC clean. |
||
mulh_acc <= mulh_acc_next; | ||
mulh_state <= mulh_state_next; | ||
end | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remark as for multiplier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, SEC clean.