Commit a73e0b84 authored by Henrik Fegran's avatar Henrik Fegran Committed by udinator
Browse files

Fixed wrong length of I, S, B-type immediates causing wrong sign extension for certain instructions

parent 391ce418
......@@ -147,7 +147,7 @@ class riscv_cov_instr:
if self.imm_type.name == "UIMM":
self.imm_len = 5
else:
self.imm_len = 11
self.imm_len = 12
def set_mode(self):
# mode setting for Instruction Format
......
......@@ -316,7 +316,7 @@ class riscv_instr:
if self.imm_type.name == "UIMM":
self.imm_len = 5
else:
self.imm_len = 11
self.imm_len = 12
self.imm_mask = (self.imm_mask << self.imm_len) & self.shift_t
def extend_imm(self):
......
......@@ -344,7 +344,7 @@ class riscv_instr extends uvm_object;
if(imm_type == UIMM) begin
imm_len = 5;
end else begin
imm_len = 11;
imm_len = 12;
end
end
imm_mask = imm_mask << imm_len;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment