Skip to content

Commit

Permalink
[rtl] support zvk
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-Wye committed Aug 22, 2024
1 parent 9192d5f commit c762eb2
Show file tree
Hide file tree
Showing 25 changed files with 981 additions and 33 deletions.
3 changes: 2 additions & 1 deletion configgen/generated/blastoise.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@
]
]
],
"zvbbModuleParameters": []
"zvbbModuleParameters": [],
"zvkModuleParameters": []
}
},
"generator": "org.chipsalliance.t1.rtl.T1"
Expand Down
3 changes: 2 additions & 1 deletion configgen/generated/machamp.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@
]
],
"floatModuleParameters": [],
"zvbbModuleParameters": []
"zvbbModuleParameters": [],
"zvkModuleParameters": []
}
},
"generator": "org.chipsalliance.t1.rtl.T1"
Expand Down
20 changes: 19 additions & 1 deletion configgen/generated/psyduck.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"dLen": 256,
"extensions": [
"Zve32f",
"Zvbb"
"Zvbb",
"Zvk"
],
"t1customInstructions": [],
"vrfBankSize": 1,
Expand Down Expand Up @@ -184,6 +185,23 @@
3
]
]
],
"zvkModuleParameters": [
[
{
"parameter": {
"datapathWidth": 32,
"latency": 3
},
"generator": "org.chipsalliance.t1.rtl.LaneZvk"
},
[
0,
1,
2,
3
]
]
]
}
},
Expand Down
3 changes: 2 additions & 1 deletion configgen/generated/sandslash.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@
]
],
"floatModuleParameters": [],
"zvbbModuleParameters": []
"zvbbModuleParameters": [],
"zvkModuleParameters": []
}
},
"generator": "org.chipsalliance.t1.rtl.T1"
Expand Down
17 changes: 11 additions & 6 deletions configgen/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@ object Main {
Seq(0, 1, 2, 3))),
floatModuleParameters =
Seq((SerializableModuleGenerator(classOf[LaneFloat], LaneFloatParam(32, 3)), Seq(0, 1, 2, 3))),
zvbbModuleParameters = Seq()
zvbbModuleParameters = Seq(),
zvkModuleParameters = Seq(),
)
)
if (doEmit) param.emit(targetFile)
param
}

// DLEN256 VLEN256; FP; VRF p0rw,p1rw bank1; LSU bank8 beatbyte 8; Zvbb
// DLEN256 VLEN256; FP; VRF p0rw,p1rw bank1; LSU bank8 beatbyte 8; Zvbb; Zvk
@main def psyduck(
@arg(name = "target-file", short = 't') targetFile: os.Path,
@arg(name = "emit", short = 'e', doc = "emit config") doEmit: Boolean = true
Expand All @@ -117,7 +118,7 @@ object Main {
val param = T1Parameter(
vLen,
dLen,
extensions = Seq("Zve32f", "Zvbb"),
extensions = Seq("Zve32f", "Zvbb", "Zvk"),
t1customInstructions = Nil,
vrfBankSize = 1,
vrfRamType = RamType.p0rwp1rw,
Expand Down Expand Up @@ -151,7 +152,9 @@ object Main {
floatModuleParameters =
Seq((SerializableModuleGenerator(classOf[LaneFloat], LaneFloatParam(32, 3)), Seq(0, 1, 2, 3))),
zvbbModuleParameters =
Seq((SerializableModuleGenerator(classOf[LaneZvbb], LaneZvbbParam(32, 3)), Seq(0, 1, 2, 3)))
Seq((SerializableModuleGenerator(classOf[LaneZvbb], LaneZvbbParam(32, 3)), Seq(0, 1, 2, 3))),
zvkModuleParameters =
Seq((SerializableModuleGenerator(classOf[LaneZvk], LaneZvkParam(32, 3)), Seq(0, 1, 2, 3))),
)
)
if (doEmit) param.emit(targetFile)
Expand Down Expand Up @@ -201,7 +204,8 @@ object Main {
),
Seq(0, 1, 2, 3))),
floatModuleParameters = Seq(),
zvbbModuleParameters = Seq() // TODO
zvbbModuleParameters = Seq(),
zvkModuleParameters = Seq(),
)
)
if (doEmit) param.emit(targetFile)
Expand Down Expand Up @@ -251,7 +255,8 @@ object Main {
),
Seq(0, 1, 2, 3))),
floatModuleParameters = Seq(),
zvbbModuleParameters = Seq() // TODO
zvbbModuleParameters = Seq(),
zvkModuleParameters = Seq(),
)
)
if (doEmit) param.emit(targetFile)
Expand Down
3 changes: 2 additions & 1 deletion t1/src/Bundles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ class ExecutionUnitRecord(parameter: LaneParameter)(isLastSlot: Boolean) extends
val executeIndex: Bool = Bool()
val source: Vec[UInt] = Vec(3, UInt(parameter.datapathWidth.W))
val crossReadSource: Option[UInt] = Option.when(isLastSlot)(UInt((parameter.datapathWidth * 2).W))
val zvkCrossReadSource: Option[UInt] = Option.when(isLastSlot && parameter.zvkEnable)(UInt((parameter.datapathWidth * 4).W))
/** groupCounter need use to update `Lane.maskFormatResultForGroup` */
val groupCounter: UInt = UInt(parameter.groupNumberBits.W)
val sSendResponse: Option[Bool] = Option.when(isLastSlot)(Bool())
Expand Down Expand Up @@ -725,4 +726,4 @@ class T1Retire(xLen: Int) extends Bundle {
val rd: ValidIO[T1RdRetire] = Valid(new T1RdRetire(xLen))
val csr: ValidIO[T1CSRRetire] = Valid(new T1CSRRetire)
val mem: ValidIO[EmptyBundle] = Valid(new EmptyBundle)
}
}
Loading

0 comments on commit c762eb2

Please sign in to comment.