Skip to content

Commit 0e4272f

Browse files
committed
[rtl] support zvk
1 parent 9192d5f commit 0e4272f

26 files changed

+995
-35
lines changed

configgen/generated/blastoise.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@
167167
]
168168
]
169169
],
170-
"zvbbModuleParameters": []
170+
"zvbbModuleParameters": [],
171+
"zvkModuleParameters": []
171172
}
172173
},
173174
"generator": "org.chipsalliance.t1.rtl.T1"

configgen/generated/machamp.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@
151151
]
152152
],
153153
"floatModuleParameters": [],
154-
"zvbbModuleParameters": []
154+
"zvbbModuleParameters": [],
155+
"zvkModuleParameters": []
155156
}
156157
},
157158
"generator": "org.chipsalliance.t1.rtl.T1"

configgen/generated/psyduck.json

+19-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"dLen": 256,
55
"extensions": [
66
"Zve32f",
7-
"Zvbb"
7+
"Zvbb",
8+
"Zvk"
89
],
910
"t1customInstructions": [],
1011
"vrfBankSize": 1,
@@ -184,6 +185,23 @@
184185
3
185186
]
186187
]
188+
],
189+
"zvkModuleParameters": [
190+
[
191+
{
192+
"parameter": {
193+
"datapathWidth": 32,
194+
"latency": 3
195+
},
196+
"generator": "org.chipsalliance.t1.rtl.LaneZvk"
197+
},
198+
[
199+
0,
200+
1,
201+
2,
202+
3
203+
]
204+
]
187205
]
188206
}
189207
},

configgen/generated/sandslash.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@
151151
]
152152
],
153153
"floatModuleParameters": [],
154-
"zvbbModuleParameters": []
154+
"zvbbModuleParameters": [],
155+
"zvkModuleParameters": []
155156
}
156157
},
157158
"generator": "org.chipsalliance.t1.rtl.T1"

configgen/src/Main.scala

+11-6
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,15 @@ object Main {
100100
Seq(0, 1, 2, 3))),
101101
floatModuleParameters =
102102
Seq((SerializableModuleGenerator(classOf[LaneFloat], LaneFloatParam(32, 3)), Seq(0, 1, 2, 3))),
103-
zvbbModuleParameters = Seq()
103+
zvbbModuleParameters = Seq(),
104+
zvkModuleParameters = Seq(),
104105
)
105106
)
106107
if (doEmit) param.emit(targetFile)
107108
param
108109
}
109110

110-
// DLEN256 VLEN256; FP; VRF p0rw,p1rw bank1; LSU bank8 beatbyte 8; Zvbb
111+
// DLEN256 VLEN256; FP; VRF p0rw,p1rw bank1; LSU bank8 beatbyte 8; Zvbb; Zvk
111112
@main def psyduck(
112113
@arg(name = "target-file", short = 't') targetFile: os.Path,
113114
@arg(name = "emit", short = 'e', doc = "emit config") doEmit: Boolean = true
@@ -117,7 +118,7 @@ object Main {
117118
val param = T1Parameter(
118119
vLen,
119120
dLen,
120-
extensions = Seq("Zve32f", "Zvbb"),
121+
extensions = Seq("Zve32f", "Zvbb", "Zvk"),
121122
t1customInstructions = Nil,
122123
vrfBankSize = 1,
123124
vrfRamType = RamType.p0rwp1rw,
@@ -151,7 +152,9 @@ object Main {
151152
floatModuleParameters =
152153
Seq((SerializableModuleGenerator(classOf[LaneFloat], LaneFloatParam(32, 3)), Seq(0, 1, 2, 3))),
153154
zvbbModuleParameters =
154-
Seq((SerializableModuleGenerator(classOf[LaneZvbb], LaneZvbbParam(32, 3)), Seq(0, 1, 2, 3)))
155+
Seq((SerializableModuleGenerator(classOf[LaneZvbb], LaneZvbbParam(32, 3)), Seq(0, 1, 2, 3))),
156+
zvkModuleParameters =
157+
Seq((SerializableModuleGenerator(classOf[LaneZvk], LaneZvkParam(32, 3)), Seq(0, 1, 2, 3))),
155158
)
156159
)
157160
if (doEmit) param.emit(targetFile)
@@ -201,7 +204,8 @@ object Main {
201204
),
202205
Seq(0, 1, 2, 3))),
203206
floatModuleParameters = Seq(),
204-
zvbbModuleParameters = Seq() // TODO
207+
zvbbModuleParameters = Seq(),
208+
zvkModuleParameters = Seq(),
205209
)
206210
)
207211
if (doEmit) param.emit(targetFile)
@@ -251,7 +255,8 @@ object Main {
251255
),
252256
Seq(0, 1, 2, 3))),
253257
floatModuleParameters = Seq(),
254-
zvbbModuleParameters = Seq() // TODO
258+
zvbbModuleParameters = Seq(),
259+
zvkModuleParameters = Seq(),
255260
)
256261
)
257262
if (doEmit) param.emit(targetFile)

ipemu/src/TestBench.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class TestBench(generator: SerializableModuleGenerator[T1, T1Parameter])
253253
laneProbes.flatMap(laneProbe =>
254254
laneProbe.slots.map(slot => slot.writeTag === tag.U && slot.writeQueueEnq && slot.writeMask.orR)
255255
) ++ laneProbes.flatMap(laneProbe =>
256-
laneProbe.crossWriteProbe.map(cp => cp.bits.writeTag === tag.U && cp.valid && cp.bits.writeMask.orR)
256+
laneProbe.crossWriteProbe.map(cp => cp.bits.writeTag === tag.U && cp.valid && cp.bits.writeMask.orR) // TODO: zvkCrossWriteProbe
257257
) ++
258258
// vrf write from lsu
259259
lsuProbe.slots.map(slot => slot.dataInstruction === tag.U && slot.writeValid && slot.dataMask.orR) ++

t1/src/Bundles.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ class ExecutionUnitRecord(parameter: LaneParameter)(isLastSlot: Boolean) extends
621621
val executeIndex: Bool = Bool()
622622
val source: Vec[UInt] = Vec(3, UInt(parameter.datapathWidth.W))
623623
val crossReadSource: Option[UInt] = Option.when(isLastSlot)(UInt((parameter.datapathWidth * 2).W))
624+
val zvkCrossReadSource: Option[UInt] = Option.when(isLastSlot && parameter.zvkEnable)(UInt((parameter.datapathWidth * 4).W))
624625
/** groupCounter need use to update `Lane.maskFormatResultForGroup` */
625626
val groupCounter: UInt = UInt(parameter.groupNumberBits.W)
626627
val sSendResponse: Option[Bool] = Option.when(isLastSlot)(Bool())
@@ -725,4 +726,4 @@ class T1Retire(xLen: Int) extends Bundle {
725726
val rd: ValidIO[T1RdRetire] = Valid(new T1RdRetire(xLen))
726727
val csr: ValidIO[T1CSRRetire] = Valid(new T1CSRRetire)
727728
val mem: ValidIO[EmptyBundle] = Valid(new EmptyBundle)
728-
}
729+
}

0 commit comments

Comments
 (0)