Skip to content

Commit

Permalink
add support for vwsll
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-Wye committed Jul 25, 2024
1 parent 5d3c08b commit 718f750
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
8 changes: 8 additions & 0 deletions t1/src/LaneZvbb.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class LaneZvbbRequest(datapathWidth: Int) extends VFUPipeBundle {

class LaneZvbbResponse(datapathWidth: Int) extends VFUPipeBundle {
val data = UInt(datapathWidth.W)
val source2 = UInt(datapathWidth.W)
}

@instantiable
Expand All @@ -47,6 +48,11 @@ class LaneZvbb(val parameter: LaneZvbbParam)
val zvbbCTZ = (PopCount(scanRightOr(zvbbBRev)) - 1.U).asUInt
val zvbbROL = zvbbSrc.rotateLeft(zvbbRs(4, 0)).asUInt
val zvbbROR = zvbbSrc.rotateRight(zvbbRs(4, 0)).asUInt

val zvbbSLL64 = (0.U((parameter.datapathWidth-1).W) ## zvbbSrc.zext).asUInt << zvbbRs(5, 0)
val zvbbSLL = zvbbSLL64(parameter.datapathWidth-1, 0)
val zvbbSLLMSB = zvbbSLL64(2*parameter.datapathWidth-1, parameter.datapathWidth)

response.data := Mux1H(UIntToOH(request.opcode), Seq(
zvbbBRev,
zvbbBRev8,
Expand All @@ -55,7 +61,9 @@ class LaneZvbb(val parameter: LaneZvbbParam)
zvbbCTZ,
zvbbROL,
zvbbROR,
zvbbSLL,
)
)
response.source2 = Mux(request.opcode == 7.U, zvbbSLLMSB, 0.U)
}

1 change: 1 addition & 0 deletions t1/src/decoder/Decoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ object Decoder {
case _: zvbbUop4.type => BitPat("b0100")
case _: zvbbUop5.type => BitPat("b0101")
case _: zvbbUop6.type => BitPat("b0110")
case _: zvbbUop7.type => BitPat("b0111")
case _ => BitPat.dontCare(4)
}
case _ => BitPat.dontCare(4)
Expand Down
4 changes: 0 additions & 4 deletions t1/src/decoder/attribute/isCrossread.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ object isCrossread {
"vwsub.wx",
"vwsubu.wv",
"vwsubu.wx",
// rv_zvbb
"vwsll.vv",
"vwsll.vx",
"vwsll.vi",
)
allMatched.contains(t1DecodePattern.instruction.name)
}
Expand Down
2 changes: 2 additions & 0 deletions t1/src/decoder/attribute/zvbbUop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ object zvbbUop3 extends ZvbbUOPType
object zvbbUop4 extends ZvbbUOPType
object zvbbUop5 extends ZvbbUOPType
object zvbbUop6 extends ZvbbUOPType
object zvbbUop7 extends ZvbbUOPType

object ZvbbUOP {
def apply(t1DecodePattern: T1DecodePattern): Uop = {
Expand All @@ -24,6 +25,7 @@ object ZvbbUOP {
t4 _ -> zvbbUop4,
t5 _ -> zvbbUop5,
t6 _ -> zvbbUop6,
t7 _ -> zvbbUop7,
).collectFirst {
case (fn, tpe) if fn(t1DecodePattern) => tpe
}.getOrElse(UopDC)
Expand Down

0 comments on commit 718f750

Please sign in to comment.