Skip to content

FPGA: expose IO with finishFPGA#619

Merged
klin02 merged 1 commit intomasterfrom
fpga-io
May 7, 2025
Merged

FPGA: expose IO with finishFPGA#619
klin02 merged 1 commit intomasterfrom
fpga-io

Conversation

@klin02
Copy link
Copy Markdown
Member

@klin02 klin02 commented Apr 29, 2025

This change expose FPGA IO with finishFPGA, enabling us to wrap both DUT, Difftest, and changing DiffTestBundle Interface within the same wrapper. Only the output of Batch, with width declared at DifftestMacros.v, will be exposed to FPGA.

@klin02 klin02 force-pushed the fpga-io branch 2 times, most recently from d8f83c1 to 52f4598 Compare April 29, 2025 09:35
@klin02 klin02 requested a review from poemonsense May 7, 2025 08:41
poemonsense
poemonsense previously approved these changes May 7, 2025
Copy link
Copy Markdown
Member

@poemonsense poemonsense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's becoming more clearer now. We need to find out a better way to describe different optimization passes

val step = IO(Output(UInt(config.stepWidth.W)))
val control = Wire(new GatewaySinkControl(config))

val fpgaIO = Option.when(config.isFPGA)(IO(Output(new FpgaDiffIO(config))))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to check whether isBatch is enabled? Otherwise, this fpgaIO is unconnected

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will fix it.

gateway
}

def finishFPGA(cpu: String): FpgaDiffIO = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the user need to call this explicitly? How does the user use this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, users would separately generate DUT and Difftest, including variuos DifftestBundle interfaces, which we should connect manually in the wrapper module, as shown below.
https://github.com/OpenXiangShan/XiangShan/blob/7e564dbbfb630d3142a5c023ab16922e0497be9d/src/main/scala/top/Top.scala#L478-L479

This modification encapsulates DUT and Difftest, exposing only fixed-length I/O as shown below.
val difftest = DifftestModule.finishFPGA("XiangShan")

This change expose FPGA IO with finishFPGA, enabling us to wrap both
DUT, Difftest, and changing DiffTestBundle Interface within the same
wrapper. Only the output of Batch, with width declared at
DifftestMacros.v, will be exposed to FPGA.
@klin02 klin02 merged commit 0b395f3 into master May 7, 2025
5 checks passed
@klin02 klin02 deleted the fpga-io branch May 7, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants