ucb-bar / riscv-mini

Simple RISC-V 3-stage Pipeline in Chisel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does this code have a bug?

lengrongfu opened this issue · comments

in ALU.scala file:
define below:
val ALU_ADD = 0.U(4.W)
val ALU_SUB = 1.U(4.W)
io.sum := io.A + Mux(io.alu_op(0), -io.B, io.B)
in mux ,if io.alu_op(0) is 0 then alu_op is ALU_ADD then Mux(io.alu_op(0), io.B, -io.B) ?