Add working 4real.

This commit is contained in:
Sebastian Bugge 2024-09-27 04:47:26 +02:00
parent 44ccf12cad
commit 961ae49523
Signed by: kaholaz
GPG key ID: 2EFFEDEE03519691
4 changed files with 29 additions and 23 deletions

View file

@ -16,7 +16,16 @@ class Execute extends MultiIOModule {
)
val ALUOpsMap = Array (
ALUOps.ADD -> (io.op1 + io.op2)
ALUOps.ADD -> (io.op1 + io.op2),
ALUOps.SUB -> (io.op1 - io.op2),
ALUOps.AND -> (io.op1 & io.op2),
ALUOps.OR -> (io.op1 | io.op2),
ALUOps.XOR -> (io.op1 ^ io.op2),
ALUOps.SLT -> (io.op1 < io.op2).asSInt(),
ALUOps.SLTU -> (io.op1.asUInt() < io.op2.asUInt()).asSInt(),
ALUOps.SRA -> (io.op1 >> io.op2(4, 0)),
ALUOps.SRL -> (io.op1.asUInt() >> io.op2(4, 0)).asSInt(),
ALUOps.SLL -> (io.op1.asUInt() << io.op2(4, 0)).asSInt(),
)
io.ALUResult := MuxLookup(io.ALUOp, 0.S(32.W), ALUOpsMap)