-
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
Changes from 4 commits
10115bd
d08568d
3a9f78b
4287cc3
14e25f7
6e0214e
ec7f6e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
|
@@ -115,7 +118,7 @@ module cv32e40x_mult import cv32e40x_pkg::*; | |
mulh_acc_next = mulh_acc; | ||
|
||
// Case statement assumes valid_i = 1; the valid_i = 0 scenario | ||
// is handled after the case statement. | ||
// is handled after the case statement. | ||
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. Remove comment (no longer accurate) 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. Removed comment. 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. Comment seems still there |
||
case (mulh_state) | ||
MUL_ALBL: begin | ||
if (operator_i == MUL_H) begin | ||
|
@@ -126,11 +129,8 @@ module cv32e40x_mult import cv32e40x_pkg::*; | |
end | ||
else begin | ||
// Single cycle multiplication | ||
valid_o = 1'b1; | ||
|
||
if (ready_i) begin | ||
ready_o = 1'b1; | ||
end | ||
valid_o = valid_i && !(halt_i || kill_i); | ||
ready_o = (ready_i && !halt_i) || kill_i; | ||
end | ||
end | ||
|
||
|
@@ -150,12 +150,12 @@ module cv32e40x_mult import cv32e40x_pkg::*; | |
end | ||
|
||
MUL_AHBH: begin | ||
valid_o = 1'b1; | ||
valid_o = valid_i && !(halt_i || kill_i); | ||
mulh_a = mulh_ah; | ||
mulh_b = mulh_bh; | ||
ready_o = (ready_i && !halt_i) || kill_i; | ||
|
||
if (ready_i) begin | ||
ready_o = 1'b1; | ||
mulh_state_next = MUL_ALBL; | ||
mulh_acc_next = '0; | ||
end | ||
|
@@ -164,7 +164,7 @@ 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; | ||
|
@@ -177,8 +177,10 @@ 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; | ||
if (!halt_i || kill_i) begin | ||
mulh_acc <= mulh_acc_next; | ||
mulh_state <= mulh_state_next; | ||
end | ||
end | ||
end | ||
|
||
|
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.
Now halt impacts ready_o but not next_state. I see that next-state is not used later on in that case, but it is just difficult to understand like this.
Maybe keep case statement as in original design and assume valid_i=1, halt_i=0, kill_i=0 within the case and deal with exceptions to that assumption after the case statement.
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.
Reverted to original case statement.