whitequark changed the topic of #amaranth-lang to: Amaranth hardware definition language · weekly meetings on Mondays at 1700 UTC · code https://github.com/amaranth-lang · logs https://libera.irclog.whitequark.org/amaranth-lang
<_whitenotifier-9> [amaranth-boards] mithro commented on issue #219: How to handle dual-row PMODs? - https://github.com/amaranth-lang/amaranth-boards/issues/219#issuecomment-1464708449
<_whitenotifier-9> [amaranth-boards] mithro commented on issue #219: How to handle dual-row PMODs? - https://github.com/amaranth-lang/amaranth-boards/issues/219#issuecomment-1464717029
crzwdjk has quit [Quit: Client closed]
<_whitenotifier-9> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://github.com/YoWASP/yosys/compare/4e77be9876f4...fe8e729ab034
<_whitenotifier-9> [YoWASP/yosys] whitequark fe8e729 - Update dependencies.
lf has quit [Ping timeout: 252 seconds]
lf has joined #amaranth-lang
<_whitenotifier-9> [amaranth-boards] josuah commented on issue #219: How to handle dual-row PMODs? - https://github.com/amaranth-lang/amaranth-boards/issues/219#issuecomment-1464734832
<_whitenotifier-9> [amaranth-boards] josuah commented on issue #219: How to handle dual-row PMODs? - https://github.com/amaranth-lang/amaranth-boards/issues/219#issuecomment-1464739695
<_whitenotifier-9> [amaranth-boards] josuah commented on issue #219: How to handle dual-row PMODs? - https://github.com/amaranth-lang/amaranth-boards/issues/219#issuecomment-1464742805
bl0x_ has joined #amaranth-lang
bl0x has quit [Ping timeout: 276 seconds]
pbsds has quit [Quit: The Lounge - https://thelounge.chat]
pbsds has joined #amaranth-lang
nelgau has quit []
<cr1901> https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#editable-install-modules-not-found So in VS Code I'm getting "Import "amaranth" could not be resolved." I have it installed via "pip install -e ." Would the linked text apply?
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 248 seconds]
Degi_ is now known as Degi
<cr1901> "pip install -e . --config-settings editable_mode=strict" works; https://setuptools.pypa.io/en/latest/userguide/development_mode.html#strict-editable-installs use carefully (new files added to amaranth will require a reinstall to show up)
<d1b2> <Hardkrash> editable_mode=compat should also work, as it emulates prior behavior.
<cr1901> Indeed, but setuptools docs say it's transitionary and may be removed at any time
<cr1901> m.domains.cd_sync = ClockDomain(reset_less=True) <-- "NameError: Clock domain name 'sync' must match name in `m.domains.cd_sync += ...` syntax" what does this mean? What am I supposed to do?
<cr1901> Doing this as a workaround: "cd_sync = ClockDomain(reset_less=True); m.domains += cd_sync"
<mwk> cr1901: what's your python version and amaranth version?
<cr1901> Python 3.10.10, 0.4.dev58+ga704b1b
<cr1901> Hmmm, that version doesn't seem right. It's supposed to be HEAD as of a few hours ago
<mwk> ah
<mwk> nevermind the version
<mwk> the name in the m.domains dict should *not* start with cd_ prefix, that's the convention for local variable naming
<mwk> m.domains.sync = ClockDomain(...) should work
<mwk> what happens is that amaranth tracer derives the clock domain name by looking at the assigned name (cd_sync) and stripping the "cd_" prefix, if any
<cr1901> Context is "I'm update a Migen design to amaranth, "cd_whatever" is what I used to use"
<mwk> (so that you can store domains in local variables named cd_something)
<mwk> then it processes the assignment to the domain dict and sees a mismatch between "cd_sync" and "sync"
<mwk> it... could use better error handling
<cr1901> the "cd_" stripping behavior is from migen, but I thought it was so that ClockSignal("sync") could work, even if you named the domain cd_sync during the assignment
<mwk> cr1901: yeah, then strip the `cd_` when assigning to m.domains; "m.domains" (and "m.d") takes on the namespacing role that "cd_" did in migen, kind of
<cr1901> I did "cd_sync = ClockDomain(reset_less=True); m.domains += cd_sync" instead, but not sure what that got me
<mwk> that got you a "sync" domain
<mwk> with amaranth, you'd use "cd_" for storing domains in local variables only
<cr1901> (Which I can still get with e.g. ClockSignal("sync"), so I don't actually need a local var. I just, as a convention, name all clock domains w/ cd_ prefix)
<cr1901> Also, m.submodule_name.signal doesn't work in Amaranth IIRC?
<cr1901> You have to do "m.submodules.submodule_name = submodule_name = SubmoduleConstructor()" or similar?
<mwk> you usually store the Elaboratable for your submodule as either a local var or as your own elaboratable instance attr yourself
<cr1901> My responses are short/quick tonight b/c I'm tired. Minddump for later...
<cr1901> with m.Default:
<cr1901> <-- AttributeError: __enter__. I think what I want as an error is "you forgot the parentheses to call Default"
<cr1901> Okay very good... main module ported to Amaranth proper (not the compat layer) and the bitstream still works. Calling it a night.
<d1b2> <Olivier Galibert> I overuse m.submodules .toto = toto = self.toto
<d1b2> <Olivier Galibert> I tend to init self.toto in init
<_whitenotifier-9> [amaranth-boards] josuah commented on issue #219: How to handle dual-row PMODs? - https://github.com/amaranth-lang/amaranth-boards/issues/219#issuecomment-1464877839
Raito_Bezarius has joined #amaranth-lang
Raito_Bezarius has quit [Read error: Connection reset by peer]
Raito_Bezarius has joined #amaranth-lang
Raito_Bezarius has quit [Read error: Connection reset by peer]
Raito_Bezarius has joined #amaranth-lang
<cr1901> What's considered the better design pattern nowadays? Pass clock domain name strings into constructor and use array access on m.d? https://github.com/amaranth-lang/amaranth/blob/main/amaranth/lib/fifo.py#L351
<cr1901> or hardcode names and use "clockdomainsrenamer" decorator?
<cr1901> (Or is it "it depends"?)
<Sarayan> My software engineer side would tend to say "the submodule should have an interface/api, and the caller should adapt". So I'd have the submodule say "provide clock domains sync and ramdac" (for instance) and you go with DomainRenamer, EnableInserter, ResetInserter to create the domain you need in the caller
<Sarayan> and of course if the submodule only wants one domain have it always be sync
phire has quit [*.net *.split]
indy has quit [*.net *.split]
Bluefoxicy has quit [*.net *.split]
agg has quit [*.net *.split]
tpw_rules has quit [*.net *.split]
oter has quit [*.net *.split]
indy has joined #amaranth-lang
tpw_rules has joined #amaranth-lang
Bluefoxicy has joined #amaranth-lang
agg has joined #amaranth-lang
oter has joined #amaranth-lang
phire has joined #amaranth-lang
crzwdjk has joined #amaranth-lang
<crzwdjk> I settled on mostly just using sync in the modules and DomainRenamer
<bl0x_> I use constructor arguments for Modules that use more than one clock domain. And DomainRenamer otherwise
<d1b2> <VA3TEC-Mikek-14362> Hopefully Quick Question: I am getting this error, ModuleNotFoundError: No module named 'amaranth.back.pysim' I see that it has been removed in 0.3 what do I replace it with? Sorry for the question, I am still learning amaranth.. I am trying to use the AMLIB https://github.com/amaranth-farm/amlib library set. Thanks in advanced!!
<adamgreig[m]> amaranth.sim.pysim
<cr1901> Rather than prefer arguments to DomainRenamer or vice-versa, I think I'm going to use the following rule of thumb: If you anticipate sharing/reusing the Elaboratable in many many projects, don't introduce ClockDomains inside it 1/2
<cr1901> Although IIRC, that's what the local argument to ClockDomains is supposed to fix
<d1b2> <VA3TEC-Mikek-14362> What's IIRC? Rule check??
<d1b2> <VA3TEC-Mikek-14362> OH man... I am sorry about this, Now I am having this error.... ImportError: cannot import name 'Simulator' from 'amaranth.sim.pysim' again from the AMLIB library..
<cr1901> IIRC == If I Recall Correctly
<d1b2> <VA3TEC-Mikek-14362> I guess the library has not been updated to 0.4
<d1b2> <VA3TEC-Mikek-14362> I think I found the problem, So Simulator is no longer in pysim.py?? it's now in Core.py??? would that make sense? (again I am VERY new to this! )
<d1b2> <VA3TEC-Mikek-14362> YES that solved the problem,,, Should I do a Pull Request to solve this problem??!!
nak has quit [Ping timeout: 268 seconds]
nak has joined #amaranth-lang