Stage 6: implementation, untested

This commit is contained in:
2025-11-06 16:18:01 +01:00
parent 1462563e39
commit 2779471523
9 changed files with 180 additions and 32 deletions

View File

@@ -16,10 +16,11 @@ class ImmediateDecoder extends Module {
})
io.immediate := 0.U
// Decode imm-u
// Decode and construct immediates
val imm_u = Cat(io.instruction(31, 12), 0.U(12.W));
// Decode imm-i
val imm_i = Cat(Fill(20, io.instruction(31)), io.instruction(31, 20));
val imm_ir = io.instruction(24, 20);
switch(io.op_type) {
is(OpType.U) {
io.immediate := imm_u
@@ -27,5 +28,8 @@ class ImmediateDecoder extends Module {
is(OpType.I) {
io.immediate := imm_i
}
is(OpType.IR) {
io.immediate := imm_ir
}
}
}