Skip to content
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

Fixes for AXI4 MMIO and FBus ports #618

Merged
merged 2 commits into from
Jul 3, 2020
Merged

Fixes for AXI4 MMIO and FBus ports #618

merged 2 commits into from
Jul 3, 2020

Conversation

jerryz123
Copy link
Contributor

Related issue: #616

Type of change: bug fix | new feature

Impact: rtl change

  • Fixes bug with AXI4 MMIO ports not being generated properly due to
    IOBinders issue. Additionally adds IOCells to AXI4 ports so that they
    appear in ChipTop
  • Change IOBinders to also require passing p: Parameters
    to child functions. Serialization of type targets via ClassTags fails
    for compound types, so we cannot use BaseSubsystem with HasSomeTrait
    as the type target in OverrideIOBinders.

 * Fixes bug with AXI4 MMIO ports not being generated properly due to
   IOBinders issue. Additionally adds IOCells to AXI4 ports so that they
   appear in ChipTop
 * Change IOBinders to also require passing p: Parameters
   to child functions. Serialization of type targets via ClassTags fails
   for compound types, so we cannot use `BaseSubsystem with HasSomeTrait`
   as the type target in OverrideIOBinders.
Copy link
Contributor

@davidbiancolin davidbiancolin left a comment

Choose a reason for hiding this comment

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

I'm a little be concerned that there could be instances where the top-level parameters instance may not match that used in the mixin, which is probably what the user wants most cases. It's unfortunate the self-typing in the mixins is insufficient for the type system here.

That said, I don't see any other way to fix this without going into RC though.

generators/chipyard/src/main/scala/IOBinders.scala Outdated Show resolved Hide resolved
Copy link
Contributor

@jwright6323 jwright6323 left a comment

Choose a reason for hiding this comment

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

I won't block this PR, but I share the concern about parameter mismatches and being overly verbose/repetitive. There seem to only be a few IOBinders that need this- can you fix this with types somehow? e.g.

type chipyard.CanHaveSlaveAXI4Port = freechips.rocketchip.subsystem.CanHaveSlaveAXI4Port with BaseSubsystem

?

}
def axi4(io: Seq[AXI4Bundle], node: AXI4MasterNode, name: String): Seq[(AXI4Bundle, AXI4EdgeParameters, Seq[IOCell])] = {
io.zip(node.out).zipWithIndex.map{ case ((mem_axi4, (_, edge)), i) => {
//val (port, ios) = IOCell.generateIOFromSignal(mem_axi4, Some(s"iocell_${name}_axi4_master_${i}"))
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like this to be fixed, but I also understand that I'm in the critical path for that :). I'll take a look, but I won't block this PR because of this.

@jerryz123 jerryz123 force-pushed the mmio_fix branch 3 times, most recently from 0e41fdf to e4edd4c Compare July 3, 2020 00:19
Copy link
Contributor

@jwright6323 jwright6323 left a comment

Choose a reason for hiding this comment

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

So, I was actually thinking you would call GetSystemParameters() where you need it, rather than forcing every IOBinder to use it. This setup prevents you from using IOBinders on a system that is not a LazyModule (which we probably won't need to do soon/ever, tbh). It also adds an additional parameter to the IOBinder function, which IMO is still not ideal.

generators/chipyard/src/main/scala/IOBinders.scala Outdated Show resolved Hide resolved
@jerryz123 jerryz123 force-pushed the mmio_fix branch 2 times, most recently from 92a2828 to b363dc4 Compare July 3, 2020 01:00
Copy link
Contributor

@jwright6323 jwright6323 left a comment

Choose a reason for hiding this comment

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

This LGTM. Up to you if you'd like to wait for a fix for the IOCells stuff- I'm poking at it right now

@jerryz123 jerryz123 force-pushed the mmio_fix branch 3 times, most recently from 40a73e7 to db5a8f1 Compare July 3, 2020 09:00
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.

3 participants