From 6cff1038bed55e6f250f0fef07c28039f0d78e7b Mon Sep 17 00:00:00 2001
From: Donald Sebastian Leung
Date: Thu, 30 Jul 2020 16:12:10 +0800
Subject: [PATCH] Fix AUIPC instruction
---
insns/insn_auipc.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/insns/insn_auipc.py b/insns/insn_auipc.py
index 905eab8..425a7db 100644
--- a/insns/insn_auipc.py
+++ b/insns/insn_auipc.py
@@ -8,10 +8,19 @@ class rvfi_insn_auipc(rvfi_insn_U_type):
def elaborate(self, platform):
m = super(rvfi_insn_auipc, self).elaborate(platform)
- # LUI instruction
+ # AUIPC instruction
m.d.comb += self.spec_valid.eq(self.rvfi_valid & (~self.insn_padding) & (self.insn_opcode == 0b0010111))
m.d.comb += self.spec_rd_addr.eq(self.insn_rd)
m.d.comb += self.spec_rd_wdata.eq(Mux(self.spec_rd_addr, self.rvfi_pc_rdata + self.insn_imm, 0))
m.d.comb += self.spec_pc_wdata.eq(self.rvfi_pc_rdata + 4)
+ # default assignments
+ m.d.comb += self.spec_rs1_addr.eq(0)
+ m.d.comb += self.spec_rs2_addr.eq(0)
+ m.d.comb += self.spec_trap.eq(~self.misa_ok)
+ m.d.comb += self.spec_mem_addr.eq(0)
+ m.d.comb += self.spec_mem_rmask.eq(0)
+ m.d.comb += self.spec_mem_wmask.eq(0)
+ m.d.comb += self.spec_mem_wdata.eq(0)
+
return m