Skip to content

Add support for dumping structure fields in VCD #967

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

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

whitequark
Copy link
Member

See #790.

This PR adds an entirely private API for describing formatting of values that is used in the standard library, in departure from our standing policy of not using private APIs in the standard library.

This is a temporary measure intended to get the version 0.4 released faster, as it has been years in the making. It is expected that this API will be made public in the version 0.5 after going through the usual RFC process.

This PR only adds VCD lines for fields defined in lib.data.Layout when using sim.pysim. The emitted RTLIL and Verilog remain the same. It is expected that when sim.cxxsim lands, RTLIL/Verilog output will include aliases for layout fields as well.

The value representation API also handles formatting of enumerations, with no changes visible to the designer. The implementation of Signal(decoder=) is changed as well to use the new API, with full backwards compatibility and no public API changes.

See amaranth-lang#790.

This commit adds an entirely private API for describing formatting of
values that is used in the standard library, in departure from our
standing policy of not using private APIs in the standard library.

This is a temporary measure intended to get the version 0.4 released
faster, as it has been years in the making. It is expected that this
API will be made public in the version 0.5 after going through the usual
RFC process.

This commit only adds VCD lines for fields defined in `lib.data.Layout`
when using `sim.pysim`. The emitted RTLIL and Verilog remain the same.
It is expected that when `sim.cxxsim` lands, RTLIL/Verilog output will
include aliases for layout fields as well.

The value representation API also handles formatting of enumerations,
with no changes visible to the designer. The implementation of
`Signal(decoder=)` is changed as well to use the new API, with full
backwards compatibility and no public API changes.

Co-authored-by: Wanda <[email protected]>
Copy link

codecov bot commented Nov 26, 2023

Codecov Report

Attention: 29 lines in your changes are missing coverage. Please review.

Comparison is base (79adbed) 83.67% compared to head (e46c84c) 83.61%.

Files Patch % Lines
amaranth/sim/pysim.py 68.42% 14 Missing and 4 partials ⚠️
amaranth/hdl/_repr.py 80.64% 6 Missing ⚠️
amaranth/back/rtlil.py 28.57% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #967      +/-   ##
==========================================
- Coverage   83.67%   83.61%   -0.06%     
==========================================
  Files          54       55       +1     
  Lines        7784     7874      +90     
  Branches     1912     1934      +22     
==========================================
+ Hits         6513     6584      +71     
- Misses       1062     1079      +17     
- Partials      209      211       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@whitequark
Copy link
Member Author

We have discussed this PR, which adds a private API between the Amaranth AST and the Amaranth standard library, on the 2023-11-27 weekly meeting. The disposition was to merge with the understanding that the API will go through the RFC process before Amaranth 0.5.

@whitequark whitequark added this pull request to the merge queue Nov 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 27, 2023
@whitequark whitequark added this pull request to the merge queue Nov 27, 2023
Merged via the queue into amaranth-lang:main with commit 4bfe2cd Nov 27, 2023
@whitequark whitequark deleted the value-repr branch November 27, 2023 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant