-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PortAPI between IO and Harness blocks #1610
Conversation
5b4372e
to
c030b33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice API cleanups 👍🏼
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits. Overall LGTM
@@ -55,6 +55,16 @@ class WithScalaTestFeatures extends Config((site, here, up) => { | |||
case TracePortKey => up(TracePortKey, site).map(_.copy(print = true)) | |||
}) | |||
|
|||
// Multi-cycle regfile for rocket+boom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope of this PR? If this PR takes a while to merge we can separate it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the old IOBInder-based approach for adding these annotations, to a simpler match statement at the FireSim top level.
case class ExtIntPort (val io: UInt) | ||
extends Port[UInt] | ||
|
||
case class DMIPort (val io: ClockedDMIIO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you deal with Parameters
in these case classes? Sometimes the IO depends on p: Parameters
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answered offline. The IO is constructed outside of this case class, thus you don't need the parameters to generate the IO.
case class I2CPort (val io: sifive.blocks.devices.i2c.I2CPort) | ||
extends Port[sifive.blocks.devices.i2c.I2CPort] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Why is this fully qualified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because sifive.I2CPort name conflicts with this I2CPort. Ugly, unfortunately
// TODO FIX: This currently makes each SimDRAM contain the entire memory space | ||
val memSize = port.params.master.size | ||
val memBase = port.params.master.base | ||
val lineSize = 64 // cache block size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LineSize isn't parameterized anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line_size doesn't actually matter for DRAM. We shouldn't even be passing it back to DRAMSim in the first place (and our DRAMSim driver doesn't use the line_size parameter for any calculations). It also requires line_size=64.
Future TODO is to remove the line_size argument to DRAMSim, so we can get rid of this here as well too.
This adds
trait iobinders.Port
, which represents some IO bundle that should be exposed by ChipTop, and connected to in the Harness. Case classes extending this trait should package enough parameter information about the IO bundle to facilitate harness instantiation and/or IO-cell generation.Changes:
Port
objects, instead of raw IO. ThePort
object contains the IO, as well as parameterization information around the IOPort
s emitted by the ChipTop. This is only a cosmetic change to the implementationsPort
s to connect.Unfortunately, due to the API change, the surface area of this PR is quite large. The main places to look are in
chipyard/src/main/scala/iobinders/Ports.scala
, to see the case classes describing top-level ports, as well aschipyard/src/main/scala/harness/HarnessBinders.scala
, to see the updated HarnessBinder APIRelated PRs / Issues:
Type of change:
Impact:
Contributor Checklist:
main
as the base branch?changelog:<topic>
label?changelog:
label?.conda-lock.yml
file if you updated the conda requirements file?Please Backport
?