<d1b2>
following error "ImportError: cannot import name 'soft_unicode' from 'markupsafe'". Is this because I did not install the board definitions properly?
<d1b2>
<juldrp> Oh nvm, looking at the traceback it looks like its caused by from amaranth.build import *, so thats caused by Amaranth itself, not the board definitions... I was able to install Amaranth with the following commands: python -m venv venv; . venv/bin/activate; pip install --upgrade amaranth. and python --version says Python 3.10.10.
<d1b2>
<juldrp> Ok I fixed that error with pip install markupsafe==2.0.1, now I am getting an error about unknown parent cause by from .resources import * line. I guess I will just copy that direcory as well and change that line until i figure out how to properly install the boar definitions...
cr1901_ is now known as cr1901
<d1b2>
<Nate> @juldrp I think I had a similar experience when I started with amaranth
<whitequark>
yeah, this will get fixed by the next release
balrog has quit [Quit: Bye]
balrog has joined #amaranth-lang
<bl0x_>
is there a way to spread one "with m.If() ... with m.Elif() ... with m.Elif() ... with m.Else()" block over several functions?
<bl0x_>
how does one nicely compose such blocks, when they get large and it would make the code more readable, if one could generate the parts from several functions?
<tpw_rules>
isn't that what submodules are for
<bl0x_>
in principle yes, but then I'd need to forward all signals that are used inside... meh
<adamgreig[m]>
You can just call functions and pass them the module object
<tpw_rules>
but yes you can do that
<adamgreig[m]>
And the functions can then add logic and conditions etc etc
<bl0x_>
adamgreig: yes, I've just decided to take this path
<bl0x_>
and try it out
<adamgreig[m]>
I'll often do it with a class where relevant signals and other variables are class members and each method can add stuff
<adamgreig[m]>
Nice way of factoring out logic so you don't just have a ginormous elaborate ()
<bl0x_>
when all relevant signals are accessible via 'self.', then I don't need to pass them all one by one. ... yes!
<bl0x_>
exactly, I'm trying to break down one big elaborate() that has grown for some time.
<bl0x_>
Also, I've found writing a 'connect' method that returns a list of individual connections a nice pattern, but I am not sure if that is much better than just having a regular m.d.comb += [with, all, the, connections]