Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Make MemConf's MemPort serialization deterministic #2508

Merged
merged 2 commits into from
Apr 8, 2022

Conversation

chick
Copy link
Contributor

@chick chick commented Apr 7, 2022

Problem: MemConf serialization of MemPorts was not deterministic
and the ordering seems to have changed as we move projects to 2.13
Downstream project can be adversely affected by changes in ordering
This changes specifies as specific ordering that should be compatible with
the historically one.

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • [NA] Did you update the FIRRTL spec to include every new feature/behavior?
  • 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 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

Code cleanup

API Impact

This change should preserve existing behavior that was changing as we continue to move to 2.13
Without this change downstream users for MemConf output could break

Backend Code Generation Impact

Verilog output should not be altered

Desired Merge Strategy

Squash and Merge

Release Notes

The order of MemPort fields in serialized MemConf is now guaranteed to be in the following order:

  • mrw, mwrite, rw, write, read

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (1.2.x, 1.3.0, 1.4.0) ?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

and the ordering seems to have changed as we move projects to 2.13
Downstream project can be adversely affected by changes in ordering
This changes specifies as specific ordering that should be compatible with
the historically one.
@chick chick requested a review from jackkoenig April 7, 2022 20:46
@chick chick self-assigned this Apr 7, 2022
Copy link
Contributor

@mwachs5 mwachs5 left a comment

Choose a reason for hiding this comment

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

Non-determinism and hardware generation don't mix, I agree in principle with this change have not done a deep dive on the implementation

Copy link
Contributor

@jackkoenig jackkoenig left a comment

Choose a reason for hiding this comment

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

Generally looks good but I have a couple of suggestions

src/main/scala/firrtl/passes/memlib/MemConf.scala Outdated Show resolved Hide resolved
src/main/scala/firrtl/passes/memlib/MemConf.scala Outdated Show resolved Hide resolved
@jackkoenig jackkoenig added this to the 1.5.x milestone Apr 7, 2022
Remove unnecessary mix-ins on MemPort
@jackkoenig jackkoenig merged commit f7b4aa8 into master Apr 8, 2022
@jackkoenig jackkoenig deleted the fix-memport-serialize-ordering branch April 8, 2022 00:07
mergify bot pushed a commit that referenced this pull request Apr 8, 2022
Problem: MemConf serialization of MemPorts was not deterministic
and the ordering seems to have changed as we move projects to 2.13
Downstream project can be adversely affected by changes in ordering
This changes specifies as specific ordering that should be compatible with
the historical one.

(cherry picked from commit f7b4aa8)
@mergify mergify bot added the Backported This PR has been backported to marked stable branch label Apr 8, 2022
mergify bot added a commit that referenced this pull request Apr 8, 2022
Problem: MemConf serialization of MemPorts was not deterministic
and the ordering seems to have changed as we move projects to 2.13
Downstream project can be adversely affected by changes in ordering
This changes specifies as specific ordering that should be compatible with
the historical one.

(cherry picked from commit f7b4aa8)

Co-authored-by: Chick Markley <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Backported This PR has been backported to marked stable branch enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants