Restructure insns directory contents #2

Merged
dsleung merged 109 commits from restructuring into master 2020-08-13 15:20:35 +08:00
1 changed files with 18 additions and 0 deletions
Showing only changes of commit 504d6e1984 - Show all commits

18
insns/InsnBltu.py Normal file
View File

@ -0,0 +1,18 @@
from InsnRV32ISBType import *
"""
BLTU instruction
"""
class InsnBltu(InsnRV32ISBType):
def __init__(self, RISCV_FORMAL_ILEN, RISCV_FORMAL_XLEN, RISCV_FORMAL_CSR_MISA, RISCV_FORMAL_COMPRESSED):
super().__init__(RISCV_FORMAL_ILEN, RISCV_FORMAL_XLEN, RISCV_FORMAL_CSR_MISA, RISCV_FORMAL_COMPRESSED, 0b110)
def elaborate(self, platform):
m = super().elaborate(platform)
next_pc = Signal(self.RISCV_FORMAL_XLEN)
m.d.comb += next_pc.eq(Mux(self.rvfi_rs1_rdata < self.rvfi_rs2_rdata, self.rvfi_pc_rdata + self.insn_imm, self.rvfi_pc_rdata + 4))
m.d.comb += self.spec_pc_wdata.eq(next_pc)
m.d.comb += self.spec_trap.eq(Mux(self.ialign16, next_pc[0] != 0, next_pc[:2] != 0) | ~self.misa_ok)
return m