Skip to content

Commit

Permalink
[rtl] fix timeout of vcpop.v, build a seperate computing unit in zvbb…
Browse files Browse the repository at this point in the history
… for vcpop.v
  • Loading branch information
Lucas-Wye committed Sep 6, 2024
1 parent 6d2b0d4 commit b0a726f
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 13 deletions.
5 changes: 4 additions & 1 deletion t1/src/LaneZvbb.scala
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ class LaneZvbb(val parameter: LaneZvbbParam) extends VFUModule(parameter) with S

val zvbbANDN = zvbbSrc & (~zvbbRs)

val zvbbPOP = PopCount(zvbbRs)

response.data := Mux1H(
UIntToOH(request.opcode),
Seq(
Expand All @@ -188,7 +190,8 @@ class LaneZvbb(val parameter: LaneZvbbParam) extends VFUModule(parameter) with S
zvbbROL,
zvbbROR,
zvbbSLL,
zvbbANDN
zvbbANDN,
zvbbPOP,
)
)
}
1 change: 1 addition & 0 deletions t1/src/decoder/Decoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ object Decoder {
case _: zvbbUop6.type => BitPat("b0110") // ror
case _: zvbbUop7.type => BitPat("b0111") // wsll
case _: zvbbUop8.type => BitPat("b1000") // andn
case _: zvbbUop9.type => BitPat("b1001") // pop
case _ => BitPat.dontCare(4)
}
case _ => BitPat.dontCare(4)
Expand Down
1 change: 0 additions & 1 deletion t1/src/decoder/attribute/isPopcount.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ object isPopcount {
def y(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched = Seq(
"vcpop.m",
"vcpop.v"
)
allMatched.contains(t1DecodePattern.instruction.name)
}
Expand Down
1 change: 1 addition & 0 deletions t1/src/decoder/attribute/isUnsigned0.scala
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ object isUnsigned0 {
"vrev8.v",
"vclz.v",
"vctz.v",
"vcpop.v",
"vrol.vv",
"vrol.vx",
"vror.vv",
Expand Down
1 change: 1 addition & 0 deletions t1/src/decoder/attribute/isUnsigned1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ object isUnsigned1 {
"vrev8.v",
"vclz.v",
"vctz.v",
"vcpop.v",
"vrol.vv",
"vrol.vx",
"vror.vv",
Expand Down
1 change: 1 addition & 0 deletions t1/src/decoder/attribute/isZvbb.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ object isZvbb {
"vrev8.v",
"vclz.v",
"vctz.v",
"vcpop.v",
"vrol.vv",
"vrol.vx",
"vror.vv",
Expand Down
30 changes: 19 additions & 11 deletions t1/src/decoder/attribute/zvbbUop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ object zvbbUop5 extends ZvbbUOPType // rol
object zvbbUop6 extends ZvbbUOPType // ror
object zvbbUop7 extends ZvbbUOPType // wsll
object zvbbUop8 extends ZvbbUOPType // andn
object zvbbUop9 extends ZvbbUOPType // pop

object ZvbbUOP {
def apply(t1DecodePattern: T1DecodePattern): Uop = {
def apply(t1DecodePattern: T1DecodePattern): Uop = {
Seq(
t0 _ -> zvbbUop0,
t1 _ -> zvbbUop1,
Expand All @@ -27,69 +28,76 @@ object ZvbbUOP {
t5 _ -> zvbbUop5,
t6 _ -> zvbbUop6,
t7 _ -> zvbbUop7,
t8 _ -> zvbbUop8
t8 _ -> zvbbUop8,
t9 _ -> zvbbUop9
).collectFirst {
case (fn, tpe) if fn(t1DecodePattern) => tpe
}.getOrElse(UopDC)
}
def t0(t1DecodePattern: T1DecodePattern): Boolean = {
def t0(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched: Seq[String] = Seq(
"vbrev.v"
)
allMatched.contains(t1DecodePattern.instruction.name)
}
def t1(t1DecodePattern: T1DecodePattern): Boolean = {
def t1(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched: Seq[String] = Seq(
"vbrev8.v"
)
allMatched.contains(t1DecodePattern.instruction.name)
}
def t2(t1DecodePattern: T1DecodePattern): Boolean = {
def t2(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched: Seq[String] = Seq(
"vrev8.v"
)
allMatched.contains(t1DecodePattern.instruction.name)
}
def t3(t1DecodePattern: T1DecodePattern): Boolean = {
def t3(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched: Seq[String] = Seq(
"vclz.v"
)
allMatched.contains(t1DecodePattern.instruction.name)
}
def t4(t1DecodePattern: T1DecodePattern): Boolean = {
def t4(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched: Seq[String] = Seq(
"vctz.v"
)
allMatched.contains(t1DecodePattern.instruction.name)
}
def t5(t1DecodePattern: T1DecodePattern): Boolean = {
def t5(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched: Seq[String] = Seq(
"vrol.vv",
"vrol.vx"
)
allMatched.contains(t1DecodePattern.instruction.name)
}
def t6(t1DecodePattern: T1DecodePattern): Boolean = {
def t6(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched: Seq[String] = Seq(
"vror.vv",
"vror.vx",
"vror.vi"
)
allMatched.contains(t1DecodePattern.instruction.name)
}
def t7(t1DecodePattern: T1DecodePattern): Boolean = {
def t7(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched: Seq[String] = Seq(
"vwsll.vv",
"vwsll.vx",
"vwsll.vi"
)
allMatched.contains(t1DecodePattern.instruction.name)
}
def t8(t1DecodePattern: T1DecodePattern): Boolean = {
def t8(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched: Seq[String] = Seq(
"vandn.vv",
"vandn.vx"
)
allMatched.contains(t1DecodePattern.instruction.name)
}
def t9(t1DecodePattern: T1DecodePattern): Boolean = {
val allMatched: Seq[String] = Seq(
"vcpop.v",
)
allMatched.contains(t1DecodePattern.instruction.name)
}
}

0 comments on commit b0a726f

Please sign in to comment.