Implements (mostly untested) rv64i)

This commit is contained in:
2025-11-12 18:02:14 +01:00
parent 8ac17f20fe
commit 7bb8b993ae
8 changed files with 158 additions and 18 deletions

View File

@@ -15,11 +15,18 @@ object OpLoad {
// Meaning of Funct3 in the context of an OpLoad instruction
object Funct3 extends ChiselEnum {
// Zero extend
val LB = "b000".U
val LH = "b001".U
val LW = "b010".U
// Sign extend
val LBU = "b100".U
val LHU = "b101".U
val LWU = "b110".U
// Arch width
val LD = "b011".U
}
io.optype := OpType.I
@@ -55,6 +62,16 @@ object OpLoad {
is(Funct3.LW) {
io.memory_size := DMemSize.Word
}
is(Funct3.LWU) {
io.memory_size := DMemSize.Word
io.memory_sign_extend := true.B;
}
// Long load
is(Funct3.LD) {
io.memory_size := DMemSize.Long
io.memory_sign_extend := true.B;
}
}
}