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
bl0x_ has joined #amaranth-lang
bl0x has quit [Ping timeout: 268 seconds]
Degi_ has joined #amaranth-lang
Degi has quit [Ping timeout: 250 seconds]
Degi_ is now known as Degi
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]
Lord_Nightmare has joined #amaranth-lang
sugarbeet has quit [Read error: Connection reset by peer]
sugarbeet has joined #amaranth-lang
cr1901_ has joined #amaranth-lang
cr1901 has quit [Ping timeout: 248 seconds]
<vup> @jer_emy: right, that are currently unresolved bugs: https://github.com/amaranth-lang/amaranth/issues/415
<d1b2> <juldrp> Hi. I tried installing the board definitions using pip install --upgrade amaranth-boards, but I think that is an empty package. Anyway, trying to follow https://amaranth-lang.org/docs/amaranth/latest/start.html, I copied https://raw.githubusercontent.com/amaranth-lang/amaranth-boards/main/amaranth_boards/icestick.py, then changed the line from amaranth_boards.icestick import * to from icestick.py import *, but the import failed with the
<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]