Skip to content

Commit

Permalink
batch: export FPGA IO width macro and merge output data for connection
Browse files Browse the repository at this point in the history
When using fpga, the IO width information is exported to the macro definition file, and the info and data in the out are merged to facilitate direct connection to the transmission module
  • Loading branch information
xiaokamikami committed Feb 24, 2025
1 parent 00d1bca commit 5f3dc09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/Gateway.scala
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ case class GatewayConfig(
def vMacros: Seq[String] = {
val macros = ListBuffer.empty[String]
macros += s"CONFIG_DIFFTEST_STEPWIDTH ${stepWidth}"
macros += s"CONFIG_DIFFTEST_BATCH_IO_WITDH ${(batchArgByteLen._1 + batchArgByteLen._2) * 8}"
if (isNonBlock) macros += "CONFIG_DIFFTEST_NONBLOCK"
if (hasDeferredResult) macros += "CONFIG_DIFFTEST_DEFERRED_RESULT"
if (hasInternalStep) macros += "CONFIG_DIFFTEST_INTERNAL_STEP"
Expand Down Expand Up @@ -271,12 +272,12 @@ object GatewaySink {
}
val out = Option.when(config.isFPGA) {
IO(new Bundle {
val batch = Output(chiselTypeOf(io))
val data = Output(UInt())
val enable = Output(Bool())
})
}
if (config.isFPGA) {
out.get.batch := io
out.get.data := Cat(io.data, io.info)
out.get.enable := control.enable
dontTouch(out.get)
}
Expand Down

0 comments on commit 5f3dc09

Please sign in to comment.