Add RV64I I-Type Instruction (Shift Variation)

This commit is contained in:
Donald Sebastian Leung 2020-08-27 13:28:29 +08:00
parent a15e57e12e
commit 2790cb1f4c
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
from .insn_rv64i_i_type import *
"""
RV64I I-Type Instruction (Shift Variation)
"""
class InsnRV64IITypeShift(InsnRV64IIType):
def __init__(self, params, funct6, funct3):
super().__init__(params)
self.funct6 = funct6
self.funct3 = funct3
def elaborate(self, platform):
m = super().elaborate(platform)
m.d.comb += self.spec_valid.eq(self.rvfi_valid & (~self.insn_padding) & (self.insn_funct6 == self.funct6) & (self.insn_funct3 == self.funct3) & (self.insn_opcode == 0b0011011) & ~self.insn_shamt[5])
m.d.comb += self.spec_rs1_addr.eq(self.insn_rs1)
m.d.comb += self.spec_rd_addr.eq(self.insn_rd)
m.d.comb += self.spec_pc_wdata.eq(self.rvfi_pc_rdata + 4)
return m