Add jal instruction

This commit is contained in:
2025-11-07 11:51:33 +01:00
parent c2c16d9672
commit cbf7ec9ad3
6 changed files with 90 additions and 41 deletions

View File

@@ -20,6 +20,14 @@ class ImmediateDecoder extends Module {
val imm_u = Cat(io.instruction(31, 12), 0.U(12.W));
val imm_i = Cat(Fill(20, io.instruction(31)), io.instruction(31, 20));
val imm_ir = io.instruction(24, 20);
val imm_j = Cat(
Fill(11, io.instruction(31)),
io.instruction(31),
io.instruction(19, 12),
io.instruction(20),
io.instruction(30, 21),
0.U
);
switch(io.op_type) {
is(OpType.U) {
@@ -31,5 +39,8 @@ class ImmediateDecoder extends Module {
is(OpType.IR) {
io.immediate := imm_ir
}
is(OpType.J) {
io.immediate := imm_j
}
}
}