Skip to content

Commit b17eadb

Browse files
committed
[rtl] support zvk
1 parent 1c096d1 commit b17eadb

28 files changed

+2192
-109
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
@@ -102,14 +102,15 @@ object Main {
102102
),
103103
floatModuleParameters =
104104
Seq((SerializableModuleGenerator(classOf[LaneFloat], LaneFloatParam(32, 3)), Seq(0, 1, 2, 3))),
105-
zvbbModuleParameters = Seq()
105+
zvbbModuleParameters = Seq(),
106+
zvkModuleParameters = Seq(),
106107
)
107108
)
108109
if (doEmit) param.emit(targetFile)
109110
param
110111
}
111112

112-
// DLEN256 VLEN256; FP; VRF p0rw,p1rw bank1; LSU bank8 beatbyte 8; Zvbb
113+
// DLEN256 VLEN256; FP; VRF p0rw,p1rw bank1; LSU bank8 beatbyte 8; Zvbb; Zvk
113114
@main def psyduck(
114115
@arg(name = "target-file", short = 't') targetFile: os.Path,
115116
@arg(name = "emit", short = 'e', doc = "emit config") doEmit: Boolean = true
@@ -119,7 +120,7 @@ object Main {
119120
val param = T1Parameter(
120121
vLen,
121122
dLen,
122-
extensions = Seq("Zve32f", "Zvbb"),
123+
extensions = Seq("Zve32f", "Zvbb", "Zvk"),
123124
t1customInstructions = Nil,
124125
vrfBankSize = 1,
125126
vrfRamType = RamType.p0rwp1rw,
@@ -155,7 +156,9 @@ object Main {
155156
floatModuleParameters =
156157
Seq((SerializableModuleGenerator(classOf[LaneFloat], LaneFloatParam(32, 3)), Seq(0, 1, 2, 3))),
157158
zvbbModuleParameters =
158-
Seq((SerializableModuleGenerator(classOf[LaneZvbb], LaneZvbbParam(32, 3)), Seq(0, 1, 2, 3)))
159+
Seq((SerializableModuleGenerator(classOf[LaneZvbb], LaneZvbbParam(32, 3)), Seq(0, 1, 2, 3))),
160+
zvkModuleParameters =
161+
Seq((SerializableModuleGenerator(classOf[LaneZvk], LaneZvkParam(128, 3)), Seq(0, 1, 2, 3)), (SerializableModuleGenerator(classOf[LaneZvk256], LaneZvkParam(256, 3)), Seq(0, 1, 2, 3))),
159162
)
160163
)
161164
if (doEmit) param.emit(targetFile)
@@ -207,7 +210,8 @@ object Main {
207210
)
208211
),
209212
floatModuleParameters = Seq(),
210-
zvbbModuleParameters = Seq() // TODO
213+
zvbbModuleParameters = Seq(),
214+
zvkModuleParameters = Seq(),
211215
)
212216
)
213217
if (doEmit) param.emit(targetFile)
@@ -259,7 +263,8 @@ object Main {
259263
)
260264
),
261265
floatModuleParameters = Seq(),
262-
zvbbModuleParameters = Seq() // TODO
266+
zvbbModuleParameters = Seq(),
267+
zvkModuleParameters = Seq(),
263268
)
264269
)
265270
if (doEmit) param.emit(targetFile)

ipemu/src/TestBench.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class TestBench(generator: SerializableModuleGenerator[T1, T1Parameter])
260260
laneProbes.flatMap(laneProbe =>
261261
laneProbe.slots.map(slot => slot.writeTag === tag.U && slot.writeQueueEnq && slot.writeMask.orR)
262262
) ++ laneProbes.flatMap(laneProbe =>
263-
laneProbe.crossWriteProbe.map(cp => cp.bits.writeTag === tag.U && cp.valid && cp.bits.writeMask.orR)
263+
laneProbe.crossWriteProbe.map(cp => cp.bits.writeTag === tag.U && cp.valid && cp.bits.writeMask.orR) // TODO: zvkCrossWriteProbe
264264
) ++
265265
// vrf write from lsu
266266
lsuProbe.slots.map(slot => slot.dataInstruction === tag.U && slot.writeValid && slot.dataMask.orR) ++

t1/src/Bundles.scala

+3
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,11 @@ class ExecutionUnitRecord(parameter: LaneParameter)(isLastSlot: Boolean) extends
591591
val maskForFilter: UInt = UInt(4.W)
592592
// false -> lsb of cross read group
593593
val executeIndex: Bool = Bool()
594+
val zvkExecuteIndex: Option[UInt] = Option.when(parameter.zvkEnable)(UInt(2.W))
594595
val source: Vec[UInt] = Vec(3, UInt(parameter.datapathWidth.W))
595596
val crossReadSource: Option[UInt] = Option.when(isLastSlot)(UInt((parameter.datapathWidth * 2).W))
597+
val zvkCrossReadSource: Option[UInt] =
598+
Option.when(isLastSlot && parameter.zvkEnable)(UInt((parameter.datapathWidth * 4).W))
596599

597600
/** groupCounter need use to update `Lane.maskFormatResultForGroup` */
598601
val groupCounter: UInt = UInt(parameter.groupNumberBits.W)

0 commit comments

Comments
 (0)