Skip to content

Port rocket-chips :<>, :<=, :=> operators #11

@mwachs5

Description

@mwachs5

Type of issue: feature request

Impact: API addition (no impact on existing code)

Development Phase: proposal

Other information

If the current behavior is a bug, please provide the steps to reproduce the problem:

Users are suprised and sometimes frustrated that operations like the following don't work (just an example) :

class Bar extends Bundle {
 val bar = Bool()
}

class FooBar extends Bar {
 val foo = Bool()
}

...

class FooBarModule extends Module {
  val io = IO( new Bundle {
    val fooIn = Input(new Foo())
    val fooOut = Output(new Foo())
    val barIn = Input(new Bar())
    val barOut = Output(new Foo())
}

io.fooOut := io.barIn // Doesn't compile because there is no foo defined in bar
io.fooOut.foo := false.B

What is the current behavior?

The above doesn't compile and there is no way to tell it to compile without doing stuff like

fooOut.bar := barIn.bar

What is the expected behavior?

There should be some way to say "I know what I am doing, compile this."

Please tell us about your environment:

What is the use case for changing the behavior?

There are already operators defined here, but it would be nice to standardize and clearly document them:

https://github.com/chipsalliance/rocket-chip/blob/cca6d83d21f1f75c025f23e2dcd83f2acc3d1931/src/main/scala/util/BundleMap.scala#L69

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions