20 lines
636 B
Python
20 lines
636 B
Python
from .insn_rv32i_sb_type import *
|
|
|
|
"""
|
|
BGE instruction
|
|
"""
|
|
|
|
class InsnBge(InsnRV32ISBType):
|
|
def __init__(self, params):
|
|
super().__init__(params, 0b101)
|
|
|
|
def elaborate(self, platform):
|
|
m = super().elaborate(platform)
|
|
|
|
next_pc = Signal(self.params.xlen)
|
|
m.d.comb += next_pc.eq(Mux(Value.as_signed(self.rvfi_rs1_rdata) >= Value.as_signed(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
|