Skip to content

Commit 944b0fb

Browse files
committed
switch to decoder, recode InstructionType uop to OneHot, improve dispatch timing by removing useless Mux.
1 parent 3c604c0 commit 944b0fb

File tree

2 files changed

+102
-99
lines changed

2 files changed

+102
-99
lines changed

src/main/scala/Constants.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package chiselv
22

3+
import chisel3._
34
import chisel3.experimental.ChiselEnum
45

56
object Instruction extends ChiselEnum {
@@ -21,5 +22,12 @@ object Instruction extends ChiselEnum {
2122
}
2223

2324
object InstructionType extends ChiselEnum {
24-
val IN_ERR, INST_R, INST_I, INST_S, INST_B, INST_U, INST_J, INST_Z = Value
25+
val INST_I = Value((1 << 0).U)
26+
val INST_S = Value((1 << 1).U)
27+
val INST_B = Value((1 << 2).U)
28+
val INST_U = Value((1 << 3).U)
29+
val INST_J = Value((1 << 4).U)
30+
val INST_Z = Value((1 << 5).U)
31+
val INST_R = Value((1 << 6).U)
32+
val IN_ERR = Value((1 << 7).U)
2533
}

0 commit comments

Comments
 (0)