Skip to content

Commit f477bd4

Browse files
authored
fix opcode passing from CPU to ALU (#31)
Co-authored-by: Dian Zhou <zhoudian64>
1 parent 26b97bc commit f477bd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/CPU.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ class CPU extends Module {
144144
regFile.io.writeEnable := true.B
145145
alu.io.A := regFile.io.outputA
146146
alu.io.B := immGen.io.result.asUInt()
147-
alu.io.op := Cat(0.U(1), instruction(14, 12))
147+
alu.io.op := Cat(instruction(30), instruction(14, 12))
148148
regFile.io.input := alu.io.result
149149
}
150150
is(CALCULATE_REG) {
151151
regFile.io.writeEnable := true.B
152152
alu.io.A := regFile.io.outputA
153153
alu.io.B := regFile.io.outputB
154-
alu.io.op := Cat(0.U(1), instruction(14, 12))
154+
alu.io.op := Cat(instruction(30), instruction(14, 12))
155155
regFile.io.input := alu.io.result
156156
}
157157
is(FENCE) {

0 commit comments

Comments
 (0)