<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
<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> 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??!!