Skip to content

Commit bf09c64

Browse files
committed
Something
1 parent 3ddbc0b commit bf09c64

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

chisel/src/main/scala/why/BoothMultiplier.scala

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class BoothMultiplier extends Module {
3838
t := 0.U
3939

4040
state := sBusy
41+
step := 0.U
4142

4243
out.bits := 0.U
4344
out.valid := false.B
@@ -53,23 +54,18 @@ class BoothMultiplier extends Module {
5354

5455
} .elsewhen (step === 1.U) {
5556

57+
t := p
58+
step := 2.U
59+
5660
switch (p(1, 0)) {
5761
is ("b01".U) {
5862
t := p + a
5963
}
6064
is ("b10".U) {
6165
t := p + s
6266
}
63-
is ("b00".U) {
64-
t := p
65-
}
66-
is ("b11".U) {
67-
t := p
68-
}
6967
}
7068

71-
step := 2.U
72-
7369
} .elsewhen (step === 2.U) {
7470

7571
p := t >> 1

chisel/src/main/scala/why/Bundles.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package why
22

33
import chisel3._
4+
import chisel3.util._
45

56
case class IDBundle() extends Bundle {
67
val opcode = UInt(12.W)
@@ -35,8 +36,7 @@ case class MemoryIO() extends Bundle {
3536
val writeIn = Flipped(Valid(UInt(64.W)))
3637
val readOut = Decoupled(UInt(64.W))
3738
val address = Input(UInt(64.W))
38-
/** 0 -> byte, 1 -> quarterword, 2 -> halfword, 3 -> word */
39-
val width = Input(UInt(2.W))
39+
val size = Input(UInt(2.W)) // 0 -> byte, 1 -> quarterword, 2 -> halfword, 3 -> word
4040
val busy = Output(Bool())
4141
}
4242

chisel/src/main/scala/why/ControlState.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object ControlState {
1414

1515
def count: Int = log2Ceil(all.size)
1616
def width = count.W
17-
def chiselType() = UInt(width)
17+
def chiselType = UInt(width)
1818
}
1919

2020
// case object sStartup0 extends ControlState(0)

chisel/src/main/scala/why/ControlUnit.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ControlUnit(memorySize: Int) extends Module {
1111
val instructionAddr = Input(UInt(64.W))
1212
val aluOut = Input(SInt(64.W))
1313
val decoded = Input(IDBundle())
14-
val state = Output(ControlState.chiselType())
14+
val state = Output(ControlState.chiselType)
1515
val mar = Output(UInt(64.W))
1616
val pcInput = Output(UInt(64.W)) // Written to the program counter whenever pcWrite is true
1717
val pcWrite = Output(Bool())

0 commit comments

Comments
 (0)