Skip to content

Commit

Permalink
fix opcode passing from CPU to ALU (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: Dian Zhou <zhoudian64>
  • Loading branch information
zhoudian64 committed Mar 23, 2021
1 parent 26b97bc commit f477bd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/CPU.scala
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ class CPU extends Module {
regFile.io.writeEnable := true.B
alu.io.A := regFile.io.outputA
alu.io.B := immGen.io.result.asUInt()
alu.io.op := Cat(0.U(1), instruction(14, 12))
alu.io.op := Cat(instruction(30), instruction(14, 12))
regFile.io.input := alu.io.result
}
is(CALCULATE_REG) {
regFile.io.writeEnable := true.B
alu.io.A := regFile.io.outputA
alu.io.B := regFile.io.outputB
alu.io.op := Cat(0.U(1), instruction(14, 12))
alu.io.op := Cat(instruction(30), instruction(14, 12))
regFile.io.input := alu.io.result
}
is(FENCE) {
Expand Down

0 comments on commit f477bd4

Please sign in to comment.