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

Add support for explicit names in properties #747

Merged
merged 3 commits into from Feb 12, 2023

Conversation

jeanthom
Copy link
Contributor

This PR implements explicit naming of properties (Assert/Assume/Cover) as asked in #744. The name is specified through the use of a new optional parameter "name".

With the following code example:

from amaranth import *
from amaranth.asserts import *
from amaranth.back import rtlil

m = Module()
a = Signal()
m.d.sync += Assert(a != 0, name="foobar")

print(rtlil.convert(m, ports=(a,)))

The $assert cell picks up the proper name:

[...]
  cell $assert \foobar
    connect \A $assert$check
    connect \EN $assert$en
  end
[...]

Fixes #744.

Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

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

See comments, LGTM otherwise.

@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2023

Codecov Report

Merging #747 (d15d9ee) into main (666ee27) will decrease coverage by 0.08%.
The diff coverage is 44.44%.

@@            Coverage Diff             @@
##             main     #747      +/-   ##
==========================================
- Coverage   81.20%   81.13%   -0.08%     
==========================================
  Files          49       49              
  Lines        6487     6492       +5     
  Branches     1557     1559       +2     
==========================================
- Hits         5268     5267       -1     
- Misses       1027     1032       +5     
- Partials      192      193       +1     
Impacted Files Coverage Δ
amaranth/back/rtlil.py 78.43% <ø> (ø)
amaranth/hdl/ast.py 89.18% <33.33%> (-0.38%) ⬇️
amaranth/hdl/xfrm.py 96.23% <66.66%> (ø)
amaranth/_toolchain/cxx.py 95.23% <0.00%> (-4.77%) ⬇️
amaranth/build/run.py 21.58% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

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

LGTM

@whitequark whitequark merged commit a7fec27 into amaranth-lang:main Feb 12, 2023
@whitequark
Copy link
Member

Thank you!

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.

Explicit names for Assert/Assume statements
3 participants