From e97a86bfbec8c5af864750a55ef03106a2875d08 Mon Sep 17 00:00:00 2001
From: Donald Sebastian Leung
Date: Mon, 10 Aug 2020 13:32:04 +0800
Subject: [PATCH] Add (generic) RV32I I-Type Instruction
---
insns/InsnRV32IIType.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 insns/InsnRV32IIType.py
diff --git a/insns/InsnRV32IIType.py b/insns/InsnRV32IIType.py
new file mode 100644
index 0000000..89d3517
--- /dev/null
+++ b/insns/InsnRV32IIType.py
@@ -0,0 +1,13 @@
+from Insn import *
+
+"""
+RV32I I-Type Instruction
+"""
+
+class InsnRV32IIType(Insn):
+ def elaborate(self, platform):
+ m = super().elaborate(platform)
+
+ m.d.comb += self.insn_imm.eq(Value.as_signed(self.rvfi_insn[20:32]))
+
+ return m