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

Enhance views to [sometimes] support dynamic indexing and implement FlatIO #2476

Merged
merged 3 commits into from
Apr 11, 2022

Conversation

jackkoenig
Copy link
Contributor

@jackkoenig jackkoenig commented Apr 6, 2022

h/t @davidbiancolin for the implementation idea

@oharboe I promised you this a while ago, here it finally is!

The best way to understand this PR is to look at the tests (including the DataViewTargetSpec which is a subtle change but an enhancement). Basically, I changed the AggregateViewBinding to include mappings between Aggregates when there is a 1-1 correspondence. This enables dynamically indexing Vecs that are themselves elements of larger Aggregates in views when the corresponding element of the view is a Vec of the same type. It also increases the number of cases where a single Target can represent part of a view.

It also enabled implementing FlatIO (which really needed dynamic indexing to work), so I went ahead and did that too!

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • new feature/API

API Impact

This enables dynamic indexing of more views. It also adds chisel3.experimental.FlatIO for creating ports without a prefix.

Backend Code Generation Impact

No impact

Desired Merge Strategy

  • Rebase

Release Notes

Enable dynamic indexing for more views. Add chisel3.experimental.FlatIO for creating ports from Bundles without a prefix for the name of the val.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (Bug fix: 3.4.x, [small] API extension: 3.5.x, API modification or big change: 3.6.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

This is implemented by including any corresponding Aggregates from the
DataView.mapping in the AggregateViewBinding.childMap (which is now of
type Map[Data, Data]).

This enables dynamically indexing Vecs that are themselves elements of
larger Aggregates in views when the corresponding element of the view is
a Vec of the same type. It also increases the number of cases where a
single Target can represent part of a view.
@jackkoenig jackkoenig added the Feature New feature, will be included in release notes label Apr 6, 2022
@jackkoenig jackkoenig added this to the 3.5.x milestone Apr 6, 2022
@mwachs5
Copy link
Contributor

mwachs5 commented Apr 6, 2022

Looks good as far as API is concerned. Can't comment on the implementation

@jackkoenig jackkoenig merged commit 77756c9 into master Apr 11, 2022
@jackkoenig jackkoenig deleted the view-dynamic-indexing branch April 11, 2022 23:19
@mergify mergify bot added the Backported This PR has been backported label Apr 11, 2022
mergify bot added a commit that referenced this pull request Apr 12, 2022
…latIO (backport #2476) (#2479)

* Capture 1:1 mappings of Aggregates inside of views

This is implemented by including any corresponding Aggregates from the
DataView.mapping in the AggregateViewBinding.childMap (which is now of
type Map[Data, Data]).

This enables dynamically indexing Vecs that are themselves elements of
larger Aggregates in views when the corresponding element of the view is
a Vec of the same type. It also increases the number of cases where a
single Target can represent part of a view.

(cherry picked from commit 1f6b1ca)

* Add FlatIO API for creating ports from Bundles without a prefix

(cherry picked from commit 772a3a1)

* [docs] Add FlatIO to the general cookbook

(cherry picked from commit b415964)

Co-authored-by: Jack Koenig <koenig@sifive.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported This PR has been backported Feature New feature, will be included in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants