Skip to content
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

[BUG] B extension: incorrect decoding for some instructions in RV32 #2280

Open
1 task done
ASintzoff opened this issue Jun 20, 2024 · 2 comments
Open
1 task done

[BUG] B extension: incorrect decoding for some instructions in RV32 #2280

ASintzoff opened this issue Jun 20, 2024 · 2 comments
Assignees
Labels
Component:RTL For issues in the RTL (e.g. for files in the rtl directory) CV32A65X Part: Embedded configuration Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system

Comments

@ASintzoff
Copy link
Contributor

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

According to RISC-V ISA specification, for RV32, the bit 25 of instructions BCLRI, BINVI, BSETI, BEXTI and RORI must be equal to zero.
So when this bit is set, an illegal instruction exception has to be raised.

With the current implementation, when bit 25 is set, there is no exception for RV32.

end else if (instr.instr[31:26] == 6'b010010) instruction_o.op = ariane_pkg::BCLRI;
                else if (instr.instr[31:26] == 6'b011010) instruction_o.op = ariane_pkg::BINVI;
                else if (instr.instr[31:26] == 6'b001010) instruction_o.op = ariane_pkg::BSETI;
                else illegal_instr_bm = 1'b1;
  else if (instr.instr[31:26] == 6'b010_010) instruction_o.op = ariane_pkg::BEXTI;
                else if (instr.instr[31:26] == 6'b011_000) instruction_o.op = ariane_pkg::RORI;
                else illegal_instr_bm = 1'b1;           
@ASintzoff ASintzoff added Component:RTL For issues in the RTL (e.g. for files in the rtl directory) Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system CV32A65X Part: Embedded configuration labels Jun 20, 2024
@JeanRochCoulon
Copy link
Contributor

JeanRochCoulon commented Jun 20, 2024

I agree with the Github issue, but which specification tells us that an exception is raised when bit25 is equal to zero ?

@AyoubJalali
Copy link
Contributor

I agree with the Github issue, but which specification tells us that an exception is raised when bit25 is equal to zero ?

if the 25th bit isn't equal to zero these instruction are treated as RV64 instruction base on the RISCV bitmanip spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:RTL For issues in the RTL (e.g. for files in the rtl directory) CV32A65X Part: Embedded configuration Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Projects
None yet
Development

No branches or pull requests

3 participants