Skip to content

Commit

Permalink
Batch: expose extra GatewayIO for FPGA (#513)
Browse files Browse the repository at this point in the history
When simulated on FPGA, we will connecting Gateway Batch output to DMA controller, then passing to Host Server by PCIe function.  This change expose extra optional Batch GatewayIO for FPGA.

---------

Co-authored-by: klin02 <[email protected]>
Co-authored-by: zhangshoulin <[email protected]>
  • Loading branch information
3 people authored Nov 25, 2024
1 parent 9f43eee commit 546f1c7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/scala/Gateway.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ case class GatewayConfig(
def dutBufLen: Int = if (isBatch) batchSize else 1
def maxStep: Int = if (isBatch) batchSize else 1
def stepWidth: Int = log2Ceil(maxStep + 1)
def batchArgByteLen: (Int, Int) = if (isNonBlock) (3600, 400) else (7200, 800)
def batchArgByteLen: (Int, Int) = if (isNonBlock || isFPGA) (3600, 400) else (7200, 800)
def hasDeferredResult: Boolean = isNonBlock || hasInternalStep
def needTraceInfo: Boolean = hasReplay
def needEndpoint: Boolean =
Expand Down Expand Up @@ -266,6 +266,17 @@ object GatewaySink {
case "dpic" => DPIC.batch(template, control, io, config)
case _ => DPIC.batch(template, control, io, config) // Default: DPI-C
}
val out = Option.when(config.isFPGA) {
IO(new Bundle {
val batch = Output(chiselTypeOf(io))
val enable = Output(Bool())
})
}
if (config.isFPGA) {
out.get.batch := io
out.get.enable := control.enable
dontTouch(out.get)
}
}

def collect(config: GatewayConfig): GatewayResult = {
Expand Down

0 comments on commit 546f1c7

Please sign in to comment.