-
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
Implemented all C0 instructions from Zc v 0.70.1. #528
Implemented all C0 instructions from Zc v 0.70.1. #528
Conversation
SEC clean when ZC_EXT=0. Signed-off-by: Oystein Knauserud <[email protected]>
Signed-off-by: Oystein Knauserud <[email protected]>
Signed-off-by: Oystein Knauserud <[email protected]>
3'b001: begin | ||
if (ZC_EXT) begin | ||
if (instr[12]) begin | ||
// cm.lh -> lh rd', imm(rs1') |
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.
cm.lh has some codes designated for custom use. These need to set illegal_instr_o = 1'b1
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
if (ZC_EXT) begin | ||
unique case (instr[12:10]) | ||
3'b000: begin | ||
// c.lbu -> lbu rd', imm(rs1') |
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.
Not all cm.lbu codes are legal.
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.
Agreed, but for this specific line (c.lbu vs cm.lbu) there is no illegal encodings. Fixing for the actual cm.lbu once that gets implemented
end | ||
3'b001: begin | ||
// c.lh -> lh rd', imm(rs1') | ||
// c.lhu -> lhu rd', imm(rs1') |
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.
cm.lhu has some codes designated for custom use. These need to set illegal_instr_o = 1'b1
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.
cm.lhu is not yet implemented (will be part of PR for C2 instructions. This line is for c.lhu, which does not seem to have any reserved encodings.
// cm.sh -> sh rs2', imm(rs1') | ||
instr_o.bus_resp.rdata = {7'b0, 2'b01, instr[4:2], 2'b01, instr[9:7], 3'b001, instr[11:10], instr[6:5], 1'b0, OPCODE_STORE}; | ||
end else begin | ||
// cm.sb -> sb rs2', imm(rs1') |
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.
cm.sb has some codes designated for custom use. These need to set illegal_instr_o = 1'b1
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
3'b101: begin | ||
if (ZC_EXT) begin | ||
if (instr[12]) begin | ||
// cm.sh -> sh rs2', imm(rs1') |
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.
cm.sh has some codes designated for custom use. These need to set illegal_instr_o = 1'b1
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
rtl/cv32e40x_compressed_decoder.sv
Outdated
@@ -25,6 +25,9 @@ | |||
//////////////////////////////////////////////////////////////////////////////// | |||
|
|||
module cv32e40x_compressed_decoder import cv32e40x_pkg::*; | |||
#( | |||
parameter bit ZC_EXT = 0 // todo: remove once fully implemented |
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.
You can remove the todo here and some levels up. We will in the end make it a localparam set within the core level.
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
- Marking cm.lh, cm.sh and cm.sb as illegal if encoding (of immediates) is reserved. - Removed todo for ZC_EXT parameter except at the very toplevel. Signed-off-by: Oystein Knauserud <[email protected]>
SEC clean when ZC_EXT=0.
Signed-off-by: Oystein Knauserud [email protected]