whitequark[cis] changed the topic of #amaranth-lang to: Amaranth hardware definition language · weekly meetings: Amaranth each Mon 1700 UTC, Amaranth SoC each Fri 1700 UTC · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang · Matrix #amaranth-lang:matrix.org
peepsalot has quit [Quit: Connection reset by peep]
peepsalot has joined #amaranth-lang
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 255 seconds]
Degi_ is now known as Degi
jjsuperpower has quit [Ping timeout: 252 seconds]
sporniket has joined #amaranth-lang
<_whitenotifier-f> [amaranth] whitequark commented on issue #936: Invalid verilog generated for 0-bit Signals - https://github.com/amaranth-lang/amaranth/issues/936#issuecomment-1772120989
<sporniket> hello, I am trying to write a component, however with components, it seems to me that the width of signals in the signature are fixed for all the same instances of the class, when I want to allow to choose at instanciation time
<sporniket> (typically, the data width..
<sporniket> e.g. sometime I want 8bits, other times 16, and maybe someday any value)
whitequark[cis] has joined #amaranth-lang
<whitequark[cis]> you can define @property def signature(self): which then lets you query arguments you set in the constructor
<whitequark[cis]> make sure to set the fields used in that property implementation before you run super().__init__
galibert[m] has joined #amaranth-lang
<galibert[m]> sporniket: alternatively check how Arbiter does it in amaranth-soc
<galibert[m]> It dynamically builds the signature in the constructor
<sporniket> ok whitequark[cis], galibert[m].
<whitequark[cis]> yeah, either option works; I recommend using @property because that means each call returns a fresh Signature object, but in some cases (like in amaranth-soc) that's actually undesirable and then that is the right approach
<whitequark[cis]> (Signature objects are generally mutable since that enables otherwise impossible code patterns, even if it can potentially create difficult-to-find bugs; so my default recommendation is to go with the route that creates a new object each time, to make the bugs more obvious)
<sporniket> I see. One last question, should I call super().signature too ?
<whitequark[cis]> nope
<whitequark[cis]> just completely override it
<galibert[m]> Unless you derive from your own stuff super() is not going to have a non-empty signature anyway, right?
<whitequark[cis]> yeah, it would raise an exception
<whitequark[cis]> in this case
<sporniket> got it. thank you.
sporniket has quit [Quit: Client closed]
<_whitenotifier-f> [amaranth] jfng opened issue #937: AttributeError when requesting resource with subsignals and direction "-" - https://github.com/amaranth-lang/amaranth/issues/937
<_whitenotifier-f> [amaranth] Kristopher38 commented on issue #936: Invalid verilog generated for 0-bit Signals - https://github.com/amaranth-lang/amaranth/issues/936#issuecomment-1772217609
<_whitenotifier-f> [amaranth] whitequark commented on issue #936: Invalid verilog generated for 0-bit Signals - https://github.com/amaranth-lang/amaranth/issues/936#issuecomment-1772222379
notgull has quit [Ping timeout: 255 seconds]
notgull has joined #amaranth-lang
mindw0rk has quit [Read error: Connection reset by peer]
mindw0rk has joined #amaranth-lang
feldim2425 has quit [Ping timeout: 260 seconds]
feldim2425 has joined #amaranth-lang
<_whitenotifier-f> [amaranth] whitequark opened pull request #938: build.res: fix issue #937 - https://github.com/amaranth-lang/amaranth/pull/938
Guest16 has joined #amaranth-lang
mindw0rk has quit [Read error: Connection reset by peer]
Guest16 has quit [Client Quit]
mindw0rk has joined #amaranth-lang
<nelgau> I have a question about lib.io._pin_signature. Specifically, this line:
<nelgau> I understand why i{} has Flow.In, and why o{} has Flow.Out, but shouldn’t oe have Flow.Out as well?
<nelgau> I may be missing something...
<nelgau> Or at least I was expecting o and oe to have identical flow
<whitequark[cis]> oh, that's a bug.
<whitequark[cis]> could you open a PR please?
<nelgau> Certainly
<whitequark[cis]> ideally lib.io would be deprecated wholesale, but this is a temporary compatibility measure to get existing code to work & still be able to use interfaces
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #amaranth-lang
<_whitenotifier-f> [amaranth] nelgau opened pull request #939: lib.io: `Pin.oe` should have `Flow.Out` - https://github.com/amaranth-lang/amaranth/pull/939
<_whitenotifier-f> [amaranth] codecov[bot] commented on pull request #939: lib.io: `Pin.oe` should have `Flow.Out` - https://github.com/amaranth-lang/amaranth/pull/939#issuecomment-1772737833
<_whitenotifier-f> [amaranth] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-939-392ead8d00c9a130b656b3af45c21fa410268301 - https://github.com/amaranth-lang/amaranth
Wanda[cis] has joined #amaranth-lang
<Wanda[cis]> oh meow.
<Wanda[cis]> so the good news is that Python 3.13 now has an alpha release and is CI-tested
<Wanda[cis]> the bad news is that we get new tracer failures on it
<whitequark[cis]> ah cool
<whitequark[cis]> well, that's something we have a lot of time to fix then ^^
<_whitenotifier-f> [amaranth-lang/amaranth] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/amaranth-lang/amaranth/compare/392ead8d00c9...bc316b41a89b
<_whitenotifier-f> [amaranth-lang/amaranth] nelgau bc316b4 - lib.io: `Pin.oe` should have `Flow.Out`
<_whitenotifier-f> [amaranth] whitequark closed pull request #939: lib.io: `Pin.oe` should have `Flow.Out` - https://github.com/amaranth-lang/amaranth/pull/939
<_whitenotifier-f> [amaranth] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-939-392ead8d00c9a130b656b3af45c21fa410268301 - https://github.com/amaranth-lang/amaranth
<_whitenotifier-f> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-0/±32] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/691da6c272d9...9fd645abde38
<_whitenotifier-f> [amaranth-lang/amaranth-lang.github.io] github-merge-queue[bot] 9fd645a - Deploying to main from @ amaranth-lang/amaranth@bc316b41a89ba32570a1384c5af8fab4f5a643cc 🚀
<_whitenotifier-f> [amaranth] wanda-phi opened pull request #940: tracer: recognize Python 3.13's CALL_KW opcode. - https://github.com/amaranth-lang/amaranth/pull/940
<Wanda[cis]> <whitequark[cis]> "well, that's something we have a..." <- but I *like* having green CI
<_whitenotifier-f> [amaranth] codecov[bot] commented on pull request #940: tracer: recognize Python 3.13's CALL_KW opcode. - https://github.com/amaranth-lang/amaranth/pull/940#issuecomment-1772812280
<Wanda[cis]> oh lol. still a CI failure, because sphinx somehow depends on a deprecated stdlib module that got nuked in 3.13
<Wanda[cis]> Could not import extension sphinx.builders.epub3 (exception: No module named 'imghdr') ... well
<Wanda[cis]> why... why is this getting imported anyway
<Wanda[cis]> hm, it's fixed in the current version of sphinx
<Wanda[cis]> apparently the doctest runner is based on epub for some reason? wtf
<whitequark[cis]> insane
<whitequark[cis]> we can just upgrade sphinx then
<whitequark[cis]> can you do the needful, please?
<_whitenotifier-f> [amaranth] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-940-bc316b41a89ba32570a1384c5af8fab4f5a643cc - https://github.com/amaranth-lang/amaranth
<Wanda[cis]> whitequark[cis]: sure; should I just bump it to the newest?
<whitequark[cis]> yep! go through the docs to check if it doesn't horribly misrender somehow and that's it
<Wanda[cis]> right
<whitequark[cis]> PSA: the next Monday meeting will be conducted at 1700 UTC, as before. (I wasn't present on the previous one because a flareup of fibromyalgia left me essentially bedridden.)
coltonp has joined #amaranth-lang
<_whitenotifier-f> [amaranth-lang/amaranth] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/amaranth-lang/amaranth/compare/bc316b41a89b...1159e52921c6
<_whitenotifier-f> [amaranth-lang/amaranth] wanda-phi 1159e52 - tracer: recognize Python 3.13's CALL_KW opcode.
<_whitenotifier-f> [amaranth] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-940-bc316b41a89ba32570a1384c5af8fab4f5a643cc - https://github.com/amaranth-lang/amaranth
<_whitenotifier-f> [amaranth] whitequark closed pull request #940: tracer: recognize Python 3.13's CALL_KW opcode. - https://github.com/amaranth-lang/amaranth/pull/940
<_whitenotifier-f> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-0/±32] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/9fd645abde38...9f17b794e722
<_whitenotifier-f> [amaranth-lang/amaranth-lang.github.io] github-merge-queue[bot] 9f17b79 - Deploying to main from @ amaranth-lang/amaranth@1159e52921c6cbc79af1afe1304dd795f6039c9e 🚀
<coltonp> I'm hitting this https://github.com/amaranth-lang/amaranth/issues/844 issue when following the setup instructions. Not 100% sure I understand the fix as I have libffi installed and can import cffi & ctypes without error. I'm trying in an venv (on Arch) if that matters
<whitequark[cis]> I'm not sure if those are actually related
<whitequark[cis]> can you show me your terminal output?
<coltonp> Traceback (most recent call last):
<coltonp>   File "/tmp/amaranth_test/UpCounter.py", line 67, in <module>
<coltonp>     with sim.write_vcd("UpCounter.vcd"):
<coltonp>   File "/usr/lib/python3.11/contextlib.py", line 137, in __enter__
<coltonp>     return next(self.gen)
<coltonp>            ^^^^^^^^^^^^^^
<coltonp>   File "/tmp/amaranth_test/env/lib/python3.11/site-packages/amaranth/sim/pysim.py", line 329, in write_vcd
<coltonp>     vcd_writer = _VCDWriter(self._fragment,
<coltonp>                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
<coltonp>   File "/tmp/amaranth_test/env/lib/python3.11/site-packages/amaranth/sim/pysim.py", line 94, in __init__
<coltonp>     if re.search(r"[ \t\r\n]", var_name):
<coltonp>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<coltonp>   File "/usr/lib/python3.11/re/__init__.py", line 176, in search
<coltonp>     return _compile(pattern, flags).search(string)
<coltonp>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<coltonp> TypeError: expected string or bytes-like object, got 'NoneType'
<_whitenotifier-f> [amaranth] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-938-1159e52921c6cbc79af1afe1304dd795f6039c9e - https://github.com/amaranth-lang/amaranth
<whitequark[cis]> please use paste services (e.g. https://paste.debian.net) rather than pasting directly into IRC; the latter is disruptive
<whitequark[cis]> anyway, I think the problem you're facing happens because you're using Python 3.11 with an Amaranth version that is too old
<whitequark[cis]> what is your Amaranth version?
<galibert[m]> Catherine: Hope you’re feeling better now
<coltonp> Makes sense thanks, will remember for the future. I just installed with pip, showing version 0.3
<whitequark[cis]> well, I'm still disabled, but other than that yes
<_whitenotifier-f> [amaranth-lang/amaranth] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/amaranth-lang/amaranth/compare/1159e52921c6...7e254b8657e0
<_whitenotifier-f> [amaranth-lang/amaranth] whitequark 7e254b8 - build.res: fix issue #937.
<_whitenotifier-f> [amaranth] whitequark closed pull request #938: build.res: fix issue #937 - https://github.com/amaranth-lang/amaranth/pull/938
<_whitenotifier-f> [amaranth] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-938-1159e52921c6cbc79af1afe1304dd795f6039c9e - https://github.com/amaranth-lang/amaranth
<_whitenotifier-f> [amaranth] whitequark closed issue #937: AttributeError when requesting resource with subsignals and direction "-" - https://github.com/amaranth-lang/amaranth/issues/937
<_whitenotifier-f> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-0/±32] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/9f17b794e722...a455eee1f0a6
<_whitenotifier-f> [amaranth-lang/amaranth-lang.github.io] github-merge-queue[bot] a455eee - Deploying to main from @ amaranth-lang/amaranth@7e254b8657e0fa227c1b33437b6103544ca9525d 🚀
jjsuperpower has joined #amaranth-lang
<_whitenotifier-f> [amaranth] wanda-phi opened pull request #941: docs: upgrade Sphinx. - https://github.com/amaranth-lang/amaranth/pull/941
<coltonp> Yep appears to be something with the version. Installing from git seems to have fixed it, thanks for the hint
coltonp has quit [Quit: Client closed]
<Wanda[cis]> ... bleh
<Wanda[cis]> sphinx 7.2 wants Python 3.9
<_whitenotifier-f> [amaranth] codecov[bot] commented on pull request #941: docs: upgrade Sphinx. - https://github.com/amaranth-lang/amaranth/pull/941#issuecomment-1772977418
coltonp has joined #amaranth-lang
<_whitenotifier-f> [amaranth] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-941-7e254b8657e0fa227c1b33437b6103544ca9525d - https://github.com/amaranth-lang/amaranth
<_whitenotifier-f> [amaranth] whitequark commented on pull request #941: docs: upgrade Sphinx. - https://github.com/amaranth-lang/amaranth/pull/941#issuecomment-1772985971
<whitequark[cis]> coltonp: yeah, 0.3 is too old for Python 3.11
<_whitenotifier-f> [amaranth-lang/amaranth] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/amaranth-lang/amaranth/compare/7e254b8657e0...dacbd9dfb05c
<_whitenotifier-f> [amaranth-lang/amaranth] wanda-phi dacbd9d - docs: upgrade Sphinx.
<_whitenotifier-f> [amaranth] whitequark closed pull request #941: docs: upgrade Sphinx. - https://github.com/amaranth-lang/amaranth/pull/941
<_whitenotifier-f> [amaranth] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-941-7e254b8657e0fa227c1b33437b6103544ca9525d - https://github.com/amaranth-lang/amaranth
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #amaranth-lang
cr1901_ has joined #amaranth-lang
<_whitenotifier-f> [amaranth] wanda-phi opened pull request #942: lib.enum: allow using functional syntax for enum creation. - https://github.com/amaranth-lang/amaranth/pull/942
<_whitenotifier-f> [amaranth] codecov[bot] commented on pull request #942: lib.enum: allow using functional syntax for enum creation. - https://github.com/amaranth-lang/amaranth/pull/942#issuecomment-1773023885
cr1901 has quit [Ping timeout: 272 seconds]
<_whitenotifier-f> [amaranth-lang/amaranth-lang.github.io] whitequark pushed 1 commit to main [+0/-3/±63] https://github.com/amaranth-lang/amaranth-lang.github.io/compare/a455eee1f0a6...191070c0f9e7
<_whitenotifier-f> [amaranth-lang/amaranth-lang.github.io] github-merge-queue[bot] 191070c - Deploying to main from @ amaranth-lang/amaranth@dacbd9dfb05c5250ab53945fe846b893db706e1f 🚀
coltonp has quit [Ping timeout: 248 seconds]
cr1901_ is now known as cr1901
jfng[m] has joined #amaranth-lang
<jfng[m]> no SoC meeting today, as our agenda is still empty for now... an RFC for component metadata will come soon-ish, but i'm prototyping it first
<Wanda[cis]> Catherine: wrt RFC 20 (non-FWFT FIFO deprecation): shouldn't constructing a `FIFOInterface(fwft=false)` also raise a deprecation warning? this is currently not included in the RFC
<Wanda[cis]> also: any preferences on the new SyncFIFOBuffered implementation? I'm thinking of just inlining the current SyncFIFO(fwft=False) implementation directly into its code
<Wanda[cis]> s/false/False/
mindw0rk has quit [Ping timeout: 260 seconds]
mindw0rk has joined #amaranth-lang
<Wanda[cis]> huh, handling of edge-case-sized FIFOs is ... not ideal
<Wanda[cis]> SyncFIFOBuffered of depth 1 will just silently fail to work
notgull has quit [Ping timeout: 245 seconds]
notgull has joined #amaranth-lang
<eigenform> I was reading through RFC#2: is 'Signature' eventually going to turn into a generic "aggregate for Signal", regardless of whether or not they're supposed to be ports?
<galibert[m]> You have Struct too
<galibert[m]> Check lib.data
<galibert[m]> Struct and Signature is the result of splitting (and enhancing) the two collided capabilities of Record
<eigenform> My understanding is that Struct and StructLayout are about splitting a single Signal into parts, but there's still just one underlying storage location?
<galibert[m]> Implementation wise there’s only one, synthesis wise multi-bit ffs don’t exist
<galibert[m]> And you don’t usually need to look under the cover of the struct
<eigenform> Right, but there are other cases you might want to represent something in terms of "aggregate of Signals internal to the module" instead of flattening them into one
<eigenform> Signature is pretty close to that (but right now it's just for describing an Interface, not some "internal" bundle of Signal)
zyp[m] has joined #amaranth-lang
<zyp[m]> the way I see it, the main difference between a struct and an interface is that an interface is a collection of signals that each has a direction, while structs are directionless
<zyp[m]> if you build e.g. a stream interface, you'd have signature members for payload/valid/ready/etc…, and then the payload itself could be a struct
<zyp[m]> so first you bundle the data members together into a struct, and then you bundle that together with control signals into an interface
<eigenform> right, but when you want to look at waveforms, the payload is flattened into a single signal - can't distinguish between struct members
<zyp[m]> true, there's an open issue for that: https://github.com/amaranth-lang/amaranth/issues/790
lf has quit [Ping timeout: 252 seconds]
lf has joined #amaranth-lang
<_whitenotifier-f> [amaranth] wanda-phi commented on issue #18: Support transparent ports with RE - https://github.com/amaranth-lang/amaranth/issues/18#issuecomment-1773519586